pub struct WithPeerId<T>(_, pub T);
Expand description
Generic wrapper with peer id
Tuple Fields§
§1: T
Implementations§
Source§impl<T> WithPeerId<T>
impl<T> WithPeerId<T>
Sourcepub fn transform<F: From<T>>(self) -> WithPeerId<F>
pub fn transform<F: From<T>>(self) -> WithPeerId<F>
Transform the data
Sourcepub fn map<U, F: FnOnce(T) -> U>(self, op: F) -> WithPeerId<U>
pub fn map<U, F: FnOnce(T) -> U>(self, op: F) -> WithPeerId<U>
Maps the inner value to a new value using the given function.
Source§impl<T> WithPeerId<Option<T>>
impl<T> WithPeerId<Option<T>>
Sourcepub fn transpose(self) -> Option<WithPeerId<T>>
pub fn transpose(self) -> Option<WithPeerId<T>>
returns None
if the inner value is None
, otherwise returns Some(WithPeerId<T>)
.
Trait Implementations§
Source§impl<T: Debug> Debug for WithPeerId<T>
impl<T: Debug> Debug for WithPeerId<T>
Auto Trait Implementations§
impl<T> Freeze for WithPeerId<T>where
T: Freeze,
impl<T> RefUnwindSafe for WithPeerId<T>where
T: RefUnwindSafe,
impl<T> Send for WithPeerId<T>where
T: Send,
impl<T> Sync for WithPeerId<T>where
T: Sync,
impl<T> Unpin for WithPeerId<T>where
T: Unpin,
impl<T> UnwindSafe for WithPeerId<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
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> MaybeSendSync for T
Layout§
Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.