pub struct WithNull<R>(pub R);Expand description
Wraps a host registry so that null is always available.
Tuple Fields§
§0: RTrait Implementations§
Source§impl<R: DatamodelRegistry> DatamodelRegistry for WithNull<R>
impl<R: DatamodelRegistry> DatamodelRegistry for WithNull<R>
Source§fn create(&self, name: &str) -> Option<Box<dyn Datamodel>>
fn create(&self, name: &str) -> Option<Box<dyn Datamodel>>
A fresh datamodel instance for
name, or None when it is not registered.Source§fn create_for(
&self,
chart: &Chart,
) -> Option<Result<Box<dyn Datamodel>, Vec<String>>>
fn create_for( &self, chart: &Chart, ) -> Option<Result<Box<dyn Datamodel>, Vec<String>>>
A fresh datamodel instance for
chart, prepared from the whole chart: None when the
chart’s datamodel is not registered, and Some(Err(problems)) when the datamodel
refuses to instantiate the chart (a statically checked datamodel refuses a chart with
type errors). The default creates the datamodel by name and refuses nothing. Read moreAuto Trait Implementations§
impl<R> Forget for WithNull<R>
impl<R> Freeze for WithNull<R>where
R: Freeze,
impl<R> Move for WithNull<R>
impl<R> RefUnwindSafe for WithNull<R>where
R: RefUnwindSafe,
impl<R> Send for WithNull<R>where
R: Send,
impl<R> Sync for WithNull<R>where
R: Sync,
impl<R> Unpin for WithNull<R>where
R: Unpin,
impl<R> UnsafeUnpin for WithNull<R>where
R: UnsafeUnpin,
impl<R> UnwindSafe for WithNull<R>where
R: 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