pub struct CuBdshotBridge<P: BdshotBoardProvider> { /* private fields */ }Trait Implementations§
Source§impl<P: BdshotBoardProvider> CuBridge for CuBdshotBridge<P>
impl<P: BdshotBoardProvider> CuBridge for CuBdshotBridge<P>
Source§type Tx = TxChannels
type Tx = TxChannels
Outgoing channels (Copper -> external world).
Source§type Rx = RxChannels
type Rx = RxChannels
Incoming channels (external world -> Copper).
Source§fn new(
_config: Option<&ComponentConfig>,
tx: &[BridgeChannelConfig<TxId>],
_rx: &[BridgeChannelConfig<RxId>],
) -> CuResult<Self>where
Self: Sized,
fn new(
_config: Option<&ComponentConfig>,
tx: &[BridgeChannelConfig<TxId>],
_rx: &[BridgeChannelConfig<RxId>],
) -> 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 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<P: BdshotBoardProvider> Freezable for CuBdshotBridge<P>
impl<P: BdshotBoardProvider> Freezable for CuBdshotBridge<P>
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)
Auto Trait Implementations§
impl<P> Freeze for CuBdshotBridge<P>
impl<P> RefUnwindSafe for CuBdshotBridge<P>
impl<P> Send for CuBdshotBridge<P>
impl<P> Sync for CuBdshotBridge<P>
impl<P> Unpin for CuBdshotBridge<P>
impl<P> UnwindSafe for CuBdshotBridge<P>
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<Choices> CoproductSubsetter<CNil, HNil> for Choices
impl<Choices> CoproductSubsetter<CNil, HNil> for Choices
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