Skip to main content

Error

Enum Error 

pub enum Error {
    Device {
        source: AnyError,
        meta: Meta,
    },
    InvalidConfig {
        reason: String,
        meta: Meta,
    },
    NoEncoder {
        codec: String,
        meta: Meta,
    },
    NoDecoder {
        codec: String,
        meta: Meta,
    },
    Encoder {
        source: AnyError,
        meta: Meta,
    },
    Decoder {
        source: AnyError,
        meta: Meta,
    },
    UnknownRendition {
        name: String,
        offered: Vec<String>,
        meta: Meta,
    },
    Catalog {
        source: AnyError,
        meta: Meta,
    },
    Broadcast {
        source: AnyError,
        meta: Meta,
    },
    Closed {
        meta: Meta,
    },
    Io {
        source: Error,
        meta: Meta,
    },
}
Expand description

An error from the media crates.

moq-ext-sources, moq-ext-player and moq-ext-publisher all return this one type, so an error passes from a source to a broadcast unchanged. A watched status holds it as Arc<Error>, as in SlotState::Failed.

Variants§

§

Device

A capture or playback device, or a media file, would not open or failed while running.

Fields

§source: AnyError

What the device reported.

§meta: Meta

Captured call-site metadata

§

InvalidConfig

A configuration cannot be used as given.

Fields

§reason: String

What is wrong with it.

§meta: Meta

Captured call-site metadata

§

NoEncoder

No encoder compiled into this build can produce the codec asked for.

Fields

§codec: String

The codec that was asked for.

§meta: Meta

Captured call-site metadata

§

NoDecoder

No decoder compiled into this build can read the codec.

Fields

§codec: String

The codec the broadcast carries.

§meta: Meta

Captured call-site metadata

§

Encoder

An encoder failed to open or to encode.

Fields

§source: AnyError

What the encoder reported.

§meta: Meta

Captured call-site metadata

§

Decoder

A decoder failed to open or to decode.

Fields

§source: AnyError

What the decoder reported.

§meta: Meta

Captured call-site metadata

§

UnknownRendition

The broadcast’s catalog has no video rendition of that name.

Fields

§name: String

The name that was asked for.

§offered: Vec<String>

The names the catalog has, largest first.

§meta: Meta

Captured call-site metadata

§

Catalog

The catalog could not be read or written.

Fields

§source: AnyError

What went wrong with it.

§meta: Meta

Captured call-site metadata

§

Broadcast

The broadcast layer refused an operation or reset a track being read.

The error comes from moq-net and looks the same whatever transport carries the broadcast. Failures of the transport itself, such as an unreachable peer, belong to the transport’s own error, iroh_live_node::Error for iroh.

Fields

§source: AnyError

What moq-net reported.

§meta: Meta

Captured call-site metadata

§

Closed

The broadcast, source or player was closed, or the session under it.

Fields

§meta: Meta

Captured call-site metadata

§

Io

Reading or writing a file or pipe failed.

Fields

§source: Error

What the operating system reported.

§meta: Meta

Captured call-site metadata

Implementations§

§

impl Error

pub fn invalid(reason: impl Into<String>) -> Error

Creates an Error::InvalidConfig with reason.

pub fn device(source: impl Error + Send + Sync + 'static) -> Error

Creates an Error::Device from an upstream error.

pub fn device_msg(message: impl Display) -> Error

Creates an Error::Device from a message.

pub fn encoder(source: impl Error + Send + Sync + 'static) -> Error

Creates an Error::Encoder from an upstream error.

pub fn encoder_msg(message: impl Display) -> Error

Creates an Error::Encoder from a message.

pub fn decoder(source: impl Error + Send + Sync + 'static) -> Error

Creates an Error::Decoder from an upstream error.

pub fn decoder_msg(message: impl Display) -> Error

Creates an Error::Decoder from a message.

pub fn catalog(source: impl Error + Send + Sync + 'static) -> Error

Creates an Error::Catalog from an upstream error.

pub fn catalog_msg(message: impl Display) -> Error

Creates an Error::Catalog from a message.

pub fn broadcast(source: impl Error + Send + Sync + 'static) -> Error

Creates an Error::Broadcast from an upstream error.

Trait Implementations§

§

impl Debug for Error

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Display for Error

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Error for Error

§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
§

impl From<Error> for Error

§

fn from(source: Error) -> Error

Converts to this type from the input type.
§

impl StackError for Error

§

fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)

Returns this error as a std error reference.
§

fn into_std(self: Box<Error>) -> Box<dyn Error + Send + Sync>

Returns this error as a std error.
§

fn as_dyn(&self) -> &dyn StackError

Returns this error as a dyn StackError.
§

fn fmt_message(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Returns the next source in the chain, if any.
§

fn meta(&self) -> Option<&Meta>

Returns metadata captured at creation time, if available.
§

fn source(&self) -> Option<ErrorRef<'_>>

Returns the next source in the chain, if any.
§

fn is_transparent(&self) -> bool

Returns whether this error is transparent and should be skipped in reports.
Source§

fn as_ref(&self) -> ErrorRef<'_>

Returns this error as an ErrorRef. Read more
Source§

fn stack(&self) -> Chain<'_> ⓘ

Returns an iterator over this error followed by its sources.
Source§

fn sources(&self) -> Chain<'_> ⓘ

Returns an iterator over sources of this error (skipping self).
Source§

fn report(&self) -> Report<'_>

Returns a Report to output the error with configurable formatting.

Auto Trait Implementations§

§

impl !RefUnwindSafe for Error

§

impl !UnwindSafe for Error

§

impl Freeze for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnsafeUnpin for Error

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
Source§

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

Source§

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

Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<S> FromSample<S> for S

Source§

fn from_sample_(s: S) -> S

Source§

impl<T> Instrument for T

Source§

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

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

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.

Source§

impl<F, T> IntoSample<T> for F
where T: FromSample<F>,

Source§

fn into_sample(self) -> T

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

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

Source§

impl<T> StackErrorExt for T
where T: StackError + 'static,

Source§

fn into_any(self) -> AnyError

Converts the error into AnyError. Read more
Source§

fn context(self, context: impl Display) -> AnyError

Converts the error into AnyError, and adds additional error context.
Source§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

Source§

fn to_sample_(self) -> U

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,

Source§

impl<T> WithSubscriber for T

Source§

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
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

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