Enum Status

Source
pub enum Status {
Show 19 variants Input, SensitiveInput, Success, RedirectTemporary, RedirectPermanent, TemporaryFailure, ServerUnavailable, CgiError, ProxyError, SlowDown, PermanentFailure, NotFound, Gone, ProxyRequestRefused, BadRequest, ClientCertificateRequired, CertificateNotAuthorised, CertificateNotValid, BadStatus,
}
Expand description

Re-export from trotter. Enum for representing gemini status codes.

Variants§

§

Input

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

§

SensitiveInput

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 As per definition of single-digit code 2 in 3.2.

§

RedirectTemporary

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

§

RedirectPermanent

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 As per definition of single-digit code 4 in 3.2.

§

ServerUnavailable

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

§

CgiError

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

§

ProxyError

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 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 As per definition of single-digit code 5 in 3.2.

§

NotFound

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 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 The request was for a resource at a domain not served by the server and the server does not accept proxy requests.

§

BadRequest

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

§

ClientCertificateRequired

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

§

CertificateNotAuthorised

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

_ 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 Debug for Status

Source§

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

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

impl Display for Status

Source§

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

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

impl From<u8> for Status

Source§

fn from(n: u8) -> Status

Converts to this type from the input type.
Source§

impl Into<u8> for Status

Source§

fn into(self) -> u8

Converts this type into the (usually inferred) input type.

Auto Trait Implementations§

§

impl Freeze for Status

§

impl RefUnwindSafe for Status

§

impl Send for Status

§

impl Sync for Status

§

impl Unpin for Status

§

impl UnwindSafe for Status

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

Source§

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>,

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

impl<T> ErasedDestructor for T
where T: 'static,