pub struct Agent { /* private fields */ }Expand description
ICE agent.
§Usage
- Get all components and prepare them for data/media transmission.
- Get the local credentials for all channels and send them over to a remote agent.
- Get all local candidates and send them over to the remote agent.
- Set remote credentials for all channels (required to be done before adding remote candidates).
- Add remote candidates.
- If there are no more remote candidates, conclude connectivity checks.
Implementations§
Source§impl Agent
impl Agent
Sourcepub fn builder(agent_role: AgentRole) -> AgentBuilder
pub fn builder(agent_role: AgentRole) -> AgentBuilder
Get an ICE agent builder.
Sourcepub fn poll_next_local_candidate(
&mut self,
cx: &mut Context<'_>,
) -> Poll<Option<LocalCandidate>>
pub fn poll_next_local_candidate( &mut self, cx: &mut Context<'_>, ) -> Poll<Option<LocalCandidate>>
Get the next local candidate.
Sourcepub async fn next_local_candidate(&mut self) -> Option<LocalCandidate>
pub async fn next_local_candidate(&mut self) -> Option<LocalCandidate>
Get the next local candidate.
Sourcepub fn get_local_credentials(&self, channel: usize) -> Credentials
pub fn get_local_credentials(&self, channel: usize) -> Credentials
Get local credentials of a given channel.
Sourcepub fn get_remote_credentials(&self, channel: usize) -> Option<Credentials>
pub fn get_remote_credentials(&self, channel: usize) -> Option<Credentials>
Get remote credentials of a given channel (if known).
Sourcepub fn set_remote_credentials(
&mut self,
channel: usize,
credentials: Credentials,
)
pub fn set_remote_credentials( &mut self, channel: usize, credentials: Credentials, )
Set remote credentials for a given channel.
Sourcepub fn add_remote_candidate(
&mut self,
candidate: RemoteCandidate,
username_fragment: Option<&str>,
)
pub fn add_remote_candidate( &mut self, candidate: RemoteCandidate, username_fragment: Option<&str>, )
Add a given remote candidate.
§Panics
The method will panic if the remote credentials for the corresponding channel have not been set.
Auto Trait Implementations§
impl Freeze for Agent
impl !RefUnwindSafe for Agent
impl Send for Agent
impl Sync for Agent
impl Unpin for Agent
impl !UnwindSafe for Agent
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