Skip to main content

ObjectStoreLogStore

Struct ObjectStoreLogStore 

Source
pub struct ObjectStoreLogStore {
Show 18 fields prefix: String, storage: String, ack_mode: AckMode, on_corrupted_segment: CorruptedSegmentAction, accept_missing_history: bool, found_empty: bool, history_end: u64, started_regions: Arc<Mutex<HashSet<RegionId>>>, io: Arc<dyn WalObjectIo>, catalog: Arc<RwLock<ObjectCatalog>>, obsolete_entry_ids: Arc<Mutex<HashMap<RegionId, EntryId>>>, wal_holes: Arc<Mutex<HashMap<RegionId, BTreeMap<u64, WalHole>>>>, deleting: Arc<DeletingObjects>, read_prefetch_budget: Arc<Semaphore>, terminal_error: Arc<Mutex<Option<Arc<Error>>>>, stopped: Arc<AtomicBool>, command_tx: Sender<Command>, append_tx: Sender<(Vec<Entry>, Sender<Result<AppendBatchResponse>>)>,
}
Expand description

A log store over the immutable WAL objects under one prefix.

Appends are admitted into an open batch. A background actor seals the batch when it reaches the size limit or the flush interval elapses and creates the object under the next sequence while it keeps admitting entries into the next batch; up to MAX_IN_FLIGHT_CREATES creates run at a time. Objects are indexed in the catalog in sequence order. In the durable acknowledgement mode an append returns once its object is durable and indexed, so an acknowledged entry never has a missing predecessor; in the enqueued mode it returns on admission and the object is created in the background. While MAX_SEALED_BATCHES batches wait to become durable no append is admitted, and in the enqueued mode appends are rejected while the object store refuses the backlog with an error that requires intervention. A segment that a read cannot decode is handled as on_corrupted_segment says. Objects below the reclaim boundary of the last indexed object are deleted in the background. A release of a region seals an object with a release record of the region at once and returns, in both modes, once that object is durable and indexed.

Fields§

§prefix: String§storage: String

The storage the prefix is read from, as configured, for messages.

§ack_mode: AckMode§on_corrupted_segment: CorruptedSegmentAction§accept_missing_history: bool§found_empty: bool

Whether the prefix held no object when the store opened.

§history_end: u64

The sequence above the newest object holding entries that recovery indexed, zero when it indexed none.

§started_regions: Arc<Mutex<HashSet<RegionId>>>§io: Arc<dyn WalObjectIo>§catalog: Arc<RwLock<ObjectCatalog>>§obsolete_entry_ids: Arc<Mutex<HashMap<RegionId, EntryId>>>§wal_holes: Arc<Mutex<HashMap<RegionId, BTreeMap<u64, WalHole>>>>

Segments that reads skipped, per region and by object sequence.

§deleting: Arc<DeletingObjects>

Objects with a delete in flight, which a read consults.

§read_prefetch_budget: Arc<Semaphore>

Bytes the reads may fetch ahead, see READ_PREFETCH_BYTES.

§terminal_error: Arc<Mutex<Option<Arc<Error>>>>§stopped: Arc<AtomicBool>§command_tx: Sender<Command>§append_tx: Sender<(Vec<Entry>, Sender<Result<AppendBatchResponse>>)>

Implementations§

Source§

impl ObjectStoreLogStore

Source

pub async fn try_new( object_store: ObjectStore, config: &ObjectStoreWalConfig, node_id: u64, generation: u64, ) -> Result<Arc<Self>>

Builds the store under the node and generation prefix derived from config, recovering the catalog from the objects that already exist and writing the object that starts the epoch of this instance. Before it recovers, it fails unless the object store refuses to overwrite an object on a conditional create. Recovery fails on the first corrupted or conflicting object.

Source

async fn open( io: Arc<dyn WalObjectIo>, config: &ObjectStoreWalConfig, prefix: String, ) -> Result<Arc<Self>>

Source

pub(crate) fn durable_entry_id(&self, provider: &Provider) -> Result<EntryId>

