pub enum EitherDeviceId<S, W> {
Strong(S),
Weak(W),
}
Expand description
A device id that might be either in its strong or weak form.
Variants§
Implementations§
Source§impl<S: StrongDeviceIdentifier, W: WeakDeviceIdentifier<Strong = S>> EitherDeviceId<&S, &W>
impl<S: StrongDeviceIdentifier, W: WeakDeviceIdentifier<Strong = S>> EitherDeviceId<&S, &W>
Sourcepub fn as_strong_ref<'a>(&'a self) -> Option<Cow<'a, S>>
pub fn as_strong_ref<'a>(&'a self) -> Option<Cow<'a, S>>
Returns a Cow
reference for the strong variant.
Attempts to upgrade if this is a Weak
variant.
Source§impl<S, W> EitherDeviceId<S, W>
impl<S, W> EitherDeviceId<S, W>
Source§impl<S: StrongDeviceIdentifier<Weak = W>, W: WeakDeviceIdentifier<Strong = S>> EitherDeviceId<S, W>
impl<S: StrongDeviceIdentifier<Weak = W>, W: WeakDeviceIdentifier<Strong = S>> EitherDeviceId<S, W>
Trait Implementations§
Source§impl<S: Clone, W: Clone> Clone for EitherDeviceId<S, W>
impl<S: Clone, W: Clone> Clone for EitherDeviceId<S, W>
Source§fn clone(&self) -> EitherDeviceId<S, W>
fn clone(&self) -> EitherDeviceId<S, W>
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 moreimpl<S: Copy, W: Copy> Copy for EitherDeviceId<S, W>
Auto Trait Implementations§
impl<S, W> Freeze for EitherDeviceId<S, W>
impl<S, W> RefUnwindSafe for EitherDeviceId<S, W>where
S: RefUnwindSafe,
W: RefUnwindSafe,
impl<S, W> Send for EitherDeviceId<S, W>
impl<S, W> Sync for EitherDeviceId<S, W>
impl<S, W> Unpin for EitherDeviceId<S, W>
impl<S, W> UnwindSafe for EitherDeviceId<S, W>where
S: UnwindSafe,
W: 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)Source§impl<CC, BC, Meta> RecvFrameContext<Meta, BC> for CCwhere
Meta: ReceivableFrameMeta<CC, BC>,
impl<CC, BC, Meta> RecvFrameContext<Meta, BC> for CCwhere
Meta: ReceivableFrameMeta<CC, BC>,
Source§impl<CC, BC, Meta> SendFrameContext<BC, Meta> for CCwhere
Meta: SendableFrameMeta<CC, BC>,
impl<CC, BC, Meta> SendFrameContext<BC, Meta> for CCwhere
Meta: SendableFrameMeta<CC, BC>,
Source§fn send_frame<S>(
&mut self,
bindings_ctx: &mut BC,
metadata: Meta,
frame: S,
) -> Result<(), ErrorAndSerializer<SendFrameErrorReason, S>>where
S: Serializer,
<S as Serializer>::Buffer: BufferMut,
fn send_frame<S>(
&mut self,
bindings_ctx: &mut BC,
metadata: Meta,
frame: S,
) -> Result<(), ErrorAndSerializer<SendFrameErrorReason, S>>where
S: Serializer,
<S as Serializer>::Buffer: BufferMut,
Send a frame. Read more
Source§impl<Id, CC, BC> TimerHandler<BC, Id> for CCwhere
BC: TimerBindingsTypes,
Id: HandleableTimer<CC, BC>,
impl<Id, CC, BC> TimerHandler<BC, Id> for CCwhere
BC: TimerBindingsTypes,
Id: HandleableTimer<CC, BC>,
Source§fn handle_timer(
&mut self,
bindings_ctx: &mut BC,
dispatch: Id,
timer: <BC as TimerBindingsTypes>::UniqueTimerId,
)
fn handle_timer( &mut self, bindings_ctx: &mut BC, dispatch: Id, timer: <BC as TimerBindingsTypes>::UniqueTimerId, )
Handle a timer firing. Read more