StatusCode
type StatusCode = int
Implementions
Methods
[src]
pub fn as_int(self): int {
return self as int;
}
Returns status code as int
.
[src]
pub fn as_int(self): int {
return self as int;
}
Returns status code as int
.
Returns status code as int
.
from_int
pub fn from_int(code: int): StatusCode
[src]
pub fn from_int(code: int): StatusCode {
return code as StatusCode;
}
Creates a status code from int
.
from_int
pub fn from_int(code: int): StatusCode
[src]
pub fn from_int(code: int): StatusCode {
return code as StatusCode;
}
Creates a status code from int
.
Creates a status code from int
.
[src]
pub fn is_ok(self): bool {
return self == OK;
}
Returns true
if status code is StatusCode::OK
.
[src]
pub fn is_ok(self): bool {
return self == OK;
}
Returns true
if status code is StatusCode::OK
.
Returns true
if status code is StatusCode::OK
.
is_success
pub fn is_success(self): bool
[src]
pub fn is_success(self): bool {
let code = self as int;
return code >= 200 && code < 300;
}
Returns true
if status code is within 200-299
.
is_success
pub fn is_success(self): bool
[src]
pub fn is_success(self): bool {
let code = self as int;
return code >= 200 && code < 300;
}
Returns true
if status code is within 200-299
.
Returns true
if status code is within 200-299
.
is_client_error
pub fn is_client_error(self): bool
[src]
pub fn is_client_error(self): bool {
let code = self as int;
return code >= 400 && code < 500;
}
Returns true
if status code is within 400-499
.
is_client_error
pub fn is_client_error(self): bool
[src]
pub fn is_client_error(self): bool {
let code = self as int;
return code >= 400 && code < 500;
}
Returns true
if status code is within 400-499
.
Returns true
if status code is within 400-499
.
is_server_error
pub fn is_server_error(self): bool
[src]
pub fn is_server_error(self): bool {
let code = self as int;
return code >= 500 && code < 600;
}
Returns true
if status code is within 500-599
.
is_server_error
pub fn is_server_error(self): bool
[src]
pub fn is_server_error(self): bool {
let code = self as int;
return code >= 500 && code < 600;
}
Returns true
if status code is within 500-599
.
Returns true
if status code is within 500-599
.
is_redirection
pub fn is_redirection(self): bool
[src]
pub fn is_redirection(self): bool {
let code = self as int;
return code >= 300 && code < 400;
}
Returns true
if status code is within 300-399
.
is_redirection
pub fn is_redirection(self): bool
[src]
pub fn is_redirection(self): bool {
let code = self as int;
return code >= 300 && code < 400;
}
Returns true
if status code is within 300-399
.
Returns true
if status code is within 300-399
.
[src]
pub fn to_string(self): string {
switch (self) {
case Continue:
return "Continue";
case SwitchingProtocols:
return "Switching Protocols";
case ProcessingWebDAV:
return "Processing (WebDAV)";
case EarlyHints:
return "Early Hints";
case OK:
return "OK";
case Created:
return "Created";
case Accepted:
return "Accepted";
case NonAuthoritativeInformation:
return "Non-Authoritative Information";
case NoContent:
return "No Content";
case ResetContent:
return "Reset Content";
case PartialContent:
return "Partial Content";
case MultiStatusWebDAV:
return "Multi-Status (WebDAV)";
case AlreadyReportedWebDAV:
return "Already Reported (WebDAV)";
case IMUsedHTTPDeltaEncoding:
return "IM Used (HTTP Delta Encoding)";
case MultipleChoices:
return "Multiple Choices";
case MovedPermanently:
return "Moved Permanently";
case Found:
return "Found";
case SeeOther:
return "See Other";
case NotModified:
return "Not Modified";
case UseProxyDeprecated:
return "Use Proxy (Deprecated)";
case Unused:
return "Unused";
case TemporaryRedirect:
return "Temporary Redirect";
case PermanentRedirect:
return "Permanent Redirect";
case BadRequest:
return "Bad Request";
case Unauthorized:
return "Unauthorized";
case PaymentRequiredExperimental:
return "Payment Required (Experimental)";
case Forbidden:
return "Forbidden";
case NotFound:
return "Not Found";
case MethodNotAllowed:
return "Method Not Allowed";
case NotAcceptable:
return "Not Acceptable";
case ProxyAuthenticationRequired:
return "Proxy Authentication Required";
case RequestTimeout:
return "Request Timeout";
case Conflict:
return "Conflict";
case Gone:
return "Gone";
case LengthRequired:
return "Length Required";
case PreconditionFailed:
return "Precondition Failed";
case PayloadTooLarge:
return "Payload Too Large";
case URITooLong:
return "URI Too Long";
case UnsupportedMediaType:
return "Unsupported Media Type";
case RangeNotSatisfiable:
return "Range Not Satisfiable";
case ExpectationFailed:
return "Expectation Failed";
case ImATeapot:
return "I'm a Teapot";
case MisdirectedRequest:
return "Misdirected Request";
case UnprocessableContentWebDAV:
return "Unprocessable Content (WebDAV)";
case LockedWebDAV:
return "Locked (WebDAV)";
case FailedDependencyWebDAV:
return "Failed Dependency (WebDAV)";
case TooEarlyExperimental:
return "Too Early (Experimental)";
case UpgradeRequired:
return "Upgrade Required";
case PreconditionRequired:
return "Precondition Required";
case TooManyRequests:
return "Too Many Requests";
case RequestHeaderFieldsTooLarge:
return "Request Header Fields Too Large";
case UnavailableForLegalReasons:
return "Unavailable For Legal Reasons";
case InternalServerError:
return "Internal Server Error";
case NotImplemented:
return "Not Implemented";
case BadGateway:
return "Bad Gateway";
case ServiceUnavailable:
return "Service Unavailable";
case GatewayTimeout:
return "Gateway Timeout";
case HTTPVersionNotSupported:
return "HTTP Version Not Supported";
case VariantAlsoNegotiates:
return "Variant Also Negotiates";
case InsufficientStorageWebDAV:
return "Insufficient Storage (WebDAV)";
case LoopDetectedWebDAV:
return "Loop Detected (WebDAV)";
case NotExtended:
return "Not Extended";
case NetworkAuthenticationRequired:
return "Network Authentication Required";
default:
return `Unknown Status Code: ${self as int}`;
}
}
[src]
pub fn to_string(self): string {
switch (self) {
case Continue:
return "Continue";
case SwitchingProtocols:
return "Switching Protocols";
case ProcessingWebDAV:
return "Processing (WebDAV)";
case EarlyHints:
return "Early Hints";
case OK:
return "OK";
case Created:
return "Created";
case Accepted:
return "Accepted";
case NonAuthoritativeInformation:
return "Non-Authoritative Information";
case NoContent:
return "No Content";
case ResetContent:
return "Reset Content";
case PartialContent:
return "Partial Content";
case MultiStatusWebDAV:
return "Multi-Status (WebDAV)";
case AlreadyReportedWebDAV:
return "Already Reported (WebDAV)";
case IMUsedHTTPDeltaEncoding:
return "IM Used (HTTP Delta Encoding)";
case MultipleChoices:
return "Multiple Choices";
case MovedPermanently:
return "Moved Permanently";
case Found:
return "Found";
case SeeOther:
return "See Other";
case NotModified:
return "Not Modified";
case UseProxyDeprecated:
return "Use Proxy (Deprecated)";
case Unused:
return "Unused";
case TemporaryRedirect:
return "Temporary Redirect";
case PermanentRedirect:
return "Permanent Redirect";
case BadRequest:
return "Bad Request";
case Unauthorized:
return "Unauthorized";
case PaymentRequiredExperimental:
return "Payment Required (Experimental)";
case Forbidden:
return "Forbidden";
case NotFound:
return "Not Found";
case MethodNotAllowed:
return "Method Not Allowed";
case NotAcceptable:
return "Not Acceptable";
case ProxyAuthenticationRequired:
return "Proxy Authentication Required";
case RequestTimeout:
return "Request Timeout";
case Conflict:
return "Conflict";
case Gone:
return "Gone";
case LengthRequired:
return "Length Required";
case PreconditionFailed:
return "Precondition Failed";
case PayloadTooLarge:
return "Payload Too Large";
case URITooLong:
return "URI Too Long";
case UnsupportedMediaType:
return "Unsupported Media Type";
case RangeNotSatisfiable:
return "Range Not Satisfiable";
case ExpectationFailed:
return "Expectation Failed";
case ImATeapot:
return "I'm a Teapot";
case MisdirectedRequest:
return "Misdirected Request";
case UnprocessableContentWebDAV:
return "Unprocessable Content (WebDAV)";
case LockedWebDAV:
return "Locked (WebDAV)";
case FailedDependencyWebDAV:
return "Failed Dependency (WebDAV)";
case TooEarlyExperimental:
return "Too Early (Experimental)";
case UpgradeRequired:
return "Upgrade Required";
case PreconditionRequired:
return "Precondition Required";
case TooManyRequests:
return "Too Many Requests";
case RequestHeaderFieldsTooLarge:
return "Request Header Fields Too Large";
case UnavailableForLegalReasons:
return "Unavailable For Legal Reasons";
case InternalServerError:
return "Internal Server Error";
case NotImplemented:
return "Not Implemented";
case BadGateway:
return "Bad Gateway";
case ServiceUnavailable:
return "Service Unavailable";
case GatewayTimeout:
return "Gateway Timeout";
case HTTPVersionNotSupported:
return "HTTP Version Not Supported";
case VariantAlsoNegotiates:
return "Variant Also Negotiates";
case InsufficientStorageWebDAV:
return "Insufficient Storage (WebDAV)";
case LoopDetectedWebDAV:
return "Loop Detected (WebDAV)";
case NotExtended:
return "Not Extended";
case NetworkAuthenticationRequired:
return "Network Authentication Required";
default:
return `Unknown Status Code: ${self as int}`;
}
}