pub struct PortDecl {
pub name: String,
pub media: PortMedia,
pub dir: PortDir,
pub channels: u16,
pub rate_contract: RateContract,
}Expand description
Declaration of one port on a processor: name, media, direction, channel count, and rate contract.
Fields§
§name: StringPort name, unique among a node’s ports of the same direction.
media: PortMediaMedia kind carried by the port.
dir: PortDirPort direction.
channels: u16Channel count.
rate_contract: RateContractRate contract the port advertises.
Implementations§
Source§impl PortDecl
impl PortDecl
Sourcepub fn new(
name: impl Into<String>,
media: PortMedia,
dir: PortDir,
channels: u16,
) -> Self
pub fn new( name: impl Into<String>, media: PortMedia, dir: PortDir, channels: u16, ) -> Self
Creates a port declaration with the media kind’s default rate contract.
Sourcepub fn with_rate_contract(self, rate_contract: RateContract) -> Self
pub fn with_rate_contract(self, rate_contract: RateContract) -> Self
Returns the declaration with its rate contract overridden.
Trait Implementations§
impl Eq for PortDecl
impl StructuralPartialEq for PortDecl
Auto Trait Implementations§
impl Freeze for PortDecl
impl RefUnwindSafe for PortDecl
impl Send for PortDecl
impl Sync for PortDecl
impl Unpin for PortDecl
impl UnsafeUnpin for PortDecl
impl UnwindSafe for PortDecl
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