Skip to main content

ServerEvent

Enum ServerEvent 

Source
#[non_exhaustive]
pub enum ServerEvent {
#[non_exhaustive]
BadClaims { digest: Checksum, san: Option<String>, reason: String, },
#[non_exhaustive]
InvalidCollectionDir { name: String, },
#[non_exhaustive]
StaleSummary { item: String, },
#[non_exhaustive]
ReadFailed { method: String, path: String, error: String, }, }
Expand description

An event of a server, which ServeOptions::on_event receives.

Display writes one line for the log of the host. It writes each control character of a text from the client as an escape sequence, for example \n, so the line holds no line break.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

#[non_exhaustive]
BadClaims

The server refused a request because the claims of its client certificate do not parse.

For a session request, the selected client group has tls-accept-claim=true. For a read, a group with tls-accept-claim=true carries the item of the certificate. The request got 403.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§digest: Checksum

The SHA-256 digest of the DER bytes of the certificate, as a tls-sha256:HEX item names it.

§san: Option<String>

The URI SAN that is no claim, or None when no one URI is at fault, for example when the certificate holds too many claims.

§reason: String

Why the claims do not parse.

§

#[non_exhaustive]
InvalidCollectionDir

A ref listing left out a directory under refs/mirrors/ whose name fails the collection-id rule (ostrya::is_collection_id).

The server reports each name one time for each Server value, at the first listing that finds it. Only a listing whose query holds a collection pair reads the directories under refs/mirrors/. The listing itself goes on. The server reports the event also with no receive policies.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§name: String

The name of the directory.

§

#[non_exhaustive]
StaleSummary

The server answered summary or summary.sig with 404, because the .access file of the auth item of the client does not hold the access digest of the item (ArchiveAnswer::StaleSummary).

The summary of the item does not match the client groups that the server read at start. ostrya summary -u writes the summaries again. The server reports each item one time for each Server value, at the first request that finds it.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§item: String

The text of the auth item.

§

#[non_exhaustive]
ReadFailed

The server answered a request with 500, because the read of the answer failed, for example with EACCES on an object.

The server reports the event one time for each such request: a GET or a HEAD of the archive view, and a ref listing. A body that fails after the server sent the status 200 gives no event.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§method: String

The method of the request.

§path: String

The path of the request as the client sent it, with no query.

§error: String

The text of the error of the read.

Implementations§

Source§

impl ServerEvent

Source

pub fn is_warning(&self) -> bool

Returns true if the event is a warning: the server served the request. Each other event is an error of a request that the server refused.

InvalidCollectionDir is a warning. BadClaims, StaleSummary, and ReadFailed are errors.

Trait Implementations§

Source§

impl Clone for ServerEvent

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ServerEvent

Source§

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

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

impl Display for ServerEvent

Source§

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

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

impl Eq for ServerEvent

Source§

impl PartialEq for ServerEvent

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ServerEvent

Auto Trait Implementations§

§

impl Forget for ServerEvent

§

impl Freeze for ServerEvent
where *const u8 is !null: Freeze, PhantomData<u8>: Freeze,

§

impl Move for ServerEvent

§

impl RefUnwindSafe for ServerEvent

§

impl Send for ServerEvent
where RawVecInner: Send,

§

impl Sync for ServerEvent
where RawVecInner: Sync,

§

impl Unpin for ServerEvent
where *const u8 is !null: Unpin,

§

impl UnsafeUnpin for ServerEvent

§

impl UnwindSafe for ServerEvent
where RawVecInner: UnwindSafe,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

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§

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

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more