Struct code_generator::JoinedCode
source · pub struct JoinedCode { /* private fields */ }Expand description
The JoinedCode struct joins multiple sections of code with no further formatting, or configuration done outside, inside, or between units.
Implementations§
source§impl JoinedCode
impl JoinedCode
sourcepub fn new(set: Vec<Box<dyn CodeGenerate>>) -> JoinedCode
pub fn new(set: Vec<Box<dyn CodeGenerate>>) -> JoinedCode
Creates a JoinedCode generator
This struct makes it easy to change the new line format based on the context of the generator.
let joined = JoinedCode::new(vec![
Box::new(String::from("This")),
Box::new(String::from(":")),
Box::new(String::from("Is")),
Box::new(String::from(":")),
Box::new(String::from("Joined"))
]);
let mut info = CodeGenerationInfo::new();
assert_eq!("This:Is:Joined", format!("{}", joined.display(info)));Trait Implementations§
source§impl CodeGenerate for JoinedCode
impl CodeGenerate for JoinedCode
Auto Trait Implementations§
impl Freeze for JoinedCode
impl !RefUnwindSafe for JoinedCode
impl !Send for JoinedCode
impl !Sync for JoinedCode
impl Unpin for JoinedCode
impl !UnwindSafe for JoinedCode
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