Skip to main content

CuSimBridge

Struct CuSimBridge 

Source
pub struct CuSimBridge<Tx, Rx>
where Tx: BridgeChannelSet + 'static, Rx: BridgeChannelSet + 'static,
{ /* private fields */ }
Expand description

Placeholder bridge used in simulation when a bridge is configured with run_in_sim: false.

This bridge is parameterized directly by the Tx/Rx channel sets generated from configuration, so the original bridge type does not need to compile in simulation mode.

Trait Implementations§

Source§

impl<Tx, Rx> CuBridge for CuSimBridge<Tx, Rx>
where Tx: BridgeChannelSet + 'static, Rx: BridgeChannelSet + 'static,

Source§

type Tx = Tx

Outgoing channels (Copper -> external world).
Source§

type Rx = Rx

Incoming channels (external world -> Copper).
Source§

type Resources<'r> = ()

Resources required by the bridge.
Source§

fn new( _config: Option<&ComponentConfig>, _tx_channels: &[BridgeChannelConfig<<<CuSimBridge<Tx, Rx> as CuBridge>::Tx as BridgeChannelSet>::Id>], _rx_channels: &[BridgeChannelConfig<<<CuSimBridge<Tx, Rx> as CuBridge>::Rx as BridgeChannelSet>::Id>], _resources: <CuSimBridge<Tx, Rx> as CuBridge>::Resources<'_>, ) -> Result<CuSimBridge<Tx, Rx>, CuError>
where CuSimBridge<Tx, Rx>: Sized,

Constructs a new bridge. Read more
Source§

fn send<'a, Payload>( &mut self, _ctx: &CuContext, _channel: &'static BridgeChannel<<<CuSimBridge<Tx, Rx> as CuBridge>::Tx as BridgeChannelSet>::Id, Payload>, _msg: &CuStampedData<Payload, CuMsgMetadata>, ) -> Result<(), CuError>
where Payload: CuMsgPayload + 'a,

Sends a message on the selected outbound channel.
Source§

fn receive<'a, Payload>( &mut self, _ctx: &CuContext, _channel: &'static BridgeChannel<<<CuSimBridge<Tx, Rx> as CuBridge>::Rx as BridgeChannelSet>::Id, Payload>, _msg: &mut CuStampedData<Payload, CuMsgMetadata>, ) -> Result<(), CuError>
where Payload: CuMsgPayload + 'a,

Receives a message from the selected inbound channel. Read more
Source§

fn start(&mut self, _ctx: &CuContext) -> Result<(), CuError>

Called before the first send/receive cycle.
Source§

fn preprocess(&mut self, _ctx: &CuContext) -> Result<(), CuError>

Gives the bridge a chance to prepare buffers before I/O.
Source§

fn postprocess(&mut self, _ctx: &CuContext) -> Result<(), CuError>

Called once the send/receive pair completed.
Source§

fn stop(&mut self, _ctx: &CuContext) -> Result<(), CuError>

Notifies the bridge that no more I/O will happen until a subsequent [start].
Source§

impl<Tx, Rx> Freezable for CuSimBridge<Tx, Rx>
where Tx: BridgeChannelSet + 'static, Rx: BridgeChannelSet + 'static,

Source§

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,

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> GetTypeRegistration for CuSimBridge<Tx, Rx>
where Tx: BridgeChannelSet + 'static, Rx: BridgeChannelSet + 'static, CuSimBridge<Tx, Rx>: Any + Send + Sync,

Source§

fn get_type_registration() -> TypeRegistration

Returns the default TypeRegistration for this type.
Source§

fn register_type_dependencies(registry: &mut TypeRegistry)

Registers other types needed by this type. Read more
Source§

impl<Tx, Rx> PartialReflect for CuSimBridge<Tx, Rx>
where Tx: BridgeChannelSet + 'static, Rx: BridgeChannelSet + 'static, CuSimBridge<Tx, Rx>: Any + Send + Sync,

Source§

fn get_represented_type_info(&self) -> Option<&'static TypeInfo>

Returns the TypeInfo of the type represented by this value. Read more
Source§

