pub struct Config { /* private fields */ }
Expand description
Configuration for Java.
Implementations§
Source§impl Config
impl Config
Sourcepub fn with_package<P>(self, package: P) -> Self
pub fn with_package<P>(self, package: P) -> Self
Configure package to use for the file generated.
§Examples
use genco::prelude::*;
use genco::fmt;
let optional = java::import("java.util", "Optional");
let toks = quote!($optional);
let config = java::Config::default().with_package("java.util");
let fmt = fmt::Config::from_lang::<Java>();
let mut w = fmt::VecWriter::new();
toks.format_file(&mut w.as_formatter(&fmt), &config)?;
assert_eq!(
vec![
"package java.util;",
"",
"Optional",
],
w.into_vec(),
);
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
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