pub struct ZenohBridge<Tx, Rx>where
Tx: BridgeChannelSet + 'static,
Rx: BridgeChannelSet + 'static,
Tx::Id: Send + Sync + 'static,
Rx::Id: Send + Sync + 'static,{ /* private fields */ }Trait Implementations§
Source§impl<Tx, Rx> CuBridge for ZenohBridge<Tx, Rx>where
Tx: BridgeChannelSet + 'static,
Rx: BridgeChannelSet + 'static,
Tx::Id: Debug + Send + Sync + 'static,
Rx::Id: Debug + Send + Sync + 'static,
impl<Tx, Rx> CuBridge for ZenohBridge<Tx, Rx>where
Tx: BridgeChannelSet + 'static,
Rx: BridgeChannelSet + 'static,
Tx::Id: Debug + Send + Sync + 'static,
Rx::Id: Debug + Send + Sync + 'static,
Source§fn new(
config: Option<&ComponentConfig>,
tx_channels: &[BridgeChannelConfig<<Self::Tx as BridgeChannelSet>::Id>],
rx_channels: &[BridgeChannelConfig<<Self::Rx as BridgeChannelSet>::Id>],
_resources: Self::Resources<'_>,
) -> CuResult<Self>where
Self: Sized,
fn new(
config: Option<&ComponentConfig>,
tx_channels: &[BridgeChannelConfig<<Self::Tx as BridgeChannelSet>::Id>],
rx_channels: &[BridgeChannelConfig<<Self::Rx as BridgeChannelSet>::Id>],
_resources: Self::Resources<'_>,
) -> CuResult<Self>where
Self: Sized,
Constructs a new bridge. Read more
Source§fn start(&mut self, _clock: &RobotClock) -> CuResult<()>
fn start(&mut self, _clock: &RobotClock) -> CuResult<()>
Called before the first send/receive cycle.
Source§fn send<'a, Payload>(
&mut self,
_clock: &RobotClock,
channel: &'static BridgeChannel<<Self::Tx as BridgeChannelSet>::Id, Payload>,
msg: &CuMsg<Payload>,
) -> CuResult<()>where
Payload: CuMsgPayload + 'a,
fn send<'a, Payload>(
&mut self,
_clock: &RobotClock,
channel: &'static BridgeChannel<<Self::Tx as BridgeChannelSet>::Id, Payload>,
msg: &CuMsg<Payload>,
) -> CuResult<()>where
Payload: CuMsgPayload + 'a,
Sends a message on the selected outbound channel.
Source§fn receive<'a, Payload>(
&mut self,
clock: &RobotClock,
channel: &'static BridgeChannel<<Self::Rx as BridgeChannelSet>::Id, Payload>,
msg: &mut CuMsg<Payload>,
) -> CuResult<()>where
Payload: CuMsgPayload + 'a,
fn receive<'a, Payload>(
&mut self,
clock: &RobotClock,
channel: &'static BridgeChannel<<Self::Rx as BridgeChannelSet>::Id, Payload>,
msg: &mut CuMsg<Payload>,
) -> CuResult<()>where
Payload: CuMsgPayload + 'a,
Receives a message from the selected inbound channel. Read more
Source§fn stop(&mut self, _clock: &RobotClock) -> CuResult<()>
fn stop(&mut self, _clock: &RobotClock) -> CuResult<()>
Notifies the bridge that no more I/O will happen until a subsequent [
start].Source§fn preprocess(&mut self, _clock: &RobotClock) -> Result<(), CuError>
fn preprocess(&mut self, _clock: &RobotClock) -> Result<(), CuError>
Gives the bridge a chance to prepare buffers before I/O.
Source§fn postprocess(&mut self, _clock: &RobotClock) -> Result<(), CuError>
fn postprocess(&mut self, _clock: &RobotClock) -> Result<(), CuError>
Called once the send/receive pair completed.
Source§impl<Tx, Rx> Freezable for ZenohBridge<Tx, Rx>where
Tx: BridgeChannelSet + 'static,
Rx: BridgeChannelSet + 'static,
Tx::Id: Send + Sync + 'static,
Rx::Id: Send + Sync + 'static,
impl<Tx, Rx> Freezable for ZenohBridge<Tx, Rx>where
Tx: BridgeChannelSet + 'static,
Rx: BridgeChannelSet + 'static,
Tx::Id: Send + Sync + 'static,
Rx::Id: Send + Sync + 'static,
Source§fn freeze<E>(&self, encoder: &mut E) -> Result<(), EncodeError>where
E: Encoder,
fn freeze<E>(&self, encoder: &mut E) -> Result<(), EncodeError>where
E: Encoder,
This method is called by the framework when it wants to save the task state.
The default implementation is to encode nothing (stateless).
If you have a state, you need to implement this method.
Source§fn thaw<D>(&mut self, _decoder: &mut D) -> Result<(), DecodeError>where
D: Decoder,
fn thaw<D>(&mut self, _decoder: &mut D) -> Result<(), DecodeError>where
D: Decoder,
This method is called by the framework when it wants to restore the task to a specific state.
Here it is similar to Decode but the framework will give you a new instance of the task (the new method will be called)
Source§impl<Tx, Rx> TypePath for ZenohBridge<Tx, Rx>where
Tx: BridgeChannelSet + 'static,
Rx: BridgeChannelSet + 'static,
Tx::Id: Send + Sync + 'static,
Rx::Id: Send + Sync + 'static,
impl<Tx, Rx> TypePath for ZenohBridge<Tx, Rx>where
Tx: BridgeChannelSet + 'static,
Rx: BridgeChannelSet + 'static,
Tx::Id: Send + Sync + 'static,
Rx::Id: Send + Sync + 'static,
Auto Trait Implementations§
impl<Tx, Rx> Freeze for ZenohBridge<Tx, Rx>
impl<Tx, Rx> !RefUnwindSafe for ZenohBridge<Tx, Rx>
impl<Tx, Rx> Send for ZenohBridge<Tx, Rx>
impl<Tx, Rx> Sync for ZenohBridge<Tx, Rx>
impl<Tx, Rx> Unpin for ZenohBridge<Tx, Rx>
impl<Tx, Rx> UnsafeUnpin for ZenohBridge<Tx, Rx>
impl<Tx, Rx> !UnwindSafe for ZenohBridge<Tx, Rx>
Blanket Implementations§
Source§impl<Source> AccessAs for Source
impl<Source> AccessAs for Source
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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