pub struct PortMeta {
pub direction: PortDir,
pub channels: u16,
pub sample_format: SampleFmt,
}Available on crate feature
topology only.Expand description
Serializable mirror of audio_core_bsd::PortDescriptor.
Stores the three fields needed to describe a port’s contract: its
direction, channel count, and sample format. Convert to/from a
PortDescriptor with PortMeta::from_descriptor /
PortMeta::to_descriptor.
Fields§
§direction: PortDirWhether this port is an input or output.
channels: u16Number of channels carried by the port.
sample_format: SampleFmtNumeric format of each sample.
Implementations§
Source§impl PortMeta
impl PortMeta
Sourcepub fn from_descriptor(d: PortDescriptor) -> Self
pub fn from_descriptor(d: PortDescriptor) -> Self
Constructs a PortMeta from an audio-core-bsd
PortDescriptor.
This is a lossless field-by-field mapping; the reverse conversion is
PortMeta::to_descriptor.
Sourcepub fn to_descriptor(self) -> PortDescriptor
pub fn to_descriptor(self) -> PortDescriptor
Converts this PortMeta back into an audio-core-bsd
PortDescriptor.
Trait Implementations§
impl Copy for PortMeta
Source§impl<'de> Deserialize<'de> for PortMeta
impl<'de> Deserialize<'de> for PortMeta
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for PortMeta
impl StructuralPartialEq for PortMeta
Auto Trait Implementations§
impl Freeze for PortMeta
impl RefUnwindSafe for PortMeta
impl Send for PortMeta
impl Sync for PortMeta
impl Unpin for PortMeta
impl UnsafeUnpin for PortMeta
impl UnwindSafe for PortMeta
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