pub struct MaybeInvalid<T>(/* private fields */);Available on crate feature
server only.Expand description
Extract a String or FastStr without checking.
This type can extract a String or FastStr like String::from_utf8_unchecked or
FastStr::from_vec_u8_unchecked. Note that extracting them is unsafe and users should assume
that the value is valid.
Implementations§
Source§impl MaybeInvalid<String>
impl MaybeInvalid<String>
Sourcepub unsafe fn assume_valid(self) -> String
pub unsafe fn assume_valid(self) -> String
Source§impl MaybeInvalid<FastStr>
impl MaybeInvalid<FastStr>
Sourcepub unsafe fn assume_valid(self) -> FastStr
pub unsafe fn assume_valid(self) -> FastStr
Trait Implementations§
Source§impl<T: Clone> Clone for MaybeInvalid<T>
impl<T: Clone> Clone for MaybeInvalid<T>
Source§fn clone(&self) -> MaybeInvalid<T>
fn clone(&self) -> MaybeInvalid<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Debug> Debug for MaybeInvalid<T>
impl<T: Debug> Debug for MaybeInvalid<T>
Source§impl<T: Default> Default for MaybeInvalid<T>
impl<T: Default> Default for MaybeInvalid<T>
Source§fn default() -> MaybeInvalid<T>
fn default() -> MaybeInvalid<T>
Returns the “default value” for a type. Read more
Source§impl<B, T> FromRequest<B> for MaybeInvalid<T>
impl<B, T> FromRequest<B> for MaybeInvalid<T>
Source§type Rejection = ExtractBodyError
type Rejection = ExtractBodyError
If the extractor fails, it will return this
Rejection type. Read moreSource§async fn from_request(
cx: &mut ServerContext,
parts: Parts,
body: B,
) -> Result<Self, Self::Rejection>
async fn from_request( cx: &mut ServerContext, parts: Parts, body: B, ) -> Result<Self, Self::Rejection>
Extract the type from request.
Auto Trait Implementations§
impl<T> Freeze for MaybeInvalid<T>
impl<T> RefUnwindSafe for MaybeInvalid<T>where
T: RefUnwindSafe,
impl<T> Send for MaybeInvalid<T>where
T: Send,
impl<T> Sync for MaybeInvalid<T>where
T: Sync,
impl<T> Unpin for MaybeInvalid<T>where
T: Unpin,
impl<T> UnwindSafe for MaybeInvalid<T>where
T: UnwindSafe,
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