pub struct ForwardingBuilder<AP> { /* private fields */ }Expand description
A intermediate Builder without dyn state.
When different builder shall be hidden behind a dyn Builder it is required
that all such builders have the same dyn state type. Thus, often non dyn
state or the () unit type as dyn state is used. This wrapper builder now
allows to wrap arbitrary builders (e.g. those with a dyn state) into a
builder that dose has the () unit type as dyn state. So that it may be
use to create cast it into dyn Builder with the () unit type as dyn state.
However, in order to create a valid artifact, the artifact is kept in its bin-state.
Also see the ClonedBuilder for an alternative.
Implementations§
Source§impl<AP> ForwardingBuilder<AP>
impl<AP> ForwardingBuilder<AP>
Trait Implementations§
Source§impl<ArtCan, AP, B, BCan> Builder<ArtCan, BCan> for ForwardingBuilder<AP>
impl<ArtCan, AP, B, BCan> Builder<ArtCan, BCan> for ForwardingBuilder<AP>
Source§type Artifact = <B as Builder<ArtCan, BCan>>::Artifact
type Artifact = <B as Builder<ArtCan, BCan>>::Artifact
The artifact type as produced by this builder.
Source§type Err = <B as Builder<ArtCan, BCan>>::Err
type Err = <B as Builder<ArtCan, BCan>>::Err
Error type returned by this Builder in case of failure to produce an
Artifact.
Source§fn build(
&self,
resolver: &mut Resolver<'_, ArtCan, BCan, Self::DynState>,
) -> Result<ArtCan::Bin, Self::Err>
fn build( &self, resolver: &mut Resolver<'_, ArtCan, BCan, Self::DynState>, ) -> Result<ArtCan::Bin, Self::Err>
Produces an artifact using the given
Resolver for resolving
dependencies.Source§fn init_dyn_state(&self) -> Self::DynState
fn init_dyn_state(&self) -> Self::DynState
Return an initial dynamic state for this builder. Read more
Source§impl<AP: Clone> Clone for ForwardingBuilder<AP>
impl<AP: Clone> Clone for ForwardingBuilder<AP>
Source§fn clone(&self) -> ForwardingBuilder<AP>
fn clone(&self) -> ForwardingBuilder<AP>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<AP> Freeze for ForwardingBuilder<AP>where
AP: Freeze,
impl<AP> RefUnwindSafe for ForwardingBuilder<AP>where
AP: RefUnwindSafe,
impl<AP> Send for ForwardingBuilder<AP>where
AP: Send,
impl<AP> Sync for ForwardingBuilder<AP>where
AP: Sync,
impl<AP> Unpin for ForwardingBuilder<AP>where
AP: Unpin,
impl<AP> UnwindSafe for ForwardingBuilder<AP>where
AP: UnwindSafe,
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