pub struct Agent { /* private fields */ }Expand description
A running robot agent. Cheap to clone; every clone refers to the same agent.
Implementations§
Source§impl Agent
impl Agent
Sourcepub async fn start(cfg: AgentConfig) -> Result<(Agent, Receiver<AgentEvent>)>
pub async fn start(cfg: AgentConfig) -> Result<(Agent, Receiver<AgentEvent>)>
Bind, discover, announce, and start serving. Returns once the agent is
announced and accepting sessions; the maintenance loop runs in the
background until Agent::stop or the event receiver is dropped.
Sourcepub fn push_video(&self, channel: u8, frame: VideoFrame)
pub fn push_video(&self, channel: u8, frame: VideoFrame)
Hand an encoded picture to the engine. Never blocks: a frame that finds the slot full is dropped by the engine’s admission control.
Sourcepub fn push_video_layer(&self, channel: u8, layer: u8, frame: VideoFrame)
pub fn push_video_layer(&self, channel: u8, layer: u8, frame: VideoFrame)
As push_video, for a channel publishing several simulcast layers
(ADR 0008). Offer every layer’s frames; the agent relays one and drops
the rest, so switching costs a keyframe and never a reconnect. On a
channel that declared no ladder this is push_video and layer is
ignored.
Sourcepub fn push_message(&self, channel: u8, payload: &[u8])
pub fn push_message(&self, channel: u8, payload: &[u8])
Hand a message to a sensor channel.
pub fn channels(&self) -> &[ChannelSpec]
pub fn channel_by_name(&self, name: &str) -> Option<&ChannelSpec>
pub fn counters(&self) -> &Counters
pub fn session_count(&self) -> usize
pub fn profile(&self) -> &'static Profile
Sourcepub fn publisher_config(&self, channel: u8, reason: &str) -> Value
pub fn publisher_config(&self, channel: u8, reason: &str) -> Value
The video-config a publisher should be sent for channel under the
profile in force, with the bitrate clamped to what that channel’s
publisher declared it can produce (ChannelSpec::max_bitrate_kbps).
Sourcepub fn set_qos_profile(&self, name: &str, reason: &str) -> bool
pub fn set_qos_profile(&self, name: &str, reason: &str) -> bool
Switch the QoS ceiling. false if no profile by that name exists.
Sourcepub async fn set_status(&self, status: Option<Value>)
pub async fn set_status(&self, status: Option<Value>)
Free-form robot status, forwarded to the console through signaling.