Skip to main content

Engine

Struct Engine 

Source
pub struct Engine { /* private fields */ }

Implementations§

Source§

impl Engine

Source

pub fn new(cfg: EngineConfig) -> (Engine, Receiver<Event>)

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 profile(&self) -> &'static Profile

Source

pub fn ceiling_kbps(&self, channel: u8) -> u32

The bitrate ceiling in force for a video channel: the profile’s, lowered to the publisher’s declared maximum (ChannelSpec::max_bitrate_kbps).

Source

pub fn publisher_config(&self, channel: u8, reason: &str) -> Value

The video-config a publisher should receive for channel under the current profile, with the bitrate clamped to the channel’s ceiling.

Source

pub fn now_us(&self) -> u64

Source

pub fn session_count(&self) -> usize

Source

pub fn signal_session_ids(&self) -> Vec<String>

Source

pub fn expect_pilot(&self, signal_id: &str, role: Role)

The cloud told us a pilot is coming (pilot-connecting). Remembered for 30 s so its hello can be matched to a role.

Source

pub fn revoke(&self, signal_id: &str, reason: &str)

The cloud revoked a session (pilot left / abort / revoke).

Source

pub fn set_profile(&self, profile: &'static Profile, reason: &str)

Change the QoS ceiling live (also reachable by pilots via set-qos).

Source

pub fn push_video(&self, channel: u8, frame: VideoFrame)

Offer a new frame. In-order bounded queue (see FrameQueue): a keyframe flushes deltas that lead nowhere (keyframe_flushes_queue); an overflowing delta is dropped together with every delta after it until the next keyframe, and a recovery request is raised so that keyframe arrives in ~1 RTT.

Source

pub fn push_video_layer(&self, channel: u8, layer: u8, frame: VideoFrame)

As push_video, for a channel that publishes several simulcast layers (ADR 0008). Frames of every declared layer are offered; the engine relays one and drops the rest, so the alternative is always encoded and one keyframe away. A channel that declared no ladder ignores layer.

Source

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

Send one sensor message to every session.

Source

pub async fn accept_loop(self, endpoint: Arc<Endpoint>)

Accept sessions from the endpoint forever.

Source

pub fn serve(&self, session: Session)

Serve a session that did not come from the endpoint — a relayed one (ADR 0010). It is treated exactly like an accepted WebTransport session; only its path label differs.

Trait Implementations§

Source§

impl Clone for Engine

Source§

fn clone(&self) -> Engine

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§

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