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(&mut self) -> usize
pub fn add_stream(&mut self) -> usize
Add a new Stream
to this agent
§Examples
Add a Stream
let mut agent = Agent::default();
let s = agent.add_stream();
Sourcepub fn close(&mut self, now: Instant)
pub fn close(&mut 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(&mut self, transport: TransportType, addr: SocketAddr)
pub fn add_stun_server(&mut self, transport: TransportType, addr: SocketAddr)
Add a STUN server by address and transport to use for gathering potential candidates
Sourcepub fn stun_servers(&self) -> &Vec<(TransportType, SocketAddr)>
pub fn stun_servers(&self) -> &Vec<(TransportType, SocketAddr)>
The current list of STUN servers used by this Agent
pub fn add_turn_server( &mut self, transport: TransportType, addr: SocketAddr, credentials: TurnCredentials, )
Sourcepub fn turn_servers(&self) -> &Vec<(TransportType, SocketAddr, TurnCredentials)>
pub fn turn_servers(&self) -> &Vec<(TransportType, SocketAddr, TurnCredentials)>
The current list of STUN servers used by this Agent
Sourcepub fn stream(&self, id: usize) -> Option<Stream<'_>>
pub fn stream(&self, id: usize) -> Option<Stream<'_>>
Get a Stream
by id.
If the stream does not exist, then None
will be returned.
Sourcepub fn mut_stream(&mut self, id: usize) -> Option<StreamMut<'_>>
pub fn mut_stream(&mut self, id: usize) -> Option<StreamMut<'_>>
Get a StreamMut
by id. If the stream does not exist, then None
will be returned.
Sourcepub fn poll(&mut self, now: Instant) -> AgentPoll
pub fn poll(&mut 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(&mut self, now: Instant) -> Option<AgentTransmit>
pub fn poll_transmit(&mut 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.