pub struct Generator<'a, 'b> {
pub root_name: Option<String>,
pub schemafy_path: &'a str,
pub input_file: &'b Path,
}
Expand description
A configurable builder for generating Rust types from a JSON schema.
The default options are usually fine. In that case, you can use
the generate()
convenience method instead.
Fields§
§root_name: Option<String>
The name of the root type defined by the schema. If the schema
does not define a root type (some schemas are simply a
collection of definitions) then simply pass None
.
schemafy_path: &'a str
The module path to this crate. Some generated code may make use of types defined in this crate. Unless you have re-exported this crate or imported it under a different name, the default should be fine.
input_file: &'b Path
The JSON schema file to read
Implementations§
Trait Implementations§
impl<'a, 'b> StructuralPartialEq for Generator<'a, 'b>
Auto Trait Implementations§
impl<'a, 'b> Freeze for Generator<'a, 'b>
impl<'a, 'b> RefUnwindSafe for Generator<'a, 'b>
impl<'a, 'b> Send for Generator<'a, 'b>
impl<'a, 'b> Sync for Generator<'a, 'b>
impl<'a, 'b> Unpin for Generator<'a, 'b>
impl<'a, 'b> UnwindSafe for Generator<'a, 'b>
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