Skip to main content

KeyStr

Struct KeyStr 

Source
pub struct KeyStr<'a, T> {
    pub str: &'a str,
    pub key: T,
}
Available on crate feature slices only.
Expand description

A pair of (string slice, key) returned by the RSplitWhile/ SplitWhile iterators.

Fields§

§str: &'a str

str_slice is a string slice for which all characters were mapped to key by a closure.

§key: T

The value that all the chars in the string slice were mapped to.

Implementations§

Source§

impl<'a, T> KeyStr<'a, T>

Source

pub fn into_pair(self) -> (T, &'a str)

Converts this into a key, string slice pair

Trait Implementations§

Source§

impl<'a, T: Clone> Clone for KeyStr<'a, T>

Source§

fn clone(&self) -> KeyStr<'a, T>

Returns a duplicate 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<'a, T: Debug> Debug for KeyStr<'a, T>

Source§

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

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

impl<'a, T: Ord> Ord for KeyStr<'a, T>

Source§

fn cmp(&self, other: &KeyStr<'a, T>) -> 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,

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

impl<'a, T: PartialEq> PartialEq for KeyStr<'a, T>

Source§

fn eq(&self, other: &KeyStr<'a, T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a, T: PartialOrd> PartialOrd for KeyStr<'a, T>

Source§

fn partial_cmp(&self, other: &KeyStr<'a, T>) -> 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

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

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

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<'a, T: Eq> Eq for KeyStr<'a, T>

Source§

impl<'a, T> StructuralPartialEq for KeyStr<'a, T>

Auto Trait Implementations§

§

impl<'a, T> Freeze for KeyStr<'a, T>
where T: Freeze,

§

impl<'a, T> RefUnwindSafe for KeyStr<'a, T>
where T: RefUnwindSafe,

§

impl<'a, T> Send for KeyStr<'a, T>
where T: Send,

§

impl<'a, T> Sync for KeyStr<'a, T>
where T: Sync,

§

impl<'a, T> Unpin for KeyStr<'a, T>
where T: Unpin,

§

impl<'a, T> UnsafeUnpin for KeyStr<'a, T>
where T: UnsafeUnpin,

§

impl<'a, T> UnwindSafe for KeyStr<'a, T>
where T: 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> AsPhantomData for T
where T: ?Sized,

Source§

fn as_phantom(&self) -> PhantomData<Self>

Available on crate feature phantom only.
Gets a PhantomData<Self>. Read more
Source§

fn as_phantom_covariant(&self) -> PhantomData<fn() -> Self>

Available on crate feature phantom only.
Gets a PhantomData<fn() -> Self>, a covariant PhantomData.
Source§

fn as_phantom_contra(&self) -> PhantomData<fn(Self)>

Available on crate feature phantom only.
Gets a PhantomData<fn(Self)>, a contravariant PhantomData.
Source§

fn as_phantom_invariant(&self) -> PhantomData<fn(Self) -> Self>

Available on crate feature phantom only.
Gets a PhantomData<fn(Self) -> Self>, an invariant PhantomData.
Source§

const PHANTOM: PhantomData<Self> = PhantomData

Available on crate feature phantom only.
Gets a PhantomData<Self>. Read more
Source§

const PHANTOM_COVARIANT: PhantomData<fn() -> Self> = PhantomData

Available on crate feature phantom only.
Constructs a PhantomData<fn() -> T>, a covariant PhantomData. Read more
Source§

const PHANTOM_CONTRA: PhantomData<fn(Self)> = PhantomData

Available on crate feature phantom only.
Gets a PhantomData<fn(Self)>, a contravariant PhantomData. Read more
Source§

const PHANTOM_INVARIANT: PhantomData<fn(Self) -> Self> = PhantomData

Available on crate feature phantom only.
Gets a PhantomData<fn(Self) -> Self>, an invariant PhantomData. 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> CallExt for T
where T: ?Sized,

Source§

fn ref_call<P>(&self, params: P) -> Self::Returns
where Self: CallRef<P>,

Available on crate feature callable only.
For calling CallRef::ref_call_, with the ability to specify the types of the arguments.. Read more
Source§

fn mut_call<P>(&mut self, params: P) -> Self::Returns
where Self: CallMut<P>,

Available on crate feature callable only.
For calling CallMut::mut_call_, with the ability to specify the types of the arguments.. Read more
Source§

fn into_call<P>(self, params: P) -> Self::Returns
where Self: Sized + CallInto<P>,

Available on crate feature callable only.
For calling CallInto::into_call_, with the ability to specify the types of the arguments.. Read more
Source§

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

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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

Source§

fn eq_id(&self, other: &Self) -> bool

Available on crate feature self_ops only.
Compares the address of self with the address of other. Read more
Source§

fn piped<F, U>(self, f: F) -> U
where F: FnOnce(Self) -> U, Self: Sized,

Available on crate feature self_ops only.
Emulates the pipeline operator, allowing method syntax in more places. Read more
Source§

fn piped_ref<'a, F, U>(&'a self, f: F) -> U
where F: FnOnce(&'a Self) -> U,

Available on crate feature self_ops only.
The same as piped except that the function takes &Self Useful for functions that take &Self instead of Self. Read more
Source§

fn piped_mut<'a, F, U>(&'a mut self, f: F) -> U
where F: FnOnce(&'a mut Self) -> U,

Available on crate feature self_ops only.
The same as piped, except that the function takes &mut Self. Useful for functions that take &mut Self instead of Self.
Source§

fn mutated<F>(self, f: F) -> Self
where F: FnOnce(&mut Self), Self: Sized,

Available on crate feature self_ops only.
Mutates self using a closure taking self by mutable reference, passing it along the method chain. Read more
Source§

fn observe<F>(self, f: F) -> Self
where F: FnOnce(&Self), Self: Sized,

Available on crate feature self_ops only.
Observes the value of self, passing it along unmodified. Useful in long method chains. Read more
Source§

fn into_<T>(self) -> T
where Self: Into<T>,

Available on crate feature self_ops only.
Performs a conversion with Into. using the turbofish .into_::<_>() syntax. Read more
Source§

fn as_ref_<T: ?Sized>(&self) -> &T
where Self: AsRef<T>,

Available on crate feature self_ops only.
Performs a reference to reference conversion with AsRef, using the turbofish .as_ref_::<_>() syntax. Read more
Source§

fn as_mut_<T: ?Sized>(&mut self) -> &mut T
where Self: AsMut<T>,

Available on crate feature self_ops only.
Performs a mutable reference to mutable reference conversion with AsMut, using the turbofish .as_mut_::<_>() syntax. Read more
Source§

fn drop_(self)
where Self: Sized,

Available on crate feature self_ops only.
Drops self using method notation. Alternative to std::mem::drop. Read more
Source§

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

Source§

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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

Source§

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

Source§

type Type = T

Available on crate feature type_identity only.
This is always Self.
Source§

fn into_type(self) -> Self::Type
where Self: Sized, Self::Type: Sized,

Available on crate feature type_identity only.
Converts a value back to the original type.
Source§

fn as_type(&self) -> &Self::Type

Available on crate feature type_identity only.
Converts a reference back to the original type.
Source§

fn as_type_mut(&mut self) -> &mut Self::Type

Available on crate feature type_identity only.
Converts a mutable reference back to the original type.
Source§

fn into_type_box(self: Box<Self>) -> Box<Self::Type>

Available on crate features type_identity and alloc only.
Converts a box back to the original type.
Source§

fn into_type_arc(self: Arc<Self>) -> Arc<Self::Type>

Available on crate features type_identity and alloc only.
Converts an Arc back to the original type. Read more
Source§

fn into_type_rc(self: Rc<Self>) -> Rc<Self::Type>

Available on crate features type_identity and alloc only.
Converts an Rc back to the original type. Read more
Source§

fn from_type(this: Self::Type) -> Self
where Self: Sized, Self::Type: Sized,

Available on crate feature type_identity only.
Converts a value back to the original type.
Source§

fn from_type_ref(this: &Self::Type) -> &Self

Available on crate feature type_identity only.
Converts a reference back to the original type.
Source§

fn from_type_mut(this: &mut Self::Type) -> &mut Self

Available on crate feature type_identity only.
Converts a mutable reference back to the original type.
Source§

fn from_type_box(this: Box<Self::Type>) -> Box<Self>

Available on crate features type_identity and alloc only.
Converts a box back to the original type.
Source§

fn from_type_arc(this: Arc<Self::Type>) -> Arc<Self>

Available on crate features type_identity and alloc only.
Converts an Arc back to the original type.
Source§

fn from_type_rc(this: Rc<Self::Type>) -> Rc<Self>

Available on crate features type_identity and alloc only.
Converts an Rc back to the original type.
Source§

impl<T> CloneBound for T
where T: ToOwned + ?Sized,