Returns the largest entry id of the provider’s region whose object is durable and indexed, or zero for a region without such entries. In the enqueued acknowledgement mode an entry id that an append returned stays above this value until the object holding it is created.

Source

fn durable_entry_id_of(&self, region_id: RegionId) -> EntryId

Source

pub fn wal_holes(&self, provider: &Provider) -> Result<Vec<WalHole>>

Returns the segments of the provider’s region that reads of this store skipped because they did not decode, ordered by object sequence. Holes are kept in memory only: a store opened later on the same prefix records them again when its reads meet the segments.

Source

fn region_of(&self, provider: &Provider) -> Result<RegionId>

Returns the region of provider, which must select this store’s prefix.

Source

fn check_region(&self, provider: &Provider, region_id: RegionId) -> Result<()>

Source

fn check_terminal(&self) -> Result<()>

Source

async fn release(&self, region_id: RegionId, full: bool) -> Result<()>

Releases the region: its watermark moves up to the release in memory and a release record of it goes into an object sealed at once, and the call returns once that object is durable and indexed, in both acknowledgement modes, or with the error that failed it. A full release reaches EntryId::MAX; any other the largest id the store handed out for the region, which every entry of the region it holds is at or below. When the object fails, the next sealed batch carries the record again. Recovery seeds the watermark from the record, so a store opened later collects the objects of a region that is never opened again.

Source

fn missing_history( &self, region_id: RegionId, entry_id: EntryId, ) -> Option<String>

Returns why the prefix cannot hold the WAL history of region_id through the watermark entry_id, or None when it can.

Two invariants of a prefix decide it. First, a prefix that any store opened is never empty afterwards, unless that store withdrew its start object, see withdraw_start: every open writes its start object before it admits an append, and collection deletes only objects below the reclaim boundary of the last indexed object, which carries a boundary at or below its own sequence (a larger one fails its header check), so the newest indexed object always stays. Second, a watermark a region persisted names an object at or below the newest object holding entries that any later recovery of the prefix indexes. The entry it names was durable and indexed when the watermark was persisted, since an append of the durable mode returns only then and Mito waits for durability before it publishes a watermark in the enqueued mode. No durable boundary passes the newest object holding entries: a batch carries at most the sequence after the last indexed object, which is below the batch, and a start object carries the boundary recovery found, or its own sequence on a chain without segments. So that object stays, and recovery indexes it on the chain of the tip. The segment of release records counts as entries: it never holds the reclaim boundary, so an object holding only releases can be the one that collection keeps while it deletes every older object. Objects without segments, such as the start objects of opens this check refused, do not move it.

So the history is missing when this store found the prefix empty, or when the watermark names an object above the newest one holding entries that it found, unless the region’s history starts in this store or the catalog holds the region’s entries through the watermark: those of a region written since the store opened.

Source

async fn withdraw_start(&self)

Deletes the start object of a store that found its prefix empty and whose open of an existing region is refused, so that the next open finds the prefix empty again and refuses the region as well, instead of passing a region that never flushed. The actor gives the object up only while the store has admitted nothing, has no batch, holds no other object and no region’s history started in it, and from then on the store accepts nothing, since a later object would link to the deleted one. The actor owns the delete like any collection, so stop waits for it and a cancelled caller does not abandon it, and every refusal returns only once it settled. A failed delete, or a crash before the delete completes, leaves the start object behind, and the next open passes a region that never flushed.

Trait Implementations§

Source§

impl Debug for ObjectStoreLogStore

Source§

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

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

impl LogStore for ObjectStoreLogStore

Source§

fn stop<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Stops the store. Creates in flight run to completion and acknowledge their entries if they succeed; in the enqueued mode the remaining backlog is uploaded first, and a failure of that upload is returned.

Source§

fn read<'life0, 'life1, 'async_trait>( &'life0 self, provider: &'life1 Provider, entry_id: EntryId, ) -> Pin<Box<dyn Future<Output = Result<SendableEntryStream<'static, Entry, Error>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Reads the provider’s region from entry_id, hiding obsolete entries. The catalog locates each segment, so a caller-supplied index is unnecessary. An object collected after the read listed it is skipped. Otherwise a segment that does not decode fails the read or is skipped and recorded as a hole, as on_corrupted_segment says; a failed fetch always fails the read. Up to READ_PREFETCH_DEPTH segments are fetched ahead while READ_PREFETCH_BYTES allows, and each outcome is handled in sequence order.

