Enum distant_core::data::DistantMsg
source · [−]pub enum DistantMsg<T> {
Single(T),
Batch(Vec<T>),
}Expand description
Represents a wrapper around a distant message, supporting single and batch requests
Variants
Single(T)
Batch(Vec<T>)
Implementations
sourceimpl<T> DistantMsg<T>
impl<T> DistantMsg<T>
sourcepub fn as_single(&self) -> Option<&T>
pub fn as_single(&self) -> Option<&T>
Returns reference to single value if msg is single variant
sourcepub fn as_mut_single(&mut self) -> Option<&T>
pub fn as_mut_single(&mut self) -> Option<&T>
Returns mutable reference to single value if msg is single variant
sourcepub fn into_single(self) -> Option<T>
pub fn into_single(self) -> Option<T>
Returns the single value if msg is single variant
sourcepub fn as_batch(&self) -> Option<&[T]>
pub fn as_batch(&self) -> Option<&[T]>
Returns reference to batch value if msg is batch variant
sourcepub fn as_mut_batch(&mut self) -> Option<&mut [T]>
pub fn as_mut_batch(&mut self) -> Option<&mut [T]>
Returns mutable reference to batch value if msg is batch variant
sourcepub fn into_batch(self) -> Option<Vec<T>>
pub fn into_batch(self) -> Option<Vec<T>>
Returns the batch value if msg is batch variant
Trait Implementations
sourceimpl<T: Clone> Clone for DistantMsg<T>
impl<T: Clone> Clone for DistantMsg<T>
sourcefn clone(&self) -> DistantMsg<T>
fn clone(&self) -> DistantMsg<T>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl<T: Debug> Debug for DistantMsg<T>
impl<T: Debug> Debug for DistantMsg<T>
sourceimpl<'de, T> Deserialize<'de> for DistantMsg<T> where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for DistantMsg<T> where
T: Deserialize<'de>,
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl<T> From<T> for DistantMsg<T>
impl<T> From<T> for DistantMsg<T>
sourcefn from(original: T) -> DistantMsg<T>
fn from(original: T) -> DistantMsg<T>
Converts to this type from the input type.
sourceimpl<T> From<Vec<T, Global>> for DistantMsg<T>
impl<T> From<Vec<T, Global>> for DistantMsg<T>
sourcefn from(original: Vec<T>) -> DistantMsg<T>
fn from(original: Vec<T>) -> DistantMsg<T>
Converts to this type from the input type.
sourceimpl<T: PartialEq> PartialEq<DistantMsg<T>> for DistantMsg<T>
impl<T: PartialEq> PartialEq<DistantMsg<T>> for DistantMsg<T>
sourcefn eq(&self, other: &DistantMsg<T>) -> bool
fn eq(&self, other: &DistantMsg<T>) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &DistantMsg<T>) -> bool
fn ne(&self, other: &DistantMsg<T>) -> bool
This method tests for !=.
sourceimpl<T> Serialize for DistantMsg<T> where
T: Serialize,
impl<T> Serialize for DistantMsg<T> where
T: Serialize,
impl<T: Eq> Eq for DistantMsg<T>
impl<T> StructuralEq for DistantMsg<T>
impl<T> StructuralPartialEq for DistantMsg<T>
Auto Trait Implementations
impl<T> RefUnwindSafe for DistantMsg<T> where
T: RefUnwindSafe,
impl<T> Send for DistantMsg<T> where
T: Send,
impl<T> Sync for DistantMsg<T> where
T: Sync,
impl<T> Unpin for DistantMsg<T> where
T: Unpin,
impl<T> UnwindSafe for DistantMsg<T> where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more