Error

Enum Error 

Source
pub enum Error {
Show 39 variants Encoding, RequestLineMalformed { line: String, }, VersionMissing { line: String, }, StatusCodeMissing { line: String, }, MethodUnknown { method: String, }, UriMissing { line: String, }, UriMalformed { line: String, uri: String, }, UriNotAbsolute { uri: Uri, }, ReasonPhraseMissing { line: String, }, VersionMalformed { line: String, version: String, }, StatusCodeNotInteger { line: String, status_code: String, }, HeaderMalformed { line: String, }, ContentLengthMissing, ContentLengthNotInteger { value: String, }, HeadAlreadyDone, BodyAlreadyDone, MetadataNotParsed, NotDone, VersionUnknown, TransportProtocolProfileMissing { value: String, }, TransportLowerUnknown { value: String, }, TransportParameterUnknown { var: String, }, TransportParameterValueMissing { var: String, }, TransportParameterValueInvalid { var: String, val: String, }, TransportParameterInvalid { parameter: String, }, TransportChannelMalformed { value: String, }, TransportPortMalformed { value: String, }, InterleavedInvalid, InterleavedPayloadTooLarge, RangeMalformed { value: String, }, RangeUnitNotSupported { value: String, }, RangeTimeNotSupported { value: String, }, RangeNptTimeMalfored { value: String, }, RtpInfoUrlMissing { value: String, }, RtpInfoParameterUnknown { value: String, }, RtpInfoParameterInvalid { value: String, }, RtpInfoParameterUnexpected { value: String, }, Shutdown, Io(Error),
}

Variants§

§

Encoding

An error occurred decoding the header due to incorrect usage of text encoding by the sender.

§

RequestLineMalformed

The request line of the head part is malformed.

Fields

§line: String
§

VersionMissing

The header first line does have a method and target URI, but it does not have a version, which is the required third part of the first line of the head.

Fields

§line: String
§

StatusCodeMissing

The response status line does have a version, but does not have a status code which is required.

Fields

§line: String
§

MethodUnknown

The specified method is not a valid method.

Fields

§method: String
§

UriMissing

The header first line does have a method, but it does not have a target URI, which is the required second part of the first line of the head.

Fields

§line: String
§

UriMalformed

The header first line has a Request-URI, but it could not be parsed correctly.

Fields

§line: String
§

UriNotAbsolute

The Request-URI is correct, but represents a relative path, which is not allowed in RTSP.

Fields

§uri: Uri
§

ReasonPhraseMissing

The response status line has a version and status code, but is missing a reason phrase which is required.

Fields

§line: String
§

VersionMalformed

The version specifier is incorrect. It should start with “RTSP/” followed by a digit, “.” and another digit.

Fields

§line: String
§version: String
§

StatusCodeNotInteger

The provided status code is not an unsigned integer or cannot be converted to one. It must be a 3-digit non-negative number.

Fields

§line: String
§status_code: String
§

HeaderMalformed

Header line is malformed.

Fields

§line: String
§

ContentLengthMissing

The Content-Length header is missing, but it is required.

§

ContentLengthNotInteger

The Content-Length header is not an integer value, or cannot be converted to an unsigned integer.

Fields

§value: String
§

HeadAlreadyDone

This occurs when the caller invokes the state machine with a state that signals that parsing the head part of the request was already done before.

§

BodyAlreadyDone

This occurs when the caller invokes the state machine with a state that signals that parsing the body part of the request was already done before.

§

MetadataNotParsed

Metadata was not parsed for some reason.

§

NotDone

This occurs when the caller tries to turn the parser into an actual request, but the parser was not ready yet.

§

VersionUnknown

This occurs when trying to serialize a request that does not have a known version.

§

TransportProtocolProfileMissing

Transport header does not have protocol and profile string. The transport must start with RTP/AVP, where RTP denotes the protocol and AVP the profile.

Fields

§value: String
§

TransportLowerUnknown

Transport header contains unknown lower protocol. Use either TCP or UDP.

Fields

§value: String
§

TransportParameterUnknown

Transport header contains unknown parameter. Please see RFC 2326 Section 12.39 for a list of permissable parameters.

Fields

§

TransportParameterValueMissing

Transport header contains parameter that should have a value, but does not have one.

Fields

§

TransportParameterValueInvalid

Transport header contains parameter with invalid value.

Fields

§

TransportParameterInvalid

Transport header contains invalid or malformed parameter.

Fields

§parameter: String
§

TransportChannelMalformed

Transport header channel is malformed.

Fields

§value: String
§

TransportPortMalformed

Transport header port is malformed.

Fields

§value: String
§

InterleavedInvalid

Tried to parse interleaved data but there is no interleaved header. Interleaved packets always start with $ (0x24).

§

InterleavedPayloadTooLarge

Interleaved payload too large. The size cannot be larger than the maximum value of a 16-bit unsigned integer.

§

RangeMalformed

Range header value malformed.

Fields

§value: String
§

RangeUnitNotSupported

Parser does not support provided Range header unit.

Fields

§value: String
§

RangeTimeNotSupported

Parser does not support effective time in Range header.

Fields

§value: String
§

RangeNptTimeMalfored

The NPT time (either the from or to part of the time specifier) is malformed.

Fields

§value: String
§

RtpInfoUrlMissing

RTP Info must always contain a URL.

Fields

§value: String
§

RtpInfoParameterUnknown

RTP Info parameter is not known. This means that the RTP part contains an unknown or non-existant parameter variable.

Fields

§value: String
§

RtpInfoParameterInvalid

RTP Info parameter is invalid. This happens, for example, when the seq parameter is not an integer.

Fields

§value: String
§

RtpInfoParameterUnexpected

RTP Info contains unexpected extra parameter.

Fields

§value: String
§

Shutdown

Underlying socket was shut down. This is not really an error and consumers are expected to handle it gracefully.

§

Io(Error)

I/O error occurred.

Trait Implementations§

Source§

impl Debug for Error

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Display for Error

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Error for Error

1.30.0 · Source§

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

impl From<Error> for Error

Source§

fn from(error: Error) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl !Freeze for Error

§

impl !RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl !UnwindSafe 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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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