Source§

fn obsolete<'life0, 'life1, 'async_trait>( &'life0 self, provider: &'life1 Provider, region_id: RegionId, entry_id: EntryId, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Moves the obsolete watermark of the region up to entry_id. In the enqueued acknowledgement mode the watermark never passes the durable entry id: an entry that is not durable yet is replayed after a crash, and hiding it would skip it.

Every id the region is assigned from now on is greater than entry_id, whatever watermark is recorded: the sequence of the next object is raised above the object entry_id names unless it is there already, so a watermark assigned under another prefix, or one whose object this prefix no longer holds, is never passed by a new id. Zero names no object and needs no floor. Before Mito opens a region that writes this WAL from its persisted state, it calls check_region_history, which refuses a watermark naming an object at or above the next sequence the store found unless accept_missing_history is set, so the floor moves for such a region only once that loss was accepted.

The watermark and the floor are applied together by the actor: a call cancelled before its command is queued publishes neither, while a command already queued still applies both. While the open batch holds ids under the next sequence the floor cannot move, and the call fails with Error::WalObjectSequenceUnsettled and records neither. The watermark is kept in memory; the caller re-establishes it after a restart unless it released the region, see release_region. In the enqueued mode an entry_id this store handed out needs no floor: it is never handed out again while the store runs.

Source§

fn obsolete_all<'life0, 'life1, 'async_trait>( &'life0 self, provider: &'life1 Provider, region_id: RegionId, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Hides every entry of the region and lets collection delete its objects, by a release in full that is durable once this returns.

Source§

fn release_region<'life0, 'life1, 'async_trait>( &'life0 self, provider: &'life1 Provider, region_id: RegionId, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Releases the region through the largest id handed out for it, durably once this returns. Should the region id be used again, its new entries have greater ids and stay readable.

Source§

fn wait_durable<'life0, 'life1, 'async_trait>( &'life0 self, provider: &'life1 Provider, entry_id: EntryId, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Waits until every entry of the provider’s region with an id at or below entry_id is durable and indexed. Returns at once in the durable acknowledgement mode, where a caller only holds durable ids.

Source§

fn check_region_history<'life0, 'life1, 'async_trait>( &'life0 self, provider: &'life1 Provider, entry_id: EntryId, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fails with Error::MissingWalHistory when the prefix cannot hold the history of the provider’s region through entry_id, unless accept_missing_history is set: then the region’s writes that were not flushed are lost, which is logged and counted.

Source§

fn start_region_history(&self, provider: &Provider) -> Result<()>

Records the provider’s region as one whose history starts in this store, which is kept in memory: a later store on the prefix judges the region by its watermark and the objects it finds.

Source§

type Error = Error

Source§

