pub struct ValidationSchemaHeader<'a> { /* private fields */ }Expand description
Explicit validation-only schema override header.
Implementations§
Source§impl<'a> ValidationSchemaHeader<'a>
impl<'a> ValidationSchemaHeader<'a>
Sourcepub fn new(
name: &'a str,
version: SchemaVersion,
evidence: ReviewedSchemaMajor,
) -> Result<Self, SchemaVersionError>
pub fn new( name: &'a str, version: SchemaVersion, evidence: ReviewedSchemaMajor, ) -> Result<Self, SchemaVersionError>
Creates an override only when its major matches reviewed evidence.
Sourcepub const fn name(self) -> HeaderName<'a>
pub const fn name(self) -> HeaderName<'a>
Returns the validation-only header name.
Sourcepub const fn version(self) -> SchemaVersion
pub const fn version(self) -> SchemaVersion
Returns the exact reviewed schema version.
Sourcepub const fn evidence(self) -> ReviewedSchemaMajor
pub const fn evidence(self) -> ReviewedSchemaMajor
Returns the evidence binding used to admit this override.
Sourcepub fn with_validation_header<R>(
self,
scratch: &mut [u8],
inspect: impl FnOnce(RequestHeader<'_>) -> R,
) -> Result<R, SchemaVersionError>
pub fn with_validation_header<R>( self, scratch: &mut [u8], inspect: impl FnOnce(RequestHeader<'_>) -> R, ) -> Result<R, SchemaVersionError>
Builds the public validation header only for the duration of inspect.
This deliberately named method keeps the override out of default production request construction.
Trait Implementations§
Source§impl<'a> Clone for ValidationSchemaHeader<'a>
impl<'a> Clone for ValidationSchemaHeader<'a>
Source§fn clone(&self) -> ValidationSchemaHeader<'a>
fn clone(&self) -> ValidationSchemaHeader<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<'a> Copy for ValidationSchemaHeader<'a>
Source§impl<'a> Debug for ValidationSchemaHeader<'a>
impl<'a> Debug for ValidationSchemaHeader<'a>
impl<'a> Eq for ValidationSchemaHeader<'a>
Source§impl<'a> PartialEq for ValidationSchemaHeader<'a>
impl<'a> PartialEq for ValidationSchemaHeader<'a>
impl<'a> StructuralPartialEq for ValidationSchemaHeader<'a>
Auto Trait Implementations§
impl<'a> Freeze for ValidationSchemaHeader<'a>
impl<'a> RefUnwindSafe for ValidationSchemaHeader<'a>
impl<'a> Send for ValidationSchemaHeader<'a>
impl<'a> Sync for ValidationSchemaHeader<'a>
impl<'a> Unpin for ValidationSchemaHeader<'a>
impl<'a> UnsafeUnpin for ValidationSchemaHeader<'a>
impl<'a> UnwindSafe for ValidationSchemaHeader<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more