Struct canadensis::anonymous::AnonymousPublisher
source · [−]pub struct AnonymousPublisher<C: Clock, M, T: Transmitter<C::Instant>> { /* private fields */ }
Expand description
A transmitter that sends anonymous messages and does not require a node ID
Anonymous nodes have some limitations:
- They can only send messages, not service requests or responses
- They cannot send multi-frame messages
Implementations
sourceimpl<C, M, T> AnonymousPublisher<C, M, T> where
C: Clock,
M: Message + Serialize,
T: Transmitter<C::Instant>,
impl<C, M, T> AnonymousPublisher<C, M, T> where
C: Clock,
M: Message + Serialize,
T: Transmitter<C::Instant>,
sourcepub fn new(
subject: SubjectId,
priority: <T::Transport as Transport>::Priority,
timeout: <C::Instant as Instant>::Duration
) -> Self
pub fn new(
subject: SubjectId,
priority: <T::Transport as Transport>::Priority,
timeout: <C::Instant as Instant>::Duration
) -> Self
Creates an anonymous message publisher
sourcepub fn send(
&mut self,
payload: &M,
clock: &mut C,
transmitter: &mut T,
driver: &mut T::Driver
) -> Result<(), AnonymousPublishError<T::Error>>
pub fn send(
&mut self,
payload: &M,
clock: &mut C,
transmitter: &mut T,
driver: &mut T::Driver
) -> Result<(), AnonymousPublishError<T::Error>>
Prepares an anonymous message for sending and pushes it into the provided transmitter
This function returns an error if the message is too long to fit into one frame, or if memory allocation fails.
Auto Trait Implementations
impl<C, M, T> RefUnwindSafe for AnonymousPublisher<C, M, T> where
M: RefUnwindSafe,
<<C as Clock>::Instant as Instant>::Duration: RefUnwindSafe,
<<T as Transmitter<<C as Clock>::Instant>>::Transport as Transport>::Priority: RefUnwindSafe,
<<T as Transmitter<<C as Clock>::Instant>>::Transport as Transport>::TransferId: RefUnwindSafe,
impl<C, M, T> Send for AnonymousPublisher<C, M, T> where
M: Send,
<<C as Clock>::Instant as Instant>::Duration: Send,
<<T as Transmitter<<C as Clock>::Instant>>::Transport as Transport>::Priority: Send,
<<T as Transmitter<<C as Clock>::Instant>>::Transport as Transport>::TransferId: Send,
impl<C, M, T> Sync for AnonymousPublisher<C, M, T> where
M: Sync,
<<C as Clock>::Instant as Instant>::Duration: Sync,
<<T as Transmitter<<C as Clock>::Instant>>::Transport as Transport>::Priority: Sync,
<<T as Transmitter<<C as Clock>::Instant>>::Transport as Transport>::TransferId: Sync,
impl<C, M, T> Unpin for AnonymousPublisher<C, M, T> where
M: Unpin,
<<C as Clock>::Instant as Instant>::Duration: Unpin,
<<T as Transmitter<<C as Clock>::Instant>>::Transport as Transport>::Priority: Unpin,
<<T as Transmitter<<C as Clock>::Instant>>::Transport as Transport>::TransferId: Unpin,
impl<C, M, T> UnwindSafe for AnonymousPublisher<C, M, T> where
M: UnwindSafe,
<<C as Clock>::Instant as Instant>::Duration: UnwindSafe,
<<T as Transmitter<<C as Clock>::Instant>>::Transport as Transport>::Priority: UnwindSafe,
<<T as Transmitter<<C as Clock>::Instant>>::Transport as Transport>::TransferId: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more