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