pub struct SocketDeviceUpdate<'a, A: IpAddress, D: WeakDeviceIdentifier> {
pub local_ip: Option<&'a SpecifiedAddr<A>>,
pub remote_ip: Option<&'a SpecifiedAddr<A>>,
pub old_device: Option<&'a D>,
}
Expand description
A helper type to verify if applying socket updates is allowed for a given current state.
The fields in SocketDeviceUpdate
define the current state,
[SocketDeviceUpdate::try_update
] applies the verification logic.
Fields§
§local_ip: Option<&'a SpecifiedAddr<A>>
The current local IP address.
remote_ip: Option<&'a SpecifiedAddr<A>>
The current remote IP address.
old_device: Option<&'a D>
The currently bound device.
Implementations§
Source§impl<'a, A: IpAddress, D: WeakDeviceIdentifier> SocketDeviceUpdate<'a, A, D>
impl<'a, A: IpAddress, D: WeakDeviceIdentifier> SocketDeviceUpdate<'a, A, D>
Sourcepub fn check_update<N>(
self,
new_device: Option<&N>,
) -> Result<(), SocketDeviceUpdateNotAllowedError>where
D: PartialEq<N>,
pub fn check_update<N>(
self,
new_device: Option<&N>,
) -> Result<(), SocketDeviceUpdateNotAllowedError>where
D: PartialEq<N>,
Checks if an update from old_device
to new_device
is allowed,
returning an error if not.
Auto Trait Implementations§
impl<'a, A, D> Freeze for SocketDeviceUpdate<'a, A, D>
impl<'a, A, D> RefUnwindSafe for SocketDeviceUpdate<'a, A, D>where
D: RefUnwindSafe,
A: RefUnwindSafe,
impl<'a, A, D> Send for SocketDeviceUpdate<'a, A, D>
impl<'a, A, D> Sync for SocketDeviceUpdate<'a, A, D>
impl<'a, A, D> Unpin for SocketDeviceUpdate<'a, A, D>
impl<'a, A, D> UnwindSafe for SocketDeviceUpdate<'a, A, D>where
D: RefUnwindSafe,
A: RefUnwindSafe,
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<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