Struct grin_api::auth::GRIN_BASIC_REALM

source ·
pub struct GRIN_BASIC_REALM { /* private fields */ }

Methods from Deref<Target = HeaderValue>§

source

pub fn to_str(&self) -> Result<&str, ToStrError>

Yields a &str slice if the HeaderValue only contains visible ASCII chars.

This function will perform a scan of the header value, checking all the characters.

§Examples
let val = HeaderValue::from_static("hello");
assert_eq!(val.to_str().unwrap(), "hello");
source

pub fn len(&self) -> usize

Returns the length of self.

This length is in bytes.

§Examples
let val = HeaderValue::from_static("hello");
assert_eq!(val.len(), 5);
source

pub fn is_empty(&self) -> bool

Returns true if the HeaderValue has a length of zero bytes.

§Examples
let val = HeaderValue::from_static("");
assert!(val.is_empty());

let val = HeaderValue::from_static("hello");
assert!(!val.is_empty());
source

pub fn as_bytes(&self) -> &[u8]

Converts a HeaderValue to a byte slice.

§Examples
let val = HeaderValue::from_static("hello");
assert_eq!(val.as_bytes(), b"hello");
source

pub fn is_sensitive(&self) -> bool

Returns true if the value represents sensitive data.

Sensitive data could represent passwords or other data that should not be stored on disk or in memory. By marking header values as sensitive, components using this crate can be instructed to treat them with special care for security reasons. For example, caches can avoid storing sensitive values, and HPACK encoders used by HTTP/2.0 implementations can choose not to compress them.

Additionally, sensitive values will be masked by the Debug implementation of HeaderValue.

Note that sensitivity is not factored into equality or ordering.

§Examples
let mut val = HeaderValue::from_static("my secret");

val.set_sensitive(true);
assert!(val.is_sensitive());

val.set_sensitive(false);
assert!(!val.is_sensitive());

Trait Implementations§

source§

impl Deref for GRIN_BASIC_REALM

§

type Target = HeaderValue

The resulting type after dereferencing.
source§

fn deref(&self) -> &HeaderValue

Dereferences the value.
source§

impl LazyStatic for GRIN_BASIC_REALM

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> 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> 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> SafeBorrow<T> for T
where T: ?Sized,

source§

fn borrow_replacement(ptr: &T) -> &T

Given ptr, which was obtained from a prior call to Self::borrow(), return a value with the same nominal lifetime which is guaranteed to survive mutations to Self. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
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.
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
source§

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