fn append_batch<'life0, 'async_trait>( &'life0 self, entries: Vec<Entry>, ) -> Pin<Box<dyn Future<Output = Result<AppendBatchResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Appends a batch of entries and returns a response containing a map where the key is a region id while the value is the id of the last successfully written entry of the region.
Source§

fn create_namespace<'life0, 'life1, 'async_trait>( &'life0 self, ns: &'life1 Provider, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Creates a new Namespace from the given ref.
Source§

fn delete_namespace<'life0, 'life1, 'async_trait>( &'life0 self, ns: &'life1 Provider, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Deletes an existing Namespace specified by the given ref.
Source§

fn list_namespaces<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<Provider>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Lists all existing namespaces.
Source§

fn entry( &self, data: Vec<u8>, entry_id: EntryId, region_id: RegionId, provider: &Provider, ) -> Result<Entry>

Makes an entry instance of the associated Entry type
Source§

fn latest_entry_id(&self, provider: &Provider) -> Result<EntryId>

Returns the latest entry id in the log store.

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
§

impl<T> Any for T
where T: Any,

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
§

impl<T> Conv for T

§

fn conv<T>(self) -> T
where Self: Into<T>,

Converts self into T using Into<T>. Read more
§

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

§

impl<T> FmtForward for T

§

fn fmt_binary(self) -> FmtBinary<Self>
where Self: Binary,

Causes self to use its Binary implementation when Debug-formatted.
§

fn fmt_display(self) -> FmtDisplay<Self>
where Self: Display,

Causes self to use its Display implementation when Debug-formatted.
§

fn fmt_lower_exp(self) -> FmtLowerExp<Self>
where Self: LowerExp,

Causes self to use its LowerExp implementation when Debug-formatted.
§

fn fmt_lower_hex(self) -> FmtLowerHex<Self>
where Self: LowerHex,

Causes self to use its LowerHex implementation when Debug-formatted.
§

fn fmt_octal(self) -> FmtOctal<Self>
where Self: Octal,

Causes self to use its Octal implementation when Debug-formatted.
§

fn fmt_pointer(self) -> FmtPointer<Self>
where Self: Pointer,

Causes self to use its Pointer implementation when Debug-formatted.
§

fn fmt_upper_exp(self) -> FmtUpperExp<Self>
where Self: UpperExp,

Causes self to use its UpperExp implementation when Debug-formatted.
§

fn fmt_upper_hex(self) -> FmtUpperHex<Self>
where Self: UpperHex,

Causes self to use its UpperHex implementation when Debug-formatted.
§

fn fmt_list(self) -> FmtList<Self>
where &'a Self: for<'a> IntoIterator,

Formats each item in a sequence. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FutureExt for T

§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
§

impl<T> Instrument for T

§

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

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

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

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> IntoRequest<T> for T

§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<L> LayerExt<L> for L

§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in [Layered].
§

impl<T> MaybeSend for T
where T: Send,

§

impl<T> MaybeSend for T
where T: Send,

§

impl<T> Pipe for T
where T: ?Sized,

§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
where Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
§

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R
where R: 'a,

Borrows self and passes that borrow into the pipe function. Read more
§

fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R
where R: 'a,

Mutably borrows self and passes that borrow into the pipe function. Read more
§

fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
where Self: Borrow<B>, B: 'a + ?Sized, R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
§

fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
where Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
where Self: AsRef<U>, U: 'a + ?Sized, R: 'a,

Borrows self, then passes self.as_ref() into the pipe function.
§

fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
where Self: AsMut<U>, U: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.as_mut() into the pipe function.
§

fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
where Self: Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrows self, then passes self.deref() into the pipe function.
§

fn pipe_deref_mut<'a, T, R>( &'a mut self, func: impl FnOnce(&'a mut T) -> R, ) -> R
where Self: DerefMut<Target = T> + Deref, T: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe function.
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<T> ServiceExt for T

§

fn propagate_header(self, header: HeaderName) -> PropagateHeader<Self>
where Self: Sized,

Propagate a header from the request to the response. Read more
§

fn add_extension<T>(self, value: T) -> AddExtension<Self, T>
where Self: Sized,

Add some shareable value to request extensions. Read more
§

fn map_request_body<F>(self, f: F) -> MapRequestBody<Self, F>
where Self: Sized,

Apply a transformation to the request body. Read more
§

fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>
where Self: Sized,

Apply a transformation to the response body. Read more
§

fn compression(self) -> Compression<Self>
where Self: Sized,

Compresses response bodies. Read more
§

fn decompression(self) -> Decompression<Self>
where Self: Sized,

Decompress response bodies. Read more
§

fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>
where Self: Sized,

High level tracing that classifies responses using HTTP status codes. Read more
§

fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>
where Self: Sized,

High level tracing that classifies responses using gRPC headers. Read more
§

fn follow_redirects(self) -> FollowRedirect<Self>
where Self: Sized,

Follow redirect resposes using the Standard policy. Read more
§

fn sensitive_headers( self, headers: impl IntoIterator<Item = HeaderName>, ) -> SetSensitiveRequestHeaders<SetSensitiveResponseHeaders<Self>>
where Self: Sized,

Mark headers as sensitive on both requests and responses. Read more
§

fn sensitive_request_headers( self, headers: impl IntoIterator<Item = HeaderName>, ) -> SetSensitiveRequestHeaders<Self>
where Self: Sized,

Mark headers as sensitive on requests. Read more
§

fn sensitive_response_headers( self, headers: impl IntoIterator<Item = HeaderName>, ) -> SetSensitiveResponseHeaders<Self>
where Self: Sized,

Mark headers as sensitive on responses. Read more
§

fn override_request_header<M>( self, header_name: HeaderName, make: M, ) -> SetRequestHeader<Self, M>
where Self: Sized,

Insert a header into the request. Read more
§

fn append_request_header<M>( self, header_name: HeaderName, make: M, ) -> SetRequestHeader<Self, M>
where Self: Sized,

Append a header into the request. Read more
§

fn insert_request_header_if_not_present<M>( self, header_name: HeaderName, make: M, ) -> SetRequestHeader<Self, M>
where Self: Sized,

Insert a header into the request, if the header is not already present. Read more
§

fn override_response_header<M>( self, header_name: HeaderName, make: M, ) -> SetResponseHeader<Self, M>
where Self: Sized,

Insert a header into the response. Read more
§

fn append_response_header<M>( self, header_name: HeaderName, make: M, ) -> SetResponseHeader<Self, M>
where Self: Sized,

Append a header into the response. Read more
§

fn insert_response_header_if_not_present<M>( self, header_name: HeaderName, make: M, ) -> SetResponseHeader<Self, M>
where Self: Sized,

Insert a header into the response, if the header is not already present. Read more
§

fn set_request_id<M>( self, header_name: HeaderName, make_request_id: M, ) -> SetRequestId<Self, M>
where Self: Sized, M: MakeRequestId,

Add request id header and extension. Read more
§

fn set_x_request_id<M>(self, make_request_id: M) -> SetRequestId<Self, M>
where Self: Sized, M: MakeRequestId,

Add request id header and extension, using x-request-id as the header name. Read more
§

fn propagate_request_id( self, header_name: HeaderName, ) -> PropagateRequestId<Self>
where Self: Sized,

Propgate request ids from requests to responses. Read more
§

fn propagate_x_request_id(self) -> PropagateRequestId<Self>
where Self: Sized,

Propgate request ids from requests to responses, using x-request-id as the header name. Read more
§

fn catch_panic(self) -> CatchPanic<Self, DefaultResponseForPanic>
where Self: Sized,

Catch panics and convert them into 500 Internal Server responses. Read more
§

fn request_body_limit(self, limit: usize) -> RequestBodyLimit<Self>
where Self: Sized,

Intercept requests with over-sized payloads and convert them into 413 Payload Too Large responses. Read more
§

fn trim_trailing_slash(self) -> NormalizePath<Self>
where Self: Sized,

Remove trailing slashes from paths. Read more
§

fn append_trailing_slash(self) -> NormalizePath<Self>
where Self: Sized,

Append trailing slash to paths. Read more
§

impl<T> Tap for T

§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
§

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Immutable access to the Borrow<B> of a value. Read more
§

fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Mutable access to the BorrowMut<B> of a value. Read more
§

fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Immutable access to the AsRef<R> view of a value. Read more
§

fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Mutable access to the AsMut<R> view of a value. Read more
§

fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Immutable access to the Deref::Target of a value. Read more
§

fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Mutable access to the Deref::Target of a value. Read more
§

fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

Calls .tap() only in debug builds, and is erased in release builds.
§

fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

Calls .tap_mut() only in debug builds, and is erased in release builds.
§

fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Calls .tap_borrow() only in debug builds, and is erased in release builds.
§

fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds.
§

fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Calls .tap_ref() only in debug builds, and is erased in release builds.
§

fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Calls .tap_ref_mut() only in debug builds, and is erased in release builds.
§

fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Calls .tap_deref() only in debug builds, and is erased in release builds.
§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
§

impl<T> TryConv for T

§

fn try_conv<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. 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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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