pub struct FnMutMessageHandler { /* private fields */ }Implementations§
Source§impl FnMutMessageHandler
impl FnMutMessageHandler
pub fn new() -> Self
Sourcepub fn set<T>(
&mut self,
ctx: &mut T,
func: fn(&mut T, &[u8], AeronHeader),
) -> &mut Self
pub fn set<T>( &mut self, ctx: &mut T, func: fn(&mut T, &[u8], AeronHeader), ) -> &mut Self
Point this handler at ctx / func so the next call
dispatches into them.
§Lifetime contract (caller must uphold)
ctx is stored as a raw *mut () that escapes the borrow — the
borrow checker does NOT keep it alive. The caller MUST ensure ctx
outlives every subsequent call (i.e. ctx is dropped only after this
handler is retired or re-set). Calling call after ctx is dropped is
use-after-free. ctx must also not be moved while borrowed.
pub fn call(&mut self, msg: &[u8], header: AeronHeader)
Sourcepub fn clear(&mut self)
pub fn clear(&mut self)
Drop the borrowed ctx so a later stray call is a safe no-op
(the noop func is restored and the pointer nulled) rather than a use-after-free.
AeronFragmentClosureAssembler::poll calls this before returning so the
raw pointer never outlives the borrow it was created from.
Trait Implementations§
Source§impl AeronFragmentHandlerCallback for FnMutMessageHandler
impl AeronFragmentHandlerCallback for FnMutMessageHandler
fn handle_aeron_fragment_handler(&mut self, buffer: &[u8], header: AeronHeader)
Auto Trait Implementations§
impl Freeze for FnMutMessageHandler
impl RefUnwindSafe for FnMutMessageHandler
impl !Send for FnMutMessageHandler
impl !Sync for FnMutMessageHandler
impl Unpin for FnMutMessageHandler
impl UnsafeUnpin for FnMutMessageHandler
impl UnwindSafe for FnMutMessageHandler
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