Struct drawbridge::bytes::Bytes

source ·
pub struct Bytes<T, C = Standard>(/* private fields */);
Expand description

A wrapper for bytes which provides base64 encoding in string contexts

Implementations§

source§

impl<T, C> Bytes<T, C>

source

pub fn into_inner(self) -> T

Consumes the outer type, returning the inner type

Trait Implementations§

source§

impl<T, U, C> AsMut<U> for Bytes<T, C>
where T: AsMut<U>, U: ?Sized,

source§

fn as_mut(&mut self) -> &mut U

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<T, U, C> AsRef<U> for Bytes<T, C>
where T: AsRef<U>, U: ?Sized,

source§

fn as_ref(&self) -> &U

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<T, C> Clone for Bytes<T, C>
where T: Clone, C: Clone,

source§

fn clone(&self) -> Bytes<T, C>

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl<T, C> Debug for Bytes<T, C>
where T: Debug,

source§

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

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

impl<T, C> Default for Bytes<T, C>
where T: Default,

source§

fn default() -> Bytes<T, C>

Returns the “default value” for a type. Read more
source§

impl<T, C> Deref for Bytes<T, C>

§

type Target = T

The resulting type after dereferencing.
source§

fn deref(&self) -> &<Bytes<T, C> as Deref>::Target

Dereferences the value.
source§

impl<T, C> DerefMut for Bytes<T, C>

source§

fn deref_mut(&mut self) -> &mut <Bytes<T, C> as Deref>::Target

Mutably dereferences the value.
source§

impl<'de, T, C> Deserialize<'de> for Bytes<T, C>
where T: From<Vec<u8>>, C: Config,

source§

fn deserialize<D>( deserializer: D ) -> Result<Bytes<T, C>, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<T, C> Display for Bytes<T, C>
where T: AsRef<[u8]>, C: Config,

source§

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

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

impl<T, C> From<T> for Bytes<T, C>

source§

fn from(value: T) -> Bytes<T, C>

Converts to this type from the input type.
source§

impl<T, C> FromStr for Bytes<T, C>
where T: From<Vec<u8>>, C: Config,

§

type Err = DecodeError

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Bytes<T, C>, <Bytes<T, C> as FromStr>::Err>

Parses a string s to return a value of this type. Read more
source§

impl<T, C> Hash for Bytes<T, C>
where T: Hash, C: Hash,

source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<T, C> Ord for Bytes<T, C>
where T: Ord, C: Ord,

source§

fn cmp(&self, other: &Bytes<T, C>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl<T, C> PartialEq for Bytes<T, C>
where T: PartialEq, C: PartialEq,

source§

fn eq(&self, other: &Bytes<T, C>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T, C> PartialOrd for Bytes<T, C>
where T: PartialOrd, C: PartialOrd,

source§

fn partial_cmp(&self, other: &Bytes<T, C>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

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

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

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

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<T, C> Serialize for Bytes<T, C>
where T: AsRef<[u8]>, C: Config,

source§

fn serialize<S>( &self, serializer: S ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<T, C> Eq for Bytes<T, C>
where T: Eq, C: Eq,

source§

impl<T, C> StructuralPartialEq for Bytes<T, C>

Auto Trait Implementations§

§

impl<T, C> Freeze for Bytes<T, C>
where T: Freeze,

§

impl<T, C> RefUnwindSafe for Bytes<T, C>

§

impl<T, C> Send for Bytes<T, C>
where T: Send, C: Send,

§

impl<T, C> Sync for Bytes<T, C>
where T: Sync, C: Sync,

§

impl<T, C> Unpin for Bytes<T, C>
where T: Unpin, C: Unpin,

§

impl<T, C> UnwindSafe for Bytes<T, C>
where T: UnwindSafe, C: 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> DynClone for T
where T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

source§

impl<T> From<!> for T

source§

fn from(t: !) -> T

Converts to this type from the input type.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> FromFd for T
where T: From<OwnedFd>,

source§

fn from_fd(owned_fd: OwnedFd) -> T

👎Deprecated since 1.0.0: FromFd::from_fd is replaced by From<OwnedFd>::from
Constructs a new instance of Self from the given file descriptor. Read more
source§

fn from_into_fd<Owned>(into_owned: Owned) -> Self
where Owned: Into<OwnedFd>, Self: Sized + From<OwnedFd>,

Constructs a new instance of Self from the given file descriptor converted from into_owned. Read more
source§

impl<T> FromFilelike for T
where T: From<OwnedFd>,

source§

fn from_filelike(owned: OwnedFd) -> T

Constructs a new instance of Self from the given filelike object. Read more
source§

fn from_into_filelike<Owned>(owned: Owned) -> T
where Owned: IntoFilelike,

Constructs a new instance of Self from the given filelike object converted from into_owned. Read more
source§

impl<T> FromSocketlike for T
where T: From<OwnedFd>,

source§

fn from_socketlike(owned: OwnedFd) -> T

Constructs a new instance of Self from the given socketlike object.
source§

fn from_into_socketlike<Owned>(owned: Owned) -> T
where Owned: IntoSocketlike,

Constructs a new instance of Self from the given socketlike object converted from into_owned.
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

§

type Output = T

Should always be Self
source§

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

§

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§

default 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>,

§

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<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,