Struct fastly_shared::FastlyStatus

source ·
#[repr(transparent)]
pub struct FastlyStatus { pub code: i32, }

Fields§

§code: i32

Implementations§

source§

impl FastlyStatus

source

pub const OK: Self = _

Success value.

This indicates that a hostcall finished successfully.

source

pub const ERROR: Self = _

Generic error value.

This means that some unexpected error occurred during a hostcall.

source

pub const INVAL: Self = _

Invalid argument.

source

pub const BADF: Self = _

Invalid handle.

Returned when a request, response, or body handle is not valid.

source

pub const BUFLEN: Self = _

Buffer length error.

Returned when a buffer is too long.

source

pub const UNSUPPORTED: Self = _

Unsupported operation error.

This error is returned when some operation cannot be performed, because it is not supported.

source

pub const BADALIGN: Self = _

Alignment error.

This is returned when a pointer does not point to a properly aligned slice of memory.

source

pub const HTTPINVALID: Self = _

Invalid HTTP error.

This can be returned when a method, URI, or header is not valid.

source

pub const HTTPUSER: Self = _

HTTP user error.

This is returned in cases where user code caused an HTTP error. For example, attempt to send a 1xx response code, or a request with a non-absolute URI. This can also be caused by an unexpected header: both content-length and transfer-encoding, for example.

source

pub const HTTPINCOMPLETE: Self = _

HTTP incomplete message error.

This can be returned when a stream ended unexpectedly.

source

pub const NONE: Self = _

A None error.

This status code is used to indicate when an optional value did not exist, as opposed to an empty value.

source

pub const HTTPHEADTOOLARGE: Self = _

HTTP head too large error.

This error will be returned when the message head is too large.

source

pub const HTTPINVALIDSTATUS: Self = _

HTTP invalid status error.

This error will be returned when the HTTP message contains an invalid status code.

source

pub const LIMITEXCEEDED: Self = _

Limit exceeded

This is returned when an attempt to allocate a resource has exceeded the maximum number of resources permitted. For example, creating too many response handles.

source

pub const AGAIN: Self = _

Resource temporarily unavailable

This is returned when an attempting to retrieve a resource that is not yet available. For example when attempting to read trailers from a Body that has not yet been consumed.

source

pub fn is_ok(&self) -> bool

source

pub fn is_err(&self) -> bool

source

pub fn result(self) -> Result<(), Self>

Convert a FastlyStatus value to a Result<(), FastlyStatus>.

This will consume a status code, and return Ok(()) if and only if the value was FastlyStatus::OK. If the status code was some error, then it will be returned in the result’s Err variant.

Trait Implementations§

source§

impl Clone for FastlyStatus

source§

fn clone(&self) -> FastlyStatus

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for FastlyStatus

source§

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

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

impl PartialEq for FastlyStatus

source§

fn eq(&self, other: &FastlyStatus) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for FastlyStatus

source§

impl Eq for FastlyStatus

source§

impl StructuralPartialEq for FastlyStatus

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
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> ToOwned for T
where T: Clone,

§

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>,

§

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>,

§

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.