pub enum AnySubscriptionCallback<T>where
T: Message,{
Regular(Box<dyn FnMut(T) + Send>),
RegularWithMessageInfo(Box<dyn FnMut(T, MessageInfo) + Send>),
Boxed(Box<dyn FnMut(Box<T>) + Send>),
BoxedWithMessageInfo(Box<dyn FnMut(Box<T>, MessageInfo) + Send>),
Loaned(Box<dyn for<'a> FnMut(ReadOnlyLoanedMessage<'a, T>) + Send>),
LoanedWithMessageInfo(Box<dyn for<'a> FnMut(ReadOnlyLoanedMessage<'a, T>, MessageInfo) + Send>),
}
Expand description
An enum capturing the various possible function signatures for subscription callbacks.
The correct enum variant is deduced by the SubscriptionCallback
trait.
Variants§
Regular(Box<dyn FnMut(T) + Send>)
A callback with only the message as an argument.
RegularWithMessageInfo(Box<dyn FnMut(T, MessageInfo) + Send>)
A callback with the message and the message info as arguments.
Boxed(Box<dyn FnMut(Box<T>) + Send>)
A callback with only the boxed message as an argument.
BoxedWithMessageInfo(Box<dyn FnMut(Box<T>, MessageInfo) + Send>)
A callback with the boxed message and the message info as arguments.
Loaned(Box<dyn for<'a> FnMut(ReadOnlyLoanedMessage<'a, T>) + Send>)
A callback with only the loaned message as an argument.
LoanedWithMessageInfo(Box<dyn for<'a> FnMut(ReadOnlyLoanedMessage<'a, T>, MessageInfo) + Send>)
A callback with the loaned message and the message info as arguments.
Auto Trait Implementations§
impl<T> Freeze for AnySubscriptionCallback<T>
impl<T> !RefUnwindSafe for AnySubscriptionCallback<T>
impl<T> Send for AnySubscriptionCallback<T>
impl<T> !Sync for AnySubscriptionCallback<T>
impl<T> Unpin for AnySubscriptionCallback<T>
impl<T> !UnwindSafe for AnySubscriptionCallback<T>
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