pub struct Stream { /* private fields */ }Expand description
An ICE Stream
Implementations§
Source§impl Stream
impl Stream
Sourcepub fn add_component(&self) -> Component
pub fn add_component(&self) -> Component
Add a Component to this stream.
Sourcepub fn component(&self, id: usize) -> Option<Component>
pub fn component(&self, id: usize) -> Option<Component>
Retrieve a Component from this stream. If the index doesn’t exist or a component is not
available at that index, None is returned
Sourcepub fn local_credentials(&self) -> Option<Credentials>
pub fn local_credentials(&self) -> Option<Credentials>
Retreive the previouly set local ICE credentials for this Stream.
Sourcepub fn remote_credentials(&self) -> Option<Credentials>
pub fn remote_credentials(&self) -> Option<Credentials>
Retreive the previouly set remote ICE credentials for this Stream.
Sourcepub fn set_local_credentials(&self, credentials: &Credentials)
pub fn set_local_credentials(&self, credentials: &Credentials)
Set local ICE credentials for this Stream.
§Examples
let mut agent = Agent::default();
let stream = agent.add_stream();
let credentials = Credentials::new("user", "pass");
stream.set_local_credentials(&credentials);
assert_eq!(stream.local_credentials(), Some(credentials));Sourcepub fn set_remote_credentials(&self, credentials: &Credentials)
pub fn set_remote_credentials(&self, credentials: &Credentials)
Set remote ICE credentials for this Stream.
§Examples
let agent = Agent::default();
let stream = agent.add_stream();
let credentials = Credentials::new("user", "pass");
stream.set_remote_credentials(&credentials);
assert_eq!(stream.remote_credentials(), Some(credentials));Sourcepub fn end_of_local_candidates(&self)
pub fn end_of_local_candidates(&self)
Signal the end of local candidates. Calling this function may allow ICE processing to complete.
Sourcepub fn add_remote_candidate(&self, cand: &Candidate)
pub fn add_remote_candidate(&self, cand: &Candidate)
Add a remote candidate for connection checks for use with this stream
Sourcepub fn end_of_remote_candidates(&self)
pub fn end_of_remote_candidates(&self)
Indicate that no more candidates are expected from the peer. This may allow the ICE process to complete.
Sourcepub fn add_local_gathered_candidate(&self, gathered: GatheredCandidate) -> bool
pub fn add_local_gathered_candidate(&self, gathered: GatheredCandidate) -> bool
Add a local candidate for this stream.
Returns whether the candidate was added internally.
Sourcepub fn allocated_socket(
&self,
component_id: usize,
transport: TransportType,
from: &Address,
to: &Address,
socket_addr: Option<Address>,
)
pub fn allocated_socket( &self, component_id: usize, transport: TransportType, from: &Address, to: &Address, socket_addr: Option<Address>, )
Provide a reply to the
AgentPoll::AllocateSocket request. The
component_id, transport, from, and to values must match exactly with the request.
Sourcepub fn component_ids(&self) -> Vec<usize>
pub fn component_ids(&self) -> Vec<usize>
The list of component ids available in this stream
Sourcepub fn handle_incoming_data<'a>(
&self,
component_id: usize,
transport: TransportType,
from: Address,
to: Address,
data: &'a [u8],
now: Instant,
) -> StreamIncomingDataReply<'a>
pub fn handle_incoming_data<'a>( &self, component_id: usize, transport: TransportType, from: Address, to: Address, data: &'a [u8], now: Instant, ) -> StreamIncomingDataReply<'a>
Provide the stream with data that has been received on an external socket. The returned value indicates what has been done with the data and any application data that has been received.
Trait Implementations§
impl Send for Stream
impl Sync for Stream
Auto Trait Implementations§
impl Freeze for Stream
impl RefUnwindSafe for Stream
impl Unpin for Stream
impl UnwindSafe for Stream
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)