Skip to main content

StreamInfo

Struct StreamInfo 

Source
pub struct StreamInfo { /* private fields */ }
Expand description

Stream information. Describes the properties of a data stream. Shared via Arc so it can be safely passed between outlet/inlet/server components.

Implementations§

Source§

impl StreamInfo

Source

pub fn new( name: &str, type_: &str, channel_count: u32, nominal_srate: f64, channel_format: ChannelFormat, source_id: &str, ) -> Self

Source

pub fn name(&self) -> String

Source

pub fn type_(&self) -> String

Source

pub fn channel_count(&self) -> u32

Source

pub fn nominal_srate(&self) -> f64

Source

pub fn channel_format(&self) -> ChannelFormat

Source

pub fn source_id(&self) -> String

Source

pub fn version(&self) -> i32

Source

pub fn uid(&self) -> String

Source

pub fn created_at(&self) -> f64

Source

pub fn session_id(&self) -> String

Source

pub fn hostname(&self) -> String

Source

pub fn v4address(&self) -> String

Source

pub fn v4data_port(&self) -> u16

Source

pub fn v4service_port(&self) -> u16

Source

pub fn v6address(&self) -> String

Source

pub fn v6data_port(&self) -> u16

Source

pub fn v6service_port(&self) -> u16

Source

pub fn channel_bytes(&self) -> usize

Source

pub fn sample_bytes(&self) -> usize

Source

pub fn desc(&self) -> XmlNode

Get a clone of the desc node

Source

pub fn set_uid(&self, uid: &str)

Source

pub fn set_created_at(&self, t: f64)

Source

pub fn set_session_id(&self, s: &str)

Source

pub fn set_hostname(&self, s: &str)

Source

pub fn set_v4address(&self, s: &str)

Source

pub fn set_v4data_port(&self, p: u16)

Source

pub fn set_v4service_port(&self, p: u16)

Source

pub fn set_v6address(&self, s: &str)

Source

pub fn set_v6data_port(&self, p: u16)

Source

pub fn set_v6service_port(&self, p: u16)

Source

pub fn set_channel_format(&self, fmt: ChannelFormat)

Source

pub fn set_source_id(&self, s: &str)

Source

pub fn set_version(&self, v: i32)

Source

pub fn set_name(&self, s: &str)

Source

pub fn reset_uid(&self) -> String

Reset the UID to a new random value

Source

pub fn to_shortinfo_message(&self) -> String

Generate the shortinfo XML (without desc contents)

Source

pub fn to_fullinfo_message(&self) -> String

Generate the full info XML (with desc contents)

Source

pub fn from_shortinfo_message(xml: &str) -> Option<StreamInfo>

Parse from a shortinfo XML message

Source

pub fn matches_query(&self, query: &str) -> bool

Check if a query string matches this stream info. Supports simple XPath-like queries: empty always matches, name=‘X’ / type=‘X’ / source_id=‘X’ etc.

Source

pub fn with_data<R>(&self, f: impl FnOnce(&StreamInfoData) -> R) -> R

Lock and provide read-only access to inner data

Source

pub fn with_data_mut<R>(&self, f: impl FnOnce(&mut StreamInfoData) -> R) -> R

Lock and provide mutable access to inner data

Trait Implementations§

Source§

impl Clone for StreamInfo

Source§

fn clone(&self) -> StreamInfo

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.