pub struct LogoParser;Implementations§
Source§impl LogoParser
impl LogoParser
Sourcepub fn from(
path: &Path,
) -> Result<(Vec<String>, Vec<String>, ColorConfig), Error>
pub fn from( path: &Path, ) -> Result<(Vec<String>, Vec<String>, ColorConfig), Error>
Examples found in repository?
examples/basic.rs (line 18)
14fn main() -> Result<(), Box<dyn Error>> {
15 let path: &Path = Path::new("examples/tux.json");
16
17 println!("Loading logo from file...");
18 let (large, _, colors): (Vec<String>, Vec<String>, ColorConfig) = LogoParser::from(path)?;
19
20 println!("Logo lines: {}", large.len());
21 println!("Title color: {:?}", colors.title_color);
22 println!("Keys color: {:?}", colors.keys_color);
23 println!("ASCII colors: {}", colors.ascii_colors.len());
24
25 for (i, line) in large.iter().enumerate() {
26 println!("[{}] {}", i, line);
27 }
28
29 Ok(())
30}Auto Trait Implementations§
impl Freeze for LogoParser
impl RefUnwindSafe for LogoParser
impl Send for LogoParser
impl Sync for LogoParser
impl Unpin for LogoParser
impl UnsafeUnpin for LogoParser
impl UnwindSafe for LogoParser
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more