pub struct Agent { /* private fields */ }Expand description
An ICE agent as specified in RFC 8445
Implementations§
Source§impl Agent
impl Agent
Sourcepub fn builder() -> AgentBuilder
pub fn builder() -> AgentBuilder
Create a new AgentBuilder
Sourcepub fn add_stream(&self) -> Stream
pub fn add_stream(&self) -> Stream
Add a new Stream to this agent
§Examples
Add a Stream
let agent = Agent::default();
let s = agent.add_stream();Sourcepub fn close(&self, now: Instant)
pub fn close(&self, now: Instant)
Close the agent loop. Applications should wait for Agent::poll to return
AgentPoll::Closed after calling this function.
Sourcepub fn controlling(&self) -> bool
pub fn controlling(&self) -> bool
The controlling state of this ICE agent. This value may change throughout the ICE negotiation process.
Sourcepub fn add_stun_server(&self, transport: TransportType, addr: Address)
pub fn add_stun_server(&self, transport: TransportType, addr: Address)
Add a STUN server by address and transport to use for gathering potential candidates
Sourcepub fn poll(&self, now: Instant) -> AgentPoll
pub fn poll(&self, now: Instant) -> AgentPoll
Poll the Agent for further progress to be made.
The returned value indicates what the application needs to do.
Sourcepub fn poll_transmit(&self, now: Instant) -> Option<AgentTransmit>
pub fn poll_transmit(&self, now: Instant) -> Option<AgentTransmit>
Poll for a transmission to be performed.
If not-None, then the provided data must be sent to the peer from the provided socket address.
Trait Implementations§
impl Send for Agent
impl Sync for Agent
Auto Trait Implementations§
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)