[][src]Struct vtil_parser::VTILBuilder

pub struct VTILBuilder<T: 'static, InnerBuilder_: for<'this> FnOnce(&'this <Box<T> as Deref>::Target) -> VTILInner<'this>> {
    pub source: Box<T>,
    pub inner_builder: InnerBuilder_,
    pub phantom: PhantomData<T>,
}

A more verbose but stable way to construct self-referencing structs. It is comparable to using StructName { field1: value1, field2: value2 } rather than StructName::new(value1, value2). This has the dual benefit of making your code both easier to refactor and more readable. Call build() to construct the actual struct. The fields of this struct should be used as follows:

FieldSuggested Use
sourceDirectly pass in the value this field should contain
inner_builderUse a function or closure: (source: &_) -> inner: _
phantomDirectly pass in the value this field should contain

Fields

source: Box<T>inner_builder: InnerBuilder_phantom: PhantomData<T>

Implementations

impl<T: 'static, InnerBuilder_: for<'this> FnOnce(&'this <Box<T> as Deref>::Target) -> VTILInner<'this>> VTILBuilder<T, InnerBuilder_>[src]

pub fn build(self) -> VTIL<T>[src]

Calls VTIL::new() using the provided values. This is preferrable over calling new() directly for the reasons listed above.

Auto Trait Implementations

impl<T, InnerBuilder_> RefUnwindSafe for VTILBuilder<T, InnerBuilder_> where
    InnerBuilder_: RefUnwindSafe,
    T: RefUnwindSafe

impl<T, InnerBuilder_> Send for VTILBuilder<T, InnerBuilder_> where
    InnerBuilder_: Send,
    T: Send

impl<T, InnerBuilder_> Sync for VTILBuilder<T, InnerBuilder_> where
    InnerBuilder_: Sync,
    T: Sync

impl<T, InnerBuilder_> Unpin for VTILBuilder<T, InnerBuilder_> where
    InnerBuilder_: Unpin,
    T: Unpin

impl<T, InnerBuilder_> UnwindSafe for VTILBuilder<T, InnerBuilder_> where
    InnerBuilder_: UnwindSafe,
    T: UnwindSafe

Blanket Implementations

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

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

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

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

impl<T, U> Into<U> for T where
    U: From<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.