[−][src]Struct vtil_parser::VTILTryBuilder
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 makin your code both easier to refactor and more readable. Call try_build()
or try_build_or_recover()
to construct the actual struct. The fields of this struct should be used as follows:
Field | Suggested Use |
---|---|
source | Directly pass in the value this field should contain |
inner_builder | Use a function or closure: (source: &_) -> Result<inner: _, Error_> |
phantom | Directly 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) -> Result<VTILInner<'this>, Error_>, Error_> VTILTryBuilder<T, InnerBuilder_, Error_>
[src]
pub fn try_build(self) -> Result<VTIL<T>, Error_>
[src]
Calls VTIL::try_new()
using the provided values. This is preferrable over calling try_new()
directly for the reasons listed above.
pub fn try_build_or_recover(self) -> Result<VTIL<T>, (Error_, Heads<T>)>
[src]
Calls VTIL::try_new_or_recover()
using the provided values. This is preferrable over calling try_new_or_recover()
directly for the reasons listed above.
Auto Trait Implementations
impl<T, InnerBuilder_, Error_> RefUnwindSafe for VTILTryBuilder<T, InnerBuilder_, Error_> where
InnerBuilder_: RefUnwindSafe,
T: RefUnwindSafe,
InnerBuilder_: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, InnerBuilder_, Error_> Send for VTILTryBuilder<T, InnerBuilder_, Error_> where
InnerBuilder_: Send,
T: Send,
InnerBuilder_: Send,
T: Send,
impl<T, InnerBuilder_, Error_> Sync for VTILTryBuilder<T, InnerBuilder_, Error_> where
InnerBuilder_: Sync,
T: Sync,
InnerBuilder_: Sync,
T: Sync,
impl<T, InnerBuilder_, Error_> Unpin for VTILTryBuilder<T, InnerBuilder_, Error_> where
InnerBuilder_: Unpin,
T: Unpin,
InnerBuilder_: Unpin,
T: Unpin,
impl<T, InnerBuilder_, Error_> UnwindSafe for VTILTryBuilder<T, InnerBuilder_, Error_> where
InnerBuilder_: UnwindSafe,
T: UnwindSafe,
InnerBuilder_: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,