fn try_apply( &mut self, value: &(dyn PartialReflect + 'static), ) -> Result<(), ApplyError>

Tries to apply a reflected value to this value. Read more
Source§

fn reflect_kind(&self) -> ReflectKind

Returns a zero-sized enumeration of “kinds” of type. Read more
Source§

fn reflect_ref(&self) -> ReflectRef<'_>

Returns an immutable enumeration of “kinds” of type. Read more
Source§

fn reflect_mut(&mut self) -> ReflectMut<'_>

Returns a mutable enumeration of “kinds” of type. Read more
Source§

fn reflect_owned(self: Box<CuSimBridge<Tx, Rx>>) -> ReflectOwned

Returns an owned enumeration of “kinds” of type. Read more
Source§

fn try_into_reflect( self: Box<CuSimBridge<Tx, Rx>>, ) -> Result<Box<dyn Reflect>, Box<dyn PartialReflect>>

Attempts to cast this type to a boxed, fully-reflected value.
Source§

fn try_as_reflect(&self) -> Option<&(dyn Reflect + 'static)>

Attempts to cast this type to a fully-reflected value.
Source§

fn try_as_reflect_mut(&mut self) -> Option<&mut (dyn Reflect + 'static)>

Attempts to cast this type to a mutable, fully-reflected value.
Source§

fn into_partial_reflect( self: Box<CuSimBridge<Tx, Rx>>, ) -> Box<dyn PartialReflect>

Casts this type to a boxed, reflected value. Read more
Source§

fn as_partial_reflect(&self) -> &(dyn PartialReflect + 'static)

Casts this type to a reflected value. Read more
Source§

fn as_partial_reflect_mut(&mut self) -> &mut (dyn PartialReflect + 'static)

Casts this type to a mutable, reflected value. Read more
Source§

fn reflect_partial_eq( &self, value: &(dyn PartialReflect + 'static), ) -> Option<bool>

Returns a “partial equality” comparison result. Read more
Source§

fn reflect_clone(&self) -> Result<Box<dyn Reflect>, ReflectCloneError>

Attempts to clone Self using reflection. Read more
§

fn apply(&mut self, value: &(dyn PartialReflect + 'static))

Applies a reflected value to this value. Read more
§

fn to_dynamic(&self) -> Box<dyn PartialReflect>

Converts this reflected value into its dynamic representation based on its kind. Read more
§

fn reflect_clone_and_take<T>(&self) -> Result<T, ReflectCloneError>
where T: 'static, Self: Sized + TypePath,

For a type implementing PartialReflect, combines reflect_clone and take in a useful fashion, automatically constructing an appropriate ReflectCloneError if the downcast fails. Read more
§

fn reflect_hash(&self) -> Option<u64>

Returns a hash of the value (which includes the type). Read more
§

fn debug(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Debug formatter for the value. Read more
§

fn is_dynamic(&self) -> bool

Indicates whether or not this type is a dynamic type. Read more
Source§

impl<Tx, Rx> Reflect for CuSimBridge<Tx, Rx>
where Tx: BridgeChannelSet + 'static, Rx: BridgeChannelSet + 'static, CuSimBridge<Tx, Rx>: Any + Send + Sync,

Source§

fn into_any(self: Box<CuSimBridge<Tx, Rx>>) -> Box<dyn Any>

Returns the value as a Box<dyn Any>. Read more
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Returns the value as a &dyn Any. Read more
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Returns the value as a &mut dyn Any. Read more
Source§

fn into_reflect(self: Box<CuSimBridge<Tx, Rx>>) -> Box<dyn Reflect>

Casts this type to a boxed, fully-reflected value.
Source§

fn as_reflect(&self) -> &(dyn Reflect + 'static)

Casts this type to a fully-reflected value.
Source§

fn as_reflect_mut(&mut self) -> &mut (dyn Reflect + 'static)

Casts this type to a mutable, fully-reflected value.
Source§

fn set(&mut self, value: Box<dyn Reflect>) -> Result<(), Box<dyn Reflect>>

Performs a type-checked assignment of a reflected value to this value. Read more
Source§

impl<Tx, Rx> Struct for CuSimBridge<Tx, Rx>
where Tx: BridgeChannelSet + 'static, Rx: BridgeChannelSet + 'static, CuSimBridge<Tx, Rx>: Any + Send + Sync,

Source§

fn field(&self, name: &str) -> Option<&(dyn PartialReflect + 'static)>

Returns a reference to the value of the field named name as a &dyn PartialReflect.
Source§

fn field_mut( &mut self, name: &str, ) -> Option<&mut (dyn PartialReflect + 'static)>

Returns a mutable reference to the value of the field named name as a &mut dyn PartialReflect.
Source§

fn field_at(&self, index: usize) -> Option<&(dyn PartialReflect + 'static)>

Returns a reference to the value of the field with index index as a &dyn PartialReflect.
Source§

fn field_at_mut( &mut self, index: usize, ) -> Option<&mut (dyn PartialReflect + 'static)>

Returns a mutable reference to the value of the field with index index as a &mut dyn PartialReflect.
Source§

fn name_at(&self, index: usize) -> Option<&str>

Returns the name of the field with index index.
Source§

fn field_len(&self) -> usize

Returns the number of fields in the struct.
Source§

fn iter_fields(&self) -> FieldIter<'_>

Returns an iterator over the values of the reflectable fields for this struct.
Source§

fn to_dynamic_struct(&self) -> DynamicStruct

Creates a new DynamicStruct from this struct.
§

fn get_represented_struct_info(&self) -> Option<&'static StructInfo>

Will return None if TypeInfo is not available.
Source§

impl<Tx, Rx> TypePath for CuSimBridge<Tx, Rx>
where Tx: BridgeChannelSet + 'static, Rx: BridgeChannelSet + 'static,

Source§

fn type_path() -> &'static str

Returns the fully qualified path of the underlying type. Read more
Source§

fn short_type_path() -> &'static str

Returns a short, pretty-print enabled path to the type. Read more
Source§

fn type_ident() -> Option<&'static str>

Returns the name of the type, or None if it is anonymous. Read more
Source§

fn crate_name() -> Option<&'static str>

Returns the name of the crate the type is in, or None if it is anonymous. Read more
Source§

fn module_path() -> Option<&'static str>

Returns the path to the module the type is in, or None if it is anonymous. Read more
Source§

impl<Tx, Rx> Typed for CuSimBridge<Tx, Rx>
where Tx: BridgeChannelSet + 'static, Rx: BridgeChannelSet + 'static, CuSimBridge<Tx, Rx>: Any + Send + Sync,

Source§

fn type_info() -> &'static TypeInfo

Returns the compile-time info for the underlying type.

Auto Trait Implementations§

§

impl<Tx, Rx> Freeze for CuSimBridge<Tx, Rx>

§

impl<Tx, Rx> RefUnwindSafe for CuSimBridge<Tx, Rx>

§

impl<Tx, Rx> Send for CuSimBridge<Tx, Rx>

§

impl<Tx, Rx> Sync for CuSimBridge<Tx, Rx>

§

impl<Tx, Rx> Unpin for CuSimBridge<Tx, Rx>

§

impl<Tx, Rx> UnsafeUnpin for CuSimBridge<Tx, Rx>

§

impl<Tx, Rx> UnwindSafe for CuSimBridge<Tx, Rx>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Converts Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Converts &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Converts &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSend for T
where T: Any + Send,

§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

impl<T> DynamicTypePath for T
where T: TypePath,

§

impl<T> DynamicTyped for T
where T: Typed,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<S> GetField for S
where S: Struct,

§

fn get_field<T>(&self, name: &str) -> Option<&T>
where T: Reflect,

Returns a reference to the value of the field named name, downcast to T.
§

fn get_field_mut<T>(&mut self, name: &str) -> Option<&mut T>
where T: Reflect,

Returns a mutable reference to the value of the field named name, downcast to T.
§

impl<T> GetPath for T
where T: Reflect + ?Sized,

§

fn reflect_path<'p>( &self, path: impl ReflectPath<'p>, ) -> Result<&(dyn PartialReflect + 'static), ReflectPathError<'p>>

Returns a reference to the value specified by path. Read more
§

fn reflect_path_mut<'p>( &mut self, path: impl ReflectPath<'p>, ) -> Result<&mut (dyn PartialReflect + 'static), ReflectPathError<'p>>

Returns a mutable reference to the value specified by path. Read more
§

fn path<'p, T>( &self, path: impl ReflectPath<'p>, ) -> Result<&T, ReflectPathError<'p>>
where T: Reflect,

Returns a statically typed reference to the value specified by path. Read more
§

fn path_mut<'p, T>( &mut self, path: impl ReflectPath<'p>, ) -> Result<&mut T, ReflectPathError<'p>>
where T: Reflect,

Returns a statically typed mutable reference to the value specified by path. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
§

impl<A> Is for A
where A: Any,

§

fn is<T>() -> bool
where T: Any,

Checks if the current type “is” another type, using a TypeId equality comparison. This is most useful in the context of generic logic. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> ReflectTypePath for T
where T: TypePath,

§

impl<T> Reflectable for T