pub struct EthernetTx { /* private fields */ }Implementations§
Source§impl EthernetTx
impl EthernetTx
Sourcepub fn new(sender: Box<dyn EthernetTxEventSender>) -> Self
pub fn new(sender: Box<dyn EthernetTxEventSender>) -> Self
Return a pinned EthernetTx.
Pinning the returned value is imperative to ensure future to_c_binding() calls will return
pointers that are valid for the lifetime of the returned value.
Sourcepub unsafe fn to_ffi(&self) -> FfiEthernetTx
pub unsafe fn to_ffi(&self) -> FfiEthernetTx
Returns a FfiEthernetTx containing functions to queue EthernetTxEvent values into the
corresponding EthernetTx.
Note that the pointers in the returned FfiEthernetTx are all to static and pinned values
so it’s safe to move this EthernetTx after calling this function.
§Safety
This method unsafe because we cannot guarantee the returned FfiEthernetTxCtx
will have a lifetime that is shorther than this EthernetTx.
By using this method, the caller promises the lifetime of this EthernetTx will exceed the
ctx pointer used across the FFI boundary.
Auto Trait Implementations§
impl Freeze for EthernetTx
impl !RefUnwindSafe for EthernetTx
impl !Send for EthernetTx
impl !Sync for EthernetTx
impl Unpin for EthernetTx
impl !UnwindSafe for EthernetTx
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, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more