/* * Copyright 2024 Luca Fulchir * * Licensed under the Apache License, Version 2.0 with LLVM exception (the * "License"); you may not use this file except in compliance with the * License. You may obtain a copy of the License and of the exception at * * http://www.apache.org/licenses/LICENSE-2.0 * https://spdx.org/licenses/LLVM-exception.html * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ mod conf; mod repos; /* trait TP { fn p(r: &impl TR); } trait TR { fn r(); } struct R {} impl TR for R { fn r() {} } struct P {} impl TP for P { fn p(r: &impl TR) {} } */ fn main() { //let one = repos::pkgs::one::One::default(); let pkgs1 = repos::Pkgs1::default(); let pkgs2 = repos::Pkgs2::default(); use ::bok::Repository; println!("pkgs1: {}", pkgs1.name()); println!("pkgs2: {}", pkgs2.name()); /* let mut pb: pkgs::one::OneBuilder = pkgs1.one(); let b = pb.as_builder(); let a = pb.as_any_mut(); let m_pb2: Option<&mut pkgs::one::OneBuilder> = a.downcast_mut(); use ::bok::{Pkg, PkgBuilder}; println!("m_pb2: {:?}", m_pb2); let m_pkg = pb.default_unused().build(); println!("m_pb2: {:?}", m_pkg); if let Ok(pkg) = m_pkg { println!("one: {}: {:?}", pkg.name(), pkg); println!("hash one: {}", pkg.hash()); println!("hash one code: {}", pkg.hash_code()); } */ /* println!("pkgs1 - 1:{}", pkgs1.one().default_unused().build().my_attr); println!("pkgs1 - 2:{}", pkgs1.two().my_attr); println!("pkgs2 - 1:{}", pkgs2.one().my_attr); println!("pkgs2 - 2:{}", pkgs2.two().my_attr); println!("pkgs2 - 3:{}", pkgs2.three().my_attr); println!("pkgs2-1:\n{}", pkgs2.one()); println!("pkgs2-2:\n{}", pkgs2.two()); println!("pkgs2-3:\n{}", pkgs2.three()); */ }