pub struct Handler<T> { /* private fields */ }Expand description
§Handler
Handler is a struct that wraps a raw pointer and a drop flag.
Memory is freed automatically when Handler goes out of scope (via Drop).
You must ensure the Handler outlives the Aeron session that uses it, since Aeron
holds a raw clientd pointer to the boxed value and will call callbacks until closed.
Call release() early if you want to free the memory before the Handler drops.
§Example
use rusteron_code_gen::Handler;
let handler = Handler::leak(your_value);
// handler is freed automatically when it goes out of scopeImplementations§
Source§impl<T: AeronFragmentHandlerCallback> Handler<T>
impl<T: AeronFragmentHandlerCallback> Handler<T>
pub fn leak_with_fragment_assembler( handler: T, ) -> Result<(Handler<AeronFragmentAssembler>, Handler<T>), AeronCError>
Source§impl<T: AeronControlledFragmentHandlerCallback> Handler<T>
impl<T: AeronControlledFragmentHandlerCallback> Handler<T>
pub fn leak_with_controlled_fragment_assembler( handler: T, ) -> Result<(Handler<AeronControlledFragmentAssembler>, Handler<T>), AeronCError>
Trait Implementations§
impl<T> Send for Handler<T>
impl<T> Sync for Handler<T>
Auto Trait Implementations§
impl<T> Freeze for Handler<T>
impl<T> RefUnwindSafe for Handler<T>where
T: RefUnwindSafe,
impl<T> Unpin for Handler<T>
impl<T> UnwindSafe for Handler<T>where
T: 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