pub struct Chain<T> { /* private fields */ }
Implementations§
Source§impl<T, const N: usize> Chain<[T; N]>
impl<T, const N: usize> Chain<[T; N]>
Sourcepub fn as_slice(self, cb: impl FnOnce(&[T])) -> Chain<[T; N]>
pub fn as_slice(self, cb: impl FnOnce(&[T])) -> Chain<[T; N]>
See documentation for [slice::as_slice
] for more details on the underlying function.
Source§impl<'h, T, const N: usize> Chain<&'h mut [T; N]>
impl<'h, T, const N: usize> Chain<&'h mut [T; N]>
Sourcepub fn as_slice(self, cb: impl FnOnce(&[T])) -> Chain<&'h mut [T; N]>
pub fn as_slice(self, cb: impl FnOnce(&[T])) -> Chain<&'h mut [T; N]>
See documentation for [slice::as_slice
] for more details on the underlying function.
Source§impl Chain<String>
impl Chain<String>
Sourcepub fn clear(self) -> Chain<String>
pub fn clear(self) -> Chain<String>
See documentation for String::clear
for more details on the underlying function.
Sourcepub fn len(self, out: impl Output<usize>) -> Chain<String>
pub fn len(self, out: impl Output<usize>) -> Chain<String>
See documentation for String::len
for more details on the underlying function.
Sourcepub fn push(self, ch: char) -> Chain<String>
pub fn push(self, ch: char) -> Chain<String>
See documentation for String::push
for more details on the underlying function.
Sourcepub fn push_str(self, string: &str) -> Chain<String>
pub fn push_str(self, string: &str) -> Chain<String>
See documentation for String::push_str
for more details on the underlying function.
Sourcepub fn reserve(self, additional: usize) -> Chain<String>
pub fn reserve(self, additional: usize) -> Chain<String>
See documentation for String::reserve
for more details on the underlying function.
Sourcepub fn reserve_exact(self, additional: usize) -> Chain<String>
pub fn reserve_exact(self, additional: usize) -> Chain<String>
See documentation for String::reserve_exact
for more details on the underlying function.
Source§impl<'h> Chain<&'h mut String>
impl<'h> Chain<&'h mut String>
Sourcepub fn clear(self) -> Chain<&'h mut String>
pub fn clear(self) -> Chain<&'h mut String>
See documentation for String::clear
for more details on the underlying function.
Sourcepub fn len(self, out: impl Output<usize>) -> Chain<&'h mut String>
pub fn len(self, out: impl Output<usize>) -> Chain<&'h mut String>
See documentation for String::len
for more details on the underlying function.
Sourcepub fn push(self, ch: char) -> Chain<&'h mut String>
pub fn push(self, ch: char) -> Chain<&'h mut String>
See documentation for String::push
for more details on the underlying function.
Sourcepub fn push_str(self, string: &str) -> Chain<&'h mut String>
pub fn push_str(self, string: &str) -> Chain<&'h mut String>
See documentation for String::push_str
for more details on the underlying function.
Sourcepub fn reserve(self, additional: usize) -> Chain<&'h mut String>
pub fn reserve(self, additional: usize) -> Chain<&'h mut String>
See documentation for String::reserve
for more details on the underlying function.
Sourcepub fn reserve_exact(self, additional: usize) -> Chain<&'h mut String>
pub fn reserve_exact(self, additional: usize) -> Chain<&'h mut String>
See documentation for String::reserve_exact
for more details on the underlying function.
Source§impl<T> Chain<Vec<T>>
impl<T> Chain<Vec<T>>
Sourcepub unsafe fn align_to<U>(
self,
cb: impl FnOnce((&[T], &[U], &[T])),
) -> Chain<Vec<T>>
pub unsafe fn align_to<U>( self, cb: impl FnOnce((&[T], &[U], &[T])), ) -> Chain<Vec<T>>
§Safety
You must uphold safety invariants of [T]::align_to
.
See documentation for [T]::align_to
for more details on the underlying function.
Sourcepub unsafe fn align_to_mut<U>(
self,
cb: impl FnOnce((&mut [T], &mut [U], &mut [T])),
) -> Chain<Vec<T>>
pub unsafe fn align_to_mut<U>( self, cb: impl FnOnce((&mut [T], &mut [U], &mut [T])), ) -> Chain<Vec<T>>
§Safety
You must uphold safety invariants of [T]::align_to_mut
.
See documentation for [T]::align_to_mut
for more details on the underlying function.
Sourcepub fn append(
self,
other: &mut impl ChainConversions<Inner = Vec<T>>,
) -> Chain<Vec<T>>
pub fn append( self, other: &mut impl ChainConversions<Inner = Vec<T>>, ) -> Chain<Vec<T>>
See documentation for Vec::append
for more details on the underlying function.
Sourcepub fn binary_search(
self,
x: &T,
out: impl Output<Result<usize, usize>>,
) -> Chain<Vec<T>>where
T: Ord,
pub fn binary_search(
self,
x: &T,
out: impl Output<Result<usize, usize>>,
) -> Chain<Vec<T>>where
T: Ord,
See documentation for [T]::binary_search
for more details on the underlying function.
Sourcepub fn binary_search_by(
self,
f: impl FnMut(&T) -> Ordering,
out: impl Output<Result<usize, usize>>,
) -> Chain<Vec<T>>
pub fn binary_search_by( self, f: impl FnMut(&T) -> Ordering, out: impl Output<Result<usize, usize>>, ) -> Chain<Vec<T>>
See documentation for [T]::binary_search_by
for more details on the underlying function.
Sourcepub fn binary_search_by_key<B>(
self,
b: &B,
f: impl FnMut(&T) -> B,
out: impl Output<Result<usize, usize>>,
) -> Chain<Vec<T>>where
B: Ord,
pub fn binary_search_by_key<B>(
self,
b: &B,
f: impl FnMut(&T) -> B,
out: impl Output<Result<usize, usize>>,
) -> Chain<Vec<T>>where
B: Ord,
See documentation for [T]::binary_search_by_key
for more details on the underlying function.
Sourcepub fn capacity(self, out: impl Output<usize>) -> Chain<Vec<T>>
pub fn capacity(self, out: impl Output<usize>) -> Chain<Vec<T>>
See documentation for Vec::capacity
for more details on the underlying function.
Sourcepub fn clear(self) -> Chain<Vec<T>>
pub fn clear(self) -> Chain<Vec<T>>
See documentation for Vec::clear
for more details on the underlying function.
Sourcepub fn dedup(self) -> Chain<Vec<T>>where
T: PartialEq,
pub fn dedup(self) -> Chain<Vec<T>>where
T: PartialEq,
See documentation for Vec::dedup
for more details on the underlying function.
Sourcepub fn dedup_by(
self,
same_bucket: impl FnMut(&mut T, &mut T) -> bool,
) -> Chain<Vec<T>>
pub fn dedup_by( self, same_bucket: impl FnMut(&mut T, &mut T) -> bool, ) -> Chain<Vec<T>>
See documentation for Vec::dedup_by
for more details on the underlying function.
Sourcepub fn dedup_by_key<K>(self, key: impl FnMut(&mut T) -> K) -> Chain<Vec<T>>where
K: PartialEq,
pub fn dedup_by_key<K>(self, key: impl FnMut(&mut T) -> K) -> Chain<Vec<T>>where
K: PartialEq,
See documentation for Vec::dedup_by_key
for more details on the underlying function.
Sourcepub fn fill(self, value: T) -> Chain<Vec<T>>where
T: Clone,
pub fn fill(self, value: T) -> Chain<Vec<T>>where
T: Clone,
See documentation for [T]::fill
for more details on the underlying function.
Sourcepub fn fill_with(self, f: impl FnMut() -> T) -> Chain<Vec<T>>
pub fn fill_with(self, f: impl FnMut() -> T) -> Chain<Vec<T>>
See documentation for [T]::fill_with
for more details on the underlying function.
Sourcepub fn insert(self, index: usize, element: T) -> Chain<Vec<T>>
pub fn insert(self, index: usize, element: T) -> Chain<Vec<T>>
See documentation for Vec::insert
for more details on the underlying function.
Sourcepub fn is_empty(self, out: impl Output<bool>) -> Chain<Vec<T>>
pub fn is_empty(self, out: impl Output<bool>) -> Chain<Vec<T>>
See documentation for Vec::is_empty
for more details on the underlying function.
Sourcepub fn len(self, out: impl Output<usize>) -> Chain<Vec<T>>
pub fn len(self, out: impl Output<usize>) -> Chain<Vec<T>>
See documentation for Vec::len
for more details on the underlying function.
Sourcepub fn pop(self, out: impl Output<Option<T>>) -> Chain<Vec<T>>
pub fn pop(self, out: impl Output<Option<T>>) -> Chain<Vec<T>>
See documentation for Vec::pop
for more details on the underlying function.
Sourcepub fn push(self, value: T) -> Chain<Vec<T>>
pub fn push(self, value: T) -> Chain<Vec<T>>
See documentation for Vec::push
for more details on the underlying function.
Sourcepub fn remove(self, index: usize, out: impl Output<T>) -> Chain<Vec<T>>
pub fn remove(self, index: usize, out: impl Output<T>) -> Chain<Vec<T>>
See documentation for Vec::remove
for more details on the underlying function.
Sourcepub fn reserve(self, additional: usize) -> Chain<Vec<T>>
pub fn reserve(self, additional: usize) -> Chain<Vec<T>>
See documentation for Vec::reserve
for more details on the underlying function.
Sourcepub fn reserve_exact(self, additional: usize) -> Chain<Vec<T>>
pub fn reserve_exact(self, additional: usize) -> Chain<Vec<T>>
See documentation for Vec::reserve_exact
for more details on the underlying function.
Sourcepub fn resize(self, new_len: usize, value: T) -> Chain<Vec<T>>where
T: Clone,
pub fn resize(self, new_len: usize, value: T) -> Chain<Vec<T>>where
T: Clone,
See documentation for Vec::resize
for more details on the underlying function.
Sourcepub fn resize_with(self, new_len: usize, f: impl FnMut() -> T) -> Chain<Vec<T>>
pub fn resize_with(self, new_len: usize, f: impl FnMut() -> T) -> Chain<Vec<T>>
See documentation for Vec::resize_with
for more details on the underlying function.
Sourcepub fn retain(self, f: impl FnMut(&T) -> bool) -> Chain<Vec<T>>
pub fn retain(self, f: impl FnMut(&T) -> bool) -> Chain<Vec<T>>
See documentation for Vec::retain
for more details on the underlying function.
Sourcepub fn retain_mut(self, f: impl FnMut(&mut T) -> bool) -> Chain<Vec<T>>
pub fn retain_mut(self, f: impl FnMut(&mut T) -> bool) -> Chain<Vec<T>>
See documentation for Vec::retain_mut
for more details on the underlying function.
Sourcepub unsafe fn set_len(self, new_len: usize) -> Chain<Vec<T>>
pub unsafe fn set_len(self, new_len: usize) -> Chain<Vec<T>>
§Safety
You must uphold safety invariants of Vec::set_len
.
See documentation for Vec::set_len
for more details on the underlying function.
Sourcepub fn shrink_to(self, min_capacity: usize) -> Chain<Vec<T>>
pub fn shrink_to(self, min_capacity: usize) -> Chain<Vec<T>>
See documentation for Vec::shrink_to
for more details on the underlying function.
Sourcepub fn shrink_to_fit(self) -> Chain<Vec<T>>
pub fn shrink_to_fit(self) -> Chain<Vec<T>>
See documentation for Vec::shrink_to_fit
for more details on the underlying function.
Sourcepub fn sort(self) -> Chain<Vec<T>>where
T: Ord,
pub fn sort(self) -> Chain<Vec<T>>where
T: Ord,
See documentation for [T]::sort
for more details on the underlying function.
Sourcepub fn sort_by(self, compare: impl FnMut(&T, &T) -> Ordering) -> Chain<Vec<T>>
pub fn sort_by(self, compare: impl FnMut(&T, &T) -> Ordering) -> Chain<Vec<T>>
See documentation for [T]::sort_by
for more details on the underlying function.
Sourcepub fn sort_by_key<K>(self, f: impl FnMut(&T) -> K) -> Chain<Vec<T>>where
K: Ord,
pub fn sort_by_key<K>(self, f: impl FnMut(&T) -> K) -> Chain<Vec<T>>where
K: Ord,
See documentation for [T]::sort_by_key
for more details on the underlying function.
Sourcepub fn sort_by_cached_key<K>(self, f: impl FnMut(&T) -> K) -> Chain<Vec<T>>where
K: Ord,
pub fn sort_by_cached_key<K>(self, f: impl FnMut(&T) -> K) -> Chain<Vec<T>>where
K: Ord,
See documentation for [T]::sort_by_cached_key
for more details on the underlying function.
Sourcepub fn spare_capacity_mut(
self,
cb: impl FnOnce(&mut [MaybeUninit<T>]),
) -> Chain<Vec<T>>
pub fn spare_capacity_mut( self, cb: impl FnOnce(&mut [MaybeUninit<T>]), ) -> Chain<Vec<T>>
See documentation for Vec::spare_capacity_mut
for more details on the underlying function.
Source§impl<'h, T> Chain<&'h mut Vec<T>>
impl<'h, T> Chain<&'h mut Vec<T>>
Sourcepub unsafe fn align_to<U>(
self,
cb: impl FnOnce((&[T], &[U], &[T])),
) -> Chain<&'h mut Vec<T>>
pub unsafe fn align_to<U>( self, cb: impl FnOnce((&[T], &[U], &[T])), ) -> Chain<&'h mut Vec<T>>
§Safety
You must uphold safety invariants of [T]::align_to
.
See documentation for [T]::align_to
for more details on the underlying function.
Sourcepub unsafe fn align_to_mut<U>(
self,
cb: impl FnOnce((&mut [T], &mut [U], &mut [T])),
) -> Chain<&'h mut Vec<T>>
pub unsafe fn align_to_mut<U>( self, cb: impl FnOnce((&mut [T], &mut [U], &mut [T])), ) -> Chain<&'h mut Vec<T>>
§Safety
You must uphold safety invariants of [T]::align_to_mut
.
See documentation for [T]::align_to_mut
for more details on the underlying function.
Sourcepub fn append(
self,
other: &mut impl ChainConversions<Inner = Vec<T>>,
) -> Chain<&'h mut Vec<T>>
pub fn append( self, other: &mut impl ChainConversions<Inner = Vec<T>>, ) -> Chain<&'h mut Vec<T>>
See documentation for Vec::append
for more details on the underlying function.
Sourcepub fn binary_search(
self,
x: &T,
out: impl Output<Result<usize, usize>>,
) -> Chain<&'h mut Vec<T>>where
T: Ord,
pub fn binary_search(
self,
x: &T,
out: impl Output<Result<usize, usize>>,
) -> Chain<&'h mut Vec<T>>where
T: Ord,
See documentation for [T]::binary_search
for more details on the underlying function.
Sourcepub fn binary_search_by(
self,
f: impl FnMut(&T) -> Ordering,
out: impl Output<Result<usize, usize>>,
) -> Chain<&'h mut Vec<T>>
pub fn binary_search_by( self, f: impl FnMut(&T) -> Ordering, out: impl Output<Result<usize, usize>>, ) -> Chain<&'h mut Vec<T>>
See documentation for [T]::binary_search_by
for more details on the underlying function.
Sourcepub fn binary_search_by_key<B>(
self,
b: &B,
f: impl FnMut(&T) -> B,
out: impl Output<Result<usize, usize>>,
) -> Chain<&'h mut Vec<T>>where
B: Ord,
pub fn binary_search_by_key<B>(
self,
b: &B,
f: impl FnMut(&T) -> B,
out: impl Output<Result<usize, usize>>,
) -> Chain<&'h mut Vec<T>>where
B: Ord,
See documentation for [T]::binary_search_by_key
for more details on the underlying function.
Sourcepub fn capacity(self, out: impl Output<usize>) -> Chain<&'h mut Vec<T>>
pub fn capacity(self, out: impl Output<usize>) -> Chain<&'h mut Vec<T>>
See documentation for Vec::capacity
for more details on the underlying function.
Sourcepub fn clear(self) -> Chain<&'h mut Vec<T>>
pub fn clear(self) -> Chain<&'h mut Vec<T>>
See documentation for Vec::clear
for more details on the underlying function.
Sourcepub fn dedup(self) -> Chain<&'h mut Vec<T>>where
T: PartialEq,
pub fn dedup(self) -> Chain<&'h mut Vec<T>>where
T: PartialEq,
See documentation for Vec::dedup
for more details on the underlying function.
Sourcepub fn dedup_by(
self,
same_bucket: impl FnMut(&mut T, &mut T) -> bool,
) -> Chain<&'h mut Vec<T>>
pub fn dedup_by( self, same_bucket: impl FnMut(&mut T, &mut T) -> bool, ) -> Chain<&'h mut Vec<T>>
See documentation for Vec::dedup_by
for more details on the underlying function.
Sourcepub fn dedup_by_key<K>(
self,
key: impl FnMut(&mut T) -> K,
) -> Chain<&'h mut Vec<T>>where
K: PartialEq,
pub fn dedup_by_key<K>(
self,
key: impl FnMut(&mut T) -> K,
) -> Chain<&'h mut Vec<T>>where
K: PartialEq,
See documentation for Vec::dedup_by_key
for more details on the underlying function.
Sourcepub fn fill(self, value: T) -> Chain<&'h mut Vec<T>>where
T: Clone,
pub fn fill(self, value: T) -> Chain<&'h mut Vec<T>>where
T: Clone,
See documentation for [T]::fill
for more details on the underlying function.
Sourcepub fn fill_with(self, f: impl FnMut() -> T) -> Chain<&'h mut Vec<T>>
pub fn fill_with(self, f: impl FnMut() -> T) -> Chain<&'h mut Vec<T>>
See documentation for [T]::fill_with
for more details on the underlying function.
Sourcepub fn insert(self, index: usize, element: T) -> Chain<&'h mut Vec<T>>
pub fn insert(self, index: usize, element: T) -> Chain<&'h mut Vec<T>>
See documentation for Vec::insert
for more details on the underlying function.
Sourcepub fn is_empty(self, out: impl Output<bool>) -> Chain<&'h mut Vec<T>>
pub fn is_empty(self, out: impl Output<bool>) -> Chain<&'h mut Vec<T>>
See documentation for Vec::is_empty
for more details on the underlying function.
Sourcepub fn len(self, out: impl Output<usize>) -> Chain<&'h mut Vec<T>>
pub fn len(self, out: impl Output<usize>) -> Chain<&'h mut Vec<T>>
See documentation for Vec::len
for more details on the underlying function.
Sourcepub fn pop(self, out: impl Output<Option<T>>) -> Chain<&'h mut Vec<T>>
pub fn pop(self, out: impl Output<Option<T>>) -> Chain<&'h mut Vec<T>>
See documentation for Vec::pop
for more details on the underlying function.
Sourcepub fn push(self, value: T) -> Chain<&'h mut Vec<T>>
pub fn push(self, value: T) -> Chain<&'h mut Vec<T>>
See documentation for Vec::push
for more details on the underlying function.
Sourcepub fn remove(self, index: usize, out: impl Output<T>) -> Chain<&'h mut Vec<T>>
pub fn remove(self, index: usize, out: impl Output<T>) -> Chain<&'h mut Vec<T>>
See documentation for Vec::remove
for more details on the underlying function.
Sourcepub fn reserve(self, additional: usize) -> Chain<&'h mut Vec<T>>
pub fn reserve(self, additional: usize) -> Chain<&'h mut Vec<T>>
See documentation for Vec::reserve
for more details on the underlying function.
Sourcepub fn reserve_exact(self, additional: usize) -> Chain<&'h mut Vec<T>>
pub fn reserve_exact(self, additional: usize) -> Chain<&'h mut Vec<T>>
See documentation for Vec::reserve_exact
for more details on the underlying function.
Sourcepub fn resize(self, new_len: usize, value: T) -> Chain<&'h mut Vec<T>>where
T: Clone,
pub fn resize(self, new_len: usize, value: T) -> Chain<&'h mut Vec<T>>where
T: Clone,
See documentation for Vec::resize
for more details on the underlying function.
Sourcepub fn resize_with(
self,
new_len: usize,
f: impl FnMut() -> T,
) -> Chain<&'h mut Vec<T>>
pub fn resize_with( self, new_len: usize, f: impl FnMut() -> T, ) -> Chain<&'h mut Vec<T>>
See documentation for Vec::resize_with
for more details on the underlying function.
Sourcepub fn retain(self, f: impl FnMut(&T) -> bool) -> Chain<&'h mut Vec<T>>
pub fn retain(self, f: impl FnMut(&T) -> bool) -> Chain<&'h mut Vec<T>>
See documentation for Vec::retain
for more details on the underlying function.
Sourcepub fn retain_mut(self, f: impl FnMut(&mut T) -> bool) -> Chain<&'h mut Vec<T>>
pub fn retain_mut(self, f: impl FnMut(&mut T) -> bool) -> Chain<&'h mut Vec<T>>
See documentation for Vec::retain_mut
for more details on the underlying function.
Sourcepub unsafe fn set_len(self, new_len: usize) -> Chain<&'h mut Vec<T>>
pub unsafe fn set_len(self, new_len: usize) -> Chain<&'h mut Vec<T>>
§Safety
You must uphold safety invariants of Vec::set_len
.
See documentation for Vec::set_len
for more details on the underlying function.
Sourcepub fn shrink_to(self, min_capacity: usize) -> Chain<&'h mut Vec<T>>
pub fn shrink_to(self, min_capacity: usize) -> Chain<&'h mut Vec<T>>
See documentation for Vec::shrink_to
for more details on the underlying function.
Sourcepub fn shrink_to_fit(self) -> Chain<&'h mut Vec<T>>
pub fn shrink_to_fit(self) -> Chain<&'h mut Vec<T>>
See documentation for Vec::shrink_to_fit
for more details on the underlying function.
Sourcepub fn sort(self) -> Chain<&'h mut Vec<T>>where
T: Ord,
pub fn sort(self) -> Chain<&'h mut Vec<T>>where
T: Ord,
See documentation for [T]::sort
for more details on the underlying function.
Sourcepub fn sort_by(
self,
compare: impl FnMut(&T, &T) -> Ordering,
) -> Chain<&'h mut Vec<T>>
pub fn sort_by( self, compare: impl FnMut(&T, &T) -> Ordering, ) -> Chain<&'h mut Vec<T>>
See documentation for [T]::sort_by
for more details on the underlying function.
Sourcepub fn sort_by_key<K>(self, f: impl FnMut(&T) -> K) -> Chain<&'h mut Vec<T>>where
K: Ord,
pub fn sort_by_key<K>(self, f: impl FnMut(&T) -> K) -> Chain<&'h mut Vec<T>>where
K: Ord,
See documentation for [T]::sort_by_key
for more details on the underlying function.
Sourcepub fn sort_by_cached_key<K>(
self,
f: impl FnMut(&T) -> K,
) -> Chain<&'h mut Vec<T>>where
K: Ord,
pub fn sort_by_cached_key<K>(
self,
f: impl FnMut(&T) -> K,
) -> Chain<&'h mut Vec<T>>where
K: Ord,
See documentation for [T]::sort_by_cached_key
for more details on the underlying function.
Sourcepub fn spare_capacity_mut(
self,
cb: impl FnOnce(&mut [MaybeUninit<T>]),
) -> Chain<&'h mut Vec<T>>
pub fn spare_capacity_mut( self, cb: impl FnOnce(&mut [MaybeUninit<T>]), ) -> Chain<&'h mut Vec<T>>
See documentation for Vec::spare_capacity_mut
for more details on the underlying function.
Source§impl<T> Chain<T>
impl<T> Chain<T>
pub fn from_inner(inner: T) -> Chain<T>
pub fn into_inner(self) -> T
pub fn as_inner(&self) -> &T
pub fn as_inner_mut(&mut self) -> &mut T
Sourcepub fn with_inner(self, f: impl FnOnce(&mut T)) -> Chain<T>
pub fn with_inner(self, f: impl FnOnce(&mut T)) -> Chain<T>
Takes a closure that is called, passing in a reference to the inner value
This is useful for if there is something we have not implemented, or you otherwise need to borrow the inner struct for something, but are in the middle of some chain. It lets you do otherwise nonchainable operations inline with other chaining operations, so no need to break the chain c:
§Examples
let chain = VecChain::<usize>::new();
// let's pretend `push` and `reserve` don't already have chainable versions...
let chain = chain
.with_inner(|v| v.reserve(10))
.with_inner(|v| v.push(1))
.with_inner(|v| v.push(2));
assert!(chain.as_inner().len() == 2);
assert!(chain.as_inner().capacity() >= 10);