FastlyStatus

Structin fastly_sharedfastly-shared 0.13.2View source
pub struct FastlyStatus {
pub code: i32,
}

Fields

code

i32

Constants

OK

Selfread-onlyView source

Success value.

This indicates that a hostcall finished successfully.

ERROR

Selfread-onlyView source

Generic error value.

This means that some unexpected error occurred during a hostcall.

INVAL

Selfread-onlyView source

Invalid argument.

BADF

Selfread-onlyView source

Invalid handle.

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

BUFLEN

Selfread-onlyView source

Buffer length error.

Returned when a buffer is too long.

UNSUPPORTED

Selfread-onlyView source

Unsupported operation error.

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

BADALIGN

Selfread-onlyView source

Alignment error.

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

HTTPINVALID

Selfread-onlyView source

Invalid HTTP error.

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

HTTPUSER

Selfread-onlyView source

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.

HTTPINCOMPLETE

Selfread-onlyView source

HTTP incomplete message error.

This can be returned when a stream ended unexpectedly.

NONE

Selfread-onlyView source

A None error.

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

HTTPHEADTOOLARGE

Selfread-onlyView source

HTTP head too large error.

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

HTTPINVALIDSTATUS

Selfread-onlyView source

HTTP invalid status error.

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

LIMITEXCEEDED

Selfread-onlyView source

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.

AGAIN

Selfread-onlyView source

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.

Methods

fn is_err(&self) -> bool

Parameters

self: &Self

Returns

bool
fn is_ok(&self) -> bool

Parameters

self: &Self

Returns

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

Parameters

self: Self

Returns

Result<(), Self>

Trait implementations

impl Clone for FastlyStatus

fn clone(&self) -> Self

Parameters

self: &Self

Returns

Self

impl Debug for FastlyStatus

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

Parameters

self: &Self
f: &mut fmt::Formatter

Returns

fmt::Result

impl PartialEq for FastlyStatus

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

Parameters

self: &Self
other: &Self

Returns

bool

Auto trait implementations

Blanket implementations