pub struct Routes { /* private fields */ }Expand description
Two disjoint base topics and the local allowlist of subsequent devices.
Implementations§
Source§impl Routes
impl Routes
Sourcepub fn new(
to_device: impl Into<String>,
from_device: impl Into<String>,
) -> Result<Self, RouteError>
pub fn new( to_device: impl Into<String>, from_device: impl Into<String>, ) -> Result<Self, RouteError>
Provision the incoming and outgoing base topics as seen by the local device.
Sourcepub fn with_ship(self, id: impl Into<String>) -> Result<Self, RouteError>
pub fn with_ship(self, id: impl Into<String>) -> Result<Self, RouteError>
Authorize the exact, unescaped SHIP ID.
Sourcepub fn topic(&self, sender: Role, target: &Target) -> Result<String, RouteError>
pub fn topic(&self, sender: Role, target: &Target) -> Result<String, RouteError>
Return the MQTT publish topic for this sender and target.
Sourcepub fn receive(
&self,
receiver: Role,
topic: &str,
retain: bool,
) -> Result<Target, RouteError>
pub fn receive( &self, receiver: Role, topic: &str, retain: bool, ) -> Result<Target, RouteError>
Resolve a publication observed at the receiving end. SR-002.
Sourcepub fn check_kind(
sender: Role,
target: &Target,
kind: Kind,
) -> Result<(), RouteError>
pub fn check_kind( sender: Role, target: &Target, kind: Kind, ) -> Result<(), RouteError>
Enforce message direction after route and retain admission.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Routes
impl RefUnwindSafe for Routes
impl Send for Routes
impl Sync for Routes
impl Unpin for Routes
impl UnsafeUnpin for Routes
impl UnwindSafe for Routes
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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