pub struct Component { /* private fields */ }Implementations§
Source§impl Component
impl Component
Sourcepub fn state(&self) -> ComponentConnectionState
pub fn state(&self) -> ComponentConnectionState
Retrieve the current state of a Component
Sourcepub fn selected_pair(&self) -> Option<CandidatePair>
pub fn selected_pair(&self) -> Option<CandidatePair>
The CandidatePair this component has selected to send/receive data with. This will not
be valid until the Component has reached ComponentConnectionState::Connected
Sourcepub fn gather_candidates<'a, 'b>(
&self,
sockets: impl IntoIterator<Item = (TransportType, &'a Address)>,
turn_servers: impl IntoIterator<Item = (&'b Address, TurnConfig)>,
) -> Result<(), AgentError>
pub fn gather_candidates<'a, 'b>( &self, sockets: impl IntoIterator<Item = (TransportType, &'a Address)>, turn_servers: impl IntoIterator<Item = (&'b Address, TurnConfig)>, ) -> Result<(), AgentError>
Start gathering candidates for this component. The parent
Agent::poll is used to progress
the gathering.
Sourcepub fn set_selected_pair(&self, pair: CandidatePair) -> Result<(), AgentError>
pub fn set_selected_pair(&self, pair: CandidatePair) -> Result<(), AgentError>
Set the pair that will be used to send/receive data. This will override the ICE negotiation chosen value.
Sourcepub fn send(
&self,
data: &[u8],
now: Instant,
) -> Result<AgentTransmit, AgentError>
pub fn send( &self, data: &[u8], now: Instant, ) -> Result<AgentTransmit, AgentError>
Send data to the peer using the selected pair. This will not succeed until the
Component has reached ComponentConnectionState::Connected
Trait Implementations§
impl Send for Component
impl Sync for Component
Auto Trait Implementations§
impl Freeze for Component
impl RefUnwindSafe for Component
impl Unpin for Component
impl UnwindSafe for Component
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
Mutably borrows from an owned value. Read more
§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)
🔬This is a nightly-only experimental API. (
clone_to_uninit)