Enum trotter::Status

source ยท
pub enum Status {
Show 19 variants Input = 10, SensitiveInput = 11, Success = 20, RedirectTemporary = 30, RedirectPermanent = 31, TemporaryFailure = 40, ServerUnavailable = 41, CgiError = 42, ProxyError = 43, SlowDown = 44, PermanentFailure = 50, NotFound = 51, Gone = 52, ProxyRequestRefused = 53, BadRequest = 59, ClientCertificateRequired = 60, CertificateNotAuthorised = 61, CertificateNotValid = 62, BadStatus = 0,
}
Expand description

Enum for representing gemini status codes.

Variantsยง

ยง

Input = 10

10 As per definition of single-digit code 1 in 3.2.

ยง

SensitiveInput = 11

11 As per status code 10, but for use with sensitive input such as passwords. Clients should present the prompt as per status code 10, but the userโ€™s input should not be echoed to the screen to prevent it being read by โ€œshoulder surfersโ€.

ยง

Success = 20

20 As per definition of single-digit code 2 in 3.2.

ยง

RedirectTemporary = 30

30 As per definition of single-digit code 3 in 3.2.

ยง

RedirectPermanent = 31

31 The requested resource should be consistently requested from the new URL provided in future. Tools like search engine indexers or content aggregators should update their configurations to avoid requesting the old URL, and end-user clients may automatically update bookmarks, etc. Note that clients which only pay attention to the initial digit of status codes will treat this as a temporary redirect. They will still end up at the right place, they just wonโ€™t be able to make use of the knowledge that this redirect is permanent, so theyโ€™ll pay a small performance penalty by having to follow the redirect each time.

ยง

TemporaryFailure = 40

40 As per definition of single-digit code 4 in 3.2.

ยง

ServerUnavailable = 41

41 The server is unavailable due to overload or maintenance. (cf HTTP 503)

ยง

CgiError = 42

42 A CGI process, or similar system for generating dynamic content, died unexpectedly or timed out.

ยง

ProxyError = 43

43 A proxy request failed because the server was unable to successfully complete a transaction with the remote host. (cf HTTP 502, 504)

ยง

SlowDown = 44

44 Rate limiting is in effect. is an integer number of seconds which the client must wait before another request is made to this server. (cf HTTP 429)

ยง

PermanentFailure = 50

50 As per definition of single-digit code 5 in 3.2.

ยง

NotFound = 51

51 The requested resource could not be found but may be available in the future. (cf HTTP 404) (struggling to remember this important status code? Easy: you canโ€™t find things hidden at Area 51!)

ยง

Gone = 52

52 The resource requested is no longer available and will not be available again. Search engines and similar tools should remove this resource from their indices. Content aggregators should stop requesting the resource and convey to their human users that the subscribed resource is gone. (cf HTTP 410)

ยง

ProxyRequestRefused = 53

53 The request was for a resource at a domain not served by the server and the server does not accept proxy requests.

ยง

BadRequest = 59

59 The server was unable to parse the clientโ€™s request, presumably due to a malformed request. (cf HTTP 400)

ยง

ClientCertificateRequired = 60

60 As per definition of single-digit code 6 in 3.2.

ยง

CertificateNotAuthorised = 61

61 The supplied client certificate is not authorised for accessing the particular requested resource. The problem is not with the certificate itself, which may be authorised for other resources.

ยง

CertificateNotValid = 62

62 The supplied client certificate was not accepted because it is not valid. This indicates a problem with the certificate in and of itself, with no consideration of the particular requested resource. The most likely cause is that the certificateโ€™s validity start date is in the future or its expiry date has passed, but this code may also indicate an invalid signature, or a violation of X509 standard requirements. The should provide more information about the exact error.

ยง

BadStatus = 0

_ Represents any other unsupported status code

Implementationsยง

sourceยง

impl Status

source

pub fn value(&self) -> u8

Return the status number this enum entry represents.

ยงNotice

This returns 0 if you give it Status::BadStatus, which is a catch-all for invalid statuses.

Trait Implementationsยง

sourceยง

impl Clone for Status

sourceยง

fn clone(&self) -> Status

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 Status

sourceยง

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

Formats the value using the given formatter. Read more
sourceยง

impl Display for Status

sourceยง

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

Formats the value using the given formatter. Read more
sourceยง

impl From<u8> for Status

sourceยง

fn from(n: u8) -> Self

Converts to this type from the input type.
sourceยง

impl Hash for Status

sourceยง

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 ยท sourceยง

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
sourceยง

impl Into<u8> for Status

sourceยง

fn into(self) -> u8

Converts this type into the (usually inferred) input type.
sourceยง

impl PartialEq for Status

sourceยง

fn eq(&self, other: &Status) -> 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 Status

sourceยง

impl Eq for Status

sourceยง

impl StructuralPartialEq for Status

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> ToString for T
where T: Display + ?Sized,

sourceยง

default fn to_string(&self) -> String

Converts the given value to a String. 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.