[][src]Struct paperclip::v2::codegen::DefaultEmitter

pub struct DefaultEmitter<S> { /* fields omitted */ }

Default emitter for anything that implements Schema trait.

This doesn't do anything special, as Emitter trait methods take care of all the heavy load.

Trait Implementations

impl<S: Schema + Debug> Emitter for DefaultEmitter<S>[src]

type Definition = S

The associated Schema implementor.

fn generate(&self, api: &Api<Self::Definition>) -> Result<(), Error>[src]

Entrypoint for emitter. Given an API spec, generate code inside Rust modules in the configured working directory. Read more

fn def_ns_name<'a>(
    &self,
    def: &'a Self::Definition
) -> Result<Box<dyn Iterator<Item = String> + 'a>, Error>
[src]

Returns an iterator of path components for the given definition. Read more

fn def_name(&self, def: &Self::Definition) -> Result<String, Error>[src]

Returns the CamelCase name for the given definition. Read more

fn def_mod_path(&self, def: &Self::Definition) -> Result<PathBuf, Error>[src]

Returns the module path (from working directory) for the given definition. Read more

fn build_def(
    &self,
    def: &Self::Definition,
    define: bool
) -> Result<EmittedUnit, Error>
[src]

Builds a given definition. Also takes a bool to specify whether we're planning to define a Rust type or whether we're reusing an existing type. Read more

impl<S> From<EmitterState> for DefaultEmitter<S>[src]

Auto Trait Implementations

impl<S> !Send for DefaultEmitter<S>

impl<S> !Sync for DefaultEmitter<S>

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]