pub trait PortCollectionAccessorsCommon {
// Required methods
fn contains_name(&self, name: &str) -> bool;
fn give_to_bound(
&self,
name: &str,
bound: &mut dyn BindCommons,
) -> Result<(), Error>;
fn give_to_collection(
&self,
name: &str,
other_collection: &mut dyn PortCollection,
other_name: &str,
) -> Result<(), Error>;
fn give_to_variant(
&self,
name: &str,
variant: &mut PortVariant,
) -> Result<(), Error>;
fn sequence_number(&self, name: &str) -> Result<u32, Error>;
fn use_from_bound(
&mut self,
name: &str,
bound: &dyn BindCommons,
) -> Result<(), Error>;
fn use_from_collection(
&mut self,
name: &str,
other_collection: &dyn PortCollection,
other_name: &str,
) -> Result<(), Error>;
fn use_from_variant(
&mut self,
name: &str,
variant: &PortVariant,
) -> Result<(), Error>;
}Expand description
Common access methods for port collections. Each port is identified by its name, so the name has to be unique within a certain port collection.
Required Methods§
Sourcefn contains_name(&self, name: &str) -> bool
fn contains_name(&self, name: &str) -> bool
Returns true if ‘name’ is in the port collection, otherwise false.
Sourcefn give_to_bound(
&self,
name: &str,
bound: &mut dyn BindCommons,
) -> Result<(), Error>
fn give_to_bound( &self, name: &str, bound: &mut dyn BindCommons, ) -> Result<(), Error>
Connects a port from this collection to the value of another port variant. Type of connection depends on types of both ports.
§Errors
Error::NotFound, if ‘name’ is not in collection.Error::DataType, if ‘name’ has not the same type of T as ‘bound’.Error::PortType, if ‘name’ and ‘bound’ have incompatible port types.
Sourcefn give_to_collection(
&self,
name: &str,
other_collection: &mut dyn PortCollection,
other_name: &str,
) -> Result<(), Error>
fn give_to_collection( &self, name: &str, other_collection: &mut dyn PortCollection, other_name: &str, ) -> Result<(), Error>
Connects a port from this collection to a port from another collection. Type of connection depends on types of both ports.
§Errors
Error::NotFound, if ‘name’ is not in ‘self’ collection.Error::OtherNotFound, if ‘name’ is not in ‘other’ collection.Error::DataType, if ‘name’ has not the same type of T as ‘other_name’.Error::PortType, if ‘name’ and ‘other_name’ have incompatible port types.
Sourcefn give_to_variant(
&self,
name: &str,
variant: &mut PortVariant,
) -> Result<(), Error>
fn give_to_variant( &self, name: &str, variant: &mut PortVariant, ) -> Result<(), Error>
Connects a port from this collection to the value of another port variant. Type of connection depends on types of both ports.
§Errors
Error::NotFound, if ‘name’ is not in collection.Error::DataType, if ‘name’ has not the same type of T as ‘variant’.Error::PortType, if ‘name’ and ‘variant’ have incompatible port types.
Sourcefn sequence_number(&self, name: &str) -> Result<u32, Error>
fn sequence_number(&self, name: &str) -> Result<u32, Error>
Returns the change sequence number, a number which
- starts at
0, - can only be incremeted by 1 and
- wraps around to
1when exceeding its limits.
§Errors
Error::NotFound, if ‘name’ is not in port collection.
Sourcefn use_from_bound(
&mut self,
name: &str,
bound: &dyn BindCommons,
) -> Result<(), Error>
fn use_from_bound( &mut self, name: &str, bound: &dyn BindCommons, ) -> Result<(), Error>
Connects a port from this collection to the value of another port variant. Type of connection depends on types of both ports.
§Errors
Error::NotFound, if ‘name’ is not in collection.Error::DataType, if ‘name’ has not the same type of T as ‘bound’.Error::PortType, if ‘name’ and ‘bound’ have incompatible port types.
Sourcefn use_from_collection(
&mut self,
name: &str,
other_collection: &dyn PortCollection,
other_name: &str,
) -> Result<(), Error>
fn use_from_collection( &mut self, name: &str, other_collection: &dyn PortCollection, other_name: &str, ) -> Result<(), Error>
Connects a port from this collection to a port from another collection. Type of connection depends on types of both ports.
§Errors
Error::NotFound, if ‘name’ is not in ‘self’ collection.Error::OtherNotFound, if ‘name’ is not in ‘other’ collection.Error::DataType, if ‘name’ has not the same type of T as ‘other_name’.Error::PortType, if ‘name’ and ‘other_name’ have incompatible port types.
Sourcefn use_from_variant(
&mut self,
name: &str,
variant: &PortVariant,
) -> Result<(), Error>
fn use_from_variant( &mut self, name: &str, variant: &PortVariant, ) -> Result<(), Error>
Connects a port from this collection to the value of another port variant. Type of connection depends on types of both ports.
§Errors
Error::NotFound, if ‘name’ is not in collection.Error::DataType, if ‘name’ has not the same type of T as ‘variant’.Error::PortType, if ‘name’ and ‘variant’ have incompatible port types.