Skip to main content

FastlyStatus

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

impl Copy for FastlyStatus

Source§

impl Debug for FastlyStatus

Source§

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

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

impl Eq for FastlyStatus

Source§

impl PartialEq for FastlyStatus

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
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> 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.

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,

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.