FastlyStatus
pub struct FastlyStatus { pub code: i32,}Fields
Constants
Success value.
This indicates that a hostcall finished successfully.
Generic error value.
This means that some unexpected error occurred during a hostcall.
Invalid argument.
Invalid handle.
Returned when a request, response, or body handle is not valid.
Buffer length error.
Returned when a buffer is too long.
Unsupported operation error.
This error is returned when some operation cannot be performed, because it is not supported.
Alignment error.
This is returned when a pointer does not point to a properly aligned slice of memory.
Invalid HTTP error.
This can be returned when a method, URI, or header is not valid.
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.
HTTP incomplete message error.
This can be returned when a stream ended unexpectedly.
A None error.
This status code is used to indicate when an optional value did not exist, as opposed to an empty value.
HTTP head too large error.
This error will be returned when the message head is too large.
HTTP invalid status error.
This error will be returned when the HTTP message contains an invalid status code.
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.
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
result
View sourceConvert 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