pub struct WithEncoding<T> {
pub encoding: &'static Encoding,
pub inner: T,
}Fields§
§encoding: &'static Encoding§inner: TImplementations§
Source§impl<T> WithEncoding<T>
impl<T> WithEncoding<T>
pub fn new(inner: T, encoding: &'static Encoding) -> Self
pub fn into_inner(self) -> T
Source§impl<'a> WithEncoding<ByteCow<'a>>
impl<'a> WithEncoding<ByteCow<'a>>
pub fn into_owned(self) -> WithEncoding<ByteString>
Source§impl WithEncoding<ByteString>
impl WithEncoding<ByteString>
pub fn codepage_to_unicode(&mut self)
Trait Implementations§
Source§impl<T: Clone> Clone for WithEncoding<T>
impl<T: Clone> Clone for WithEncoding<T>
Source§fn clone(&self) -> WithEncoding<T>
fn clone(&self) -> WithEncoding<T>
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 moreSource§impl<T: Debug> Debug for WithEncoding<T>
impl<T: Debug> Debug for WithEncoding<T>
Source§impl<T> Display for WithEncoding<T>where
T: RawString,
impl<T> Display for WithEncoding<T>where
T: RawString,
Source§impl<T> EncodedString for WithEncoding<T>where
T: RawString,
impl<T> EncodedString for WithEncoding<T>where
T: RawString,
Source§fn as_str(&self) -> Cow<'_, str>
fn as_str(&self) -> Cow<'_, str>
Returns this string recoded in UTF-8. Invalid characters will be replaced by REPLACEMENT_CHARACTER.
Source§fn to_encoding(&self, encoding: &'static Encoding) -> WithEncoding<ByteCow<'_>>
fn to_encoding(&self, encoding: &'static Encoding) -> WithEncoding<ByteCow<'_>>
Returns this string recoded in encoding. Invalid characters will be
replaced by REPLACEMENT_CHARACTER.
fn into_string(self) -> Stringwhere
Self: Sized,
fn as_encoded_byte_str(&self) -> WithEncoding<&ByteStr>
fn cloned(&self) -> WithEncoding<ByteString>
fn quoted(&self) -> Quoted<&Self>where
Self: Sized,
impl<T: Eq> Eq for WithEncoding<T>
Source§impl<T> Hash for WithEncoding<T>where
T: Hash,
impl<T> Hash for WithEncoding<T>where
T: Hash,
Source§impl<T> MutRawString for WithEncoding<T>where
T: MutRawString,
impl<T> MutRawString for WithEncoding<T>where
T: MutRawString,
Source§impl<T> Ord for WithEncoding<T>where
T: Ord,
impl<T> Ord for WithEncoding<T>where
T: Ord,
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl<T: PartialEq> PartialEq for WithEncoding<T>
impl<T: PartialEq> PartialEq for WithEncoding<T>
Source§impl<T> PartialOrd for WithEncoding<T>where
T: PartialOrd,
impl<T> PartialOrd for WithEncoding<T>where
T: PartialOrd,
Source§impl<T> RawString for WithEncoding<T>where
T: RawString,
impl<T> RawString for WithEncoding<T>where
T: RawString,
fn raw_string_bytes(&self) -> &[u8] ⓘ
Source§fn eq_ignore_trailing_spaces<R>(&self, other: &R) -> boolwhere
R: RawString,
fn eq_ignore_trailing_spaces<R>(&self, other: &R) -> boolwhere
R: RawString,
Compares this string and
other for equality, ignoring trailing ASCII
spaces in either string for the purpose of comparison. (This is
acceptable because we assume that the encoding is ASCII-compatible.) Read moreSource§fn is_resizable(&self, new_len: usize) -> bool
fn is_resizable(&self, new_len: usize) -> bool
Returns true if this raw string can be resized to
len bytes without
dropping non-space characters.fn is_empty(&self) -> bool
fn is_spaces(&self) -> bool
fn len(&self) -> usize
fn as_ref(&self) -> &ByteStr
fn without_trailing_spaces(&self) -> &ByteStr
fn as_encoded(&self, encoding: &'static Encoding) -> WithEncoding<&ByteStr>where
Self: Sized,
fn with_encoding(self, encoding: &'static Encoding) -> WithEncoding<Self>where
Self: Sized,
Source§impl<T> Serialize for WithEncoding<T>where
WithEncoding<T>: EncodedString,
impl<T> Serialize for WithEncoding<T>where
WithEncoding<T>: EncodedString,
impl<T: PartialEq> StructuralPartialEq for WithEncoding<T>
Auto Trait Implementations§
impl<T> Freeze for WithEncoding<T>where
T: Freeze,
impl<T> RefUnwindSafe for WithEncoding<T>where
T: RefUnwindSafe,
impl<T> Send for WithEncoding<T>where
T: Send,
impl<T> Sync for WithEncoding<T>where
T: Sync,
impl<T> Unpin for WithEncoding<T>where
T: Unpin,
impl<T> UnsafeUnpin for WithEncoding<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for WithEncoding<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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<T> CustomError for T
impl<T> CustomError for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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