Struct CardPortInfo

Source
pub struct CardPortInfo<'a> {
    pub name: Option<Cow<'a, str>>,
    pub description: Option<Cow<'a, str>>,
    pub priority: u32,
    pub available: PortAvailable,
    pub direction: FlagSet,
    pub proplist: Proplist,
    pub latency_offset: i64,
    pub profiles: Vec<CardProfileInfo<'a>>,
    pub availability_group: Option<Cow<'a, str>>,
    pub type: DevicePortType,
}
Expand description

Stores information about a specific port of a card.

Please note that this structure can be extended as part of evolutionary API updates at any time in any new release.

Fields§

§name: Option<Cow<'a, str>>

Name of this port.

§description: Option<Cow<'a, str>>

Description of this port.

§priority: u32

The higher this value is, the more useful this port is as a default.

§available: PortAvailable

Availability status of this port.

§direction: FlagSet

The direction of this port.

§proplist: Proplist

Property list.

§latency_offset: i64

Latency offset of the port that gets added to the sink/source latency when the port is active.

§profiles: Vec<CardProfileInfo<'a>>

Set of available profiles.

§availability_group: Option<Cow<'a, str>>
Available on crate feature pa_v14 only.

An indentifier for the group of ports that share their availability status with each other.

This is meant especially for handling cases where one 3.5 mm connector is used for headphones, headsets and microphones, and the hardware can only tell that something was plugged in but not what exactly. In this situation the ports for all those devices share their availability status, and PulseAudio can’t tell which one is actually plugged in, and some application may ask the user what was plugged in. Such applications should get a list of all card ports and compare their availability_group fields. Ports that have the same group are those that need input from the user to determine which device was plugged in. The application should then activate the user-chosen port.

May be None, in which case the port is not part of any availability group (which is the same as having a group with only one member).

The group identifier must be treated as an opaque identifier. The string may look like an ALSA control name, but applications must not assume any such relationship. The group naming scheme can change without a warning.

§type: DevicePortType
Available on crate feature pa_v14 only.

Port device type.

Implementations§

Source§

impl CardPortInfo<'_>

Source

pub fn to_owned(&self) -> CardPortInfo<'static>

Creates a copy with owned data.

Trait Implementations§

Source§

impl<'a> Debug for CardPortInfo<'a>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for CardPortInfo<'a>

§

impl<'a> RefUnwindSafe for CardPortInfo<'a>

§

impl<'a> Send for CardPortInfo<'a>

§

impl<'a> Sync for CardPortInfo<'a>

§

impl<'a> Unpin for CardPortInfo<'a>

§

impl<'a> UnwindSafe for CardPortInfo<'a>

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

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, 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.