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
impl StreamInfo
pub fn new( name: &str, type_: &str, channel_count: u32, nominal_srate: f64, channel_format: ChannelFormat, source_id: &str, ) -> Self
pub fn name(&self) -> String
pub fn type_(&self) -> String
pub fn channel_count(&self) -> u32
pub fn nominal_srate(&self) -> f64
pub fn channel_format(&self) -> ChannelFormat
pub fn source_id(&self) -> String
pub fn version(&self) -> i32
pub fn uid(&self) -> String
pub fn created_at(&self) -> f64
pub fn session_id(&self) -> String
pub fn hostname(&self) -> String
pub fn v4address(&self) -> String
pub fn v4data_port(&self) -> u16
pub fn v4service_port(&self) -> u16
pub fn v6address(&self) -> String
pub fn v6data_port(&self) -> u16
pub fn v6service_port(&self) -> u16
pub fn channel_bytes(&self) -> usize
pub fn sample_bytes(&self) -> usize
pub fn set_uid(&self, uid: &str)
pub fn set_created_at(&self, t: f64)
pub fn set_session_id(&self, s: &str)
pub fn set_hostname(&self, s: &str)
pub fn set_v4address(&self, s: &str)
pub fn set_v4data_port(&self, p: u16)
pub fn set_v4service_port(&self, p: u16)
pub fn set_v6address(&self, s: &str)
pub fn set_v6data_port(&self, p: u16)
pub fn set_v6service_port(&self, p: u16)
pub fn set_channel_format(&self, fmt: ChannelFormat)
pub fn set_source_id(&self, s: &str)
pub fn set_version(&self, v: i32)
pub fn set_name(&self, s: &str)
Sourcepub fn to_shortinfo_message(&self) -> String
pub fn to_shortinfo_message(&self) -> String
Generate the shortinfo XML (without desc contents)
Sourcepub fn to_fullinfo_message(&self) -> String
pub fn to_fullinfo_message(&self) -> String
Generate the full info XML (with desc contents)
Sourcepub fn from_shortinfo_message(xml: &str) -> Option<StreamInfo>
pub fn from_shortinfo_message(xml: &str) -> Option<StreamInfo>
Parse from a shortinfo XML message
Sourcepub fn matches_query(&self, query: &str) -> bool
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.
Sourcepub fn with_data<R>(&self, f: impl FnOnce(&StreamInfoData) -> R) -> R
pub fn with_data<R>(&self, f: impl FnOnce(&StreamInfoData) -> R) -> R
Lock and provide read-only access to inner data
Sourcepub fn with_data_mut<R>(&self, f: impl FnOnce(&mut StreamInfoData) -> R) -> R
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
impl Clone for StreamInfo
Source§fn clone(&self) -> StreamInfo
fn clone(&self) -> StreamInfo
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for StreamInfo
impl !RefUnwindSafe for StreamInfo
impl Send for StreamInfo
impl Sync for StreamInfo
impl Unpin for StreamInfo
impl UnsafeUnpin for StreamInfo
impl !UnwindSafe for StreamInfo
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