Skip to main content

Agent

Struct Agent 

Source
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

Source

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.

Source

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.

Source

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.

Source

pub fn push_message(&self, channel: u8, payload: &[u8])

Hand a message to a sensor channel.

Source

pub fn channels(&self) -> &[ChannelSpec]

Source

pub fn channel_by_name(&self, name: &str) -> Option<&ChannelSpec>

Source

pub fn counters(&self) -> &Counters

Source

pub fn session_count(&self) -> usize

Source

pub fn profile(&self) -> &'static Profile

Source

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).

Source

pub fn set_qos_profile(&self, name: &str, reason: &str) -> bool

Switch the QoS ceiling. false if no profile by that name exists.

Source

pub async fn set_status(&self, status: Option<Value>)

Free-form robot status, forwarded to the console through signaling.

Source

pub fn signal_connected(&self) -> bool

Source

pub fn stop(&self)

Stop serving. The maintenance loop exits and the endpoint closes; in-flight sessions are torn down.

Trait Implementations§

Source§

impl Clone for Agent

Source§

fn clone(&self) -> Agent

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Agent

§

impl !UnwindSafe for Agent

§

impl Freeze for Agent

§

impl Send for Agent

§

impl Sync for Agent

§

impl Unpin for Agent

§

impl UnsafeUnpin for Agent

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more