pub enum NulledResponses<T> {
Repeating(T),
Sequence(Vec<T>),
}
Expand description
NulledResponses
helps with implementing Configurable Responses for Nullable types.
Variants§
Repeating(T)
Repeat a single response forever.
Sequence(Vec<T>)
Return a sequence of responses, panicking when the sequence runs out.
Implementations§
Source§impl<T> NulledResponses<T>
impl<T> NulledResponses<T>
Sourcepub fn backmap<U>(self, mapper: impl FnMut(T) -> U) -> NulledResponses<U>
pub fn backmap<U>(self, mapper: impl FnMut(T) -> U) -> NulledResponses<U>
Backmap can be used to convert between NulledResponses
for different types.
For example, a high-level infrastructure wrapper can use this to convert its own response configuration into a response configuration for an embedded lower-level infrastructure wrapper.
Trait Implementations§
Source§impl<T: Clone> Clone for NulledResponses<T>
impl<T: Clone> Clone for NulledResponses<T>
Source§fn clone(&self) -> NulledResponses<T>
fn clone(&self) -> NulledResponses<T>
Returns a copy 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 moreSource§impl<T: Debug> Debug for NulledResponses<T>
impl<T: Debug> Debug for NulledResponses<T>
Source§impl<T> From<T> for NulledResponses<T>where
T: Clone,
impl<T> From<T> for NulledResponses<T>where
T: Clone,
Auto Trait Implementations§
impl<T> Freeze for NulledResponses<T>where
T: Freeze,
impl<T> RefUnwindSafe for NulledResponses<T>where
T: RefUnwindSafe,
impl<T> Send for NulledResponses<T>where
T: Send,
impl<T> Sync for NulledResponses<T>where
T: Sync,
impl<T> Unpin for NulledResponses<T>where
T: Unpin,
impl<T> UnwindSafe for NulledResponses<T>where
T: 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