Struct ServerBuilder

Source
pub struct ServerBuilder { /* private fields */ }

Implementations§

Source§

impl ServerBuilder

Source

pub fn new() -> ServerBuilder

Source

pub fn add_source(self, capabilities: Vec<PacRecord>) -> Self

Adds a source PAC characteristic to the builder. Each call adds a new characteristic. capabilities represents the records for a single PAC characteristic. If capabilities is empty, it will be ignored.

Source

pub fn set_source_locations(self, audio_locations: AudioLocations) -> Self

Sets the audio locations for the source. This corresponds to a single Source Audio Locations characteristic.

Source

pub fn add_sink(self, capabilities: Vec<PacRecord>) -> Self

Adds a sink PAC characteristic to the builder. Each call adds a new characteristic. capabilities represents the records for a single PAC characteristic. If capabilities is empty, it will be ignored.

Source

pub fn set_sink_locations(self, audio_locations: AudioLocations) -> Self

Sets the audio locations for the sink. This corresponds to a single Sink Audio Locations characteristic.

Source

pub fn build<T>( self, supported: AudioContexts, available: AudioContexts, ) -> Result<Server<T>, Error>
where T: ServerTypes,

Builds a server after verifying all the defined characteristics for this server (see PACS v1.0.1 section 3 for details).

Trait Implementations§

Source§

impl Default for ServerBuilder

Source§

fn default() -> ServerBuilder

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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.