pub struct CallbackClosureMatcher<const CB_NAME_MAX_LENGTH: usize> { /* private fields */ }
Expand description
Helps the callback macro expansion to perform callback name matching more efficiently. The current implementation hashes by callback name length, but in principle further optimizations are possible.
Implementations§
Source§impl<const CB_NAME_MAX_LENGTH: usize> CallbackClosureMatcher<CB_NAME_MAX_LENGTH>
impl<const CB_NAME_MAX_LENGTH: usize> CallbackClosureMatcher<CB_NAME_MAX_LENGTH>
pub fn new<M>(
callback_name: &ManagedBuffer<M>,
) -> CallbackClosureMatcher<CB_NAME_MAX_LENGTH>where
M: ManagedTypeApi + ErrorApi,
pub fn new_from_unmanaged( callback_name: &[u8], ) -> CallbackClosureMatcher<CB_NAME_MAX_LENGTH>
pub fn matches_empty(&self) -> bool
pub fn name_matches(&self, name_match: &[u8]) -> bool
Auto Trait Implementations§
impl<const CB_NAME_MAX_LENGTH: usize> Freeze for CallbackClosureMatcher<CB_NAME_MAX_LENGTH>
impl<const CB_NAME_MAX_LENGTH: usize> RefUnwindSafe for CallbackClosureMatcher<CB_NAME_MAX_LENGTH>
impl<const CB_NAME_MAX_LENGTH: usize> Send for CallbackClosureMatcher<CB_NAME_MAX_LENGTH>
impl<const CB_NAME_MAX_LENGTH: usize> Sync for CallbackClosureMatcher<CB_NAME_MAX_LENGTH>
impl<const CB_NAME_MAX_LENGTH: usize> Unpin for CallbackClosureMatcher<CB_NAME_MAX_LENGTH>
impl<const CB_NAME_MAX_LENGTH: usize> UnwindSafe for CallbackClosureMatcher<CB_NAME_MAX_LENGTH>
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> InterpretableFrom<T> for T
impl<T> InterpretableFrom<T> for T
fn interpret_from(from: T, _context: &InterpreterContext) -> T
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