pub unsafe fn alloc(layout: Layout) -> *mut u8
Expand description
Allocates memory with the global allocator.
│ │ │ │ +pub unsafe fn alloc(layout: Layout) -> *mut u8
Expand description
Allocates memory with the global allocator.
│ │ │ │This function forwards calls to the GlobalAlloc::alloc
method
│ │ │ │ of the allocator registered with the #[global_allocator]
attribute
│ │ │ │ if there is one, or the std
crate’s default.
This function is expected to be deprecated in favor of the allocate
method
│ │ │ │ of the Global
type when it and the Allocator
trait become stable.
§Safety
│ │ │ │See GlobalAlloc::alloc
.
pub unsafe fn alloc_zeroed(layout: Layout) -> *mut u8
Expand description
Allocates zero-initialized memory with the global allocator.
│ │ │ │ +pub unsafe fn alloc_zeroed(layout: Layout) -> *mut u8
Expand description
Allocates zero-initialized memory with the global allocator.
│ │ │ │This function forwards calls to the GlobalAlloc::alloc_zeroed
method
│ │ │ │ of the allocator registered with the #[global_allocator]
attribute
│ │ │ │ if there is one, or the std
crate’s default.
This function is expected to be deprecated in favor of the allocate_zeroed
method
│ │ │ │ of the Global
type when it and the Allocator
trait become stable.
§Safety
│ │ │ │See GlobalAlloc::alloc_zeroed
.
pub unsafe fn dealloc(ptr: *mut u8, layout: Layout)
Expand description
Deallocates memory with the global allocator.
│ │ │ │ +pub unsafe fn dealloc(ptr: *mut u8, layout: Layout)
Expand description
Deallocates memory with the global allocator.
│ │ │ │This function forwards calls to the GlobalAlloc::dealloc
method
│ │ │ │ of the allocator registered with the #[global_allocator]
attribute
│ │ │ │ if there is one, or the std
crate’s default.
This function is expected to be deprecated in favor of the deallocate
method
│ │ │ │ of the Global
type when it and the Allocator
trait become stable.
§Safety
│ │ │ │See GlobalAlloc::dealloc
.
pub fn handle_alloc_error(layout: Layout) -> !
Expand description
Signals a memory allocation error.
│ │ │ │ +pub fn handle_alloc_error(layout: Layout) -> !
Expand description
Signals a memory allocation error.
│ │ │ │Callers of memory allocation APIs wishing to cease execution
│ │ │ │ in response to an allocation error are encouraged to call this function,
│ │ │ │ -rather than directly invoking panic!
or similar.
panic!
or similar.
│ │ │ │ This function is guaranteed to diverge (not return normally with a value), but depending on │ │ │ │ global configuration, it may either panic (resulting in unwinding or aborting as per │ │ │ │ configuration for all panics), or abort the process (with no unwinding).
│ │ │ │The default behavior is:
│ │ │ │-
│ │ │ │
-
│ │ │ │
If the binary links against
│ │ │ │std
(typically the case), then │ │ │ │ print a message to standard error and abort the process. │ │ │ │ This behavior can be replaced withset_alloc_error_hook
andtake_alloc_error_hook
. │ │ │ │ Future versions of Rust may panic by default instead.
│ │ │ │ -
│ │ │ │
If the binary does not link against
│ │ │ │std
(all of its crates are marked │ │ │ │ -#![no_std]
), then callpanic!
with a message. │ │ │ │ +#![no_std]
), then callpanic!
with a message. │ │ │ │ The panic handler applies as to any panic.
│ │ │ │
pub unsafe fn realloc(ptr: *mut u8, layout: Layout, new_size: usize) -> *mut u8
Expand description
Reallocates memory with the global allocator.
│ │ │ │ +pub unsafe fn realloc(ptr: *mut u8, layout: Layout, new_size: usize) -> *mut u8
Expand description
Reallocates memory with the global allocator.
│ │ │ │This function forwards calls to the GlobalAlloc::realloc
method
│ │ │ │ of the allocator registered with the #[global_allocator]
attribute
│ │ │ │ if there is one, or the std
crate’s default.
This function is expected to be deprecated in favor of the grow
and shrink
methods
│ │ │ │ of the Global
type when it and the Allocator
trait become stable.
§Safety
│ │ │ │See GlobalAlloc::realloc
.
pub struct AllocError;
allocator_api
#32838)Expand description
The AllocError
error indicates an allocation failure
│ │ │ │ +
pub struct AllocError;
allocator_api
#32838)Expand description
The AllocError
error indicates an allocation failure
│ │ │ │ that may be due to resource exhaustion or to
│ │ │ │ something wrong when combining the given input arguments with this
│ │ │ │ allocator.
Trait Implementations§
Source§impl Clone for AllocError
impl Clone for AllocError
Source§fn clone(&self) -> AllocError
fn clone(&self) -> AllocError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for AllocError
impl Debug for AllocError
Source§impl Display for AllocError
impl Display for AllocError
Source§impl Error for AllocError
impl Error for AllocError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl PartialEq for AllocError
impl PartialEq for AllocError
impl Copy for AllocError
impl Eq for AllocError
impl StructuralPartialEq for AllocError
Auto Trait Implementations§
impl Freeze for AllocError
impl RefUnwindSafe for AllocError
impl Send for AllocError
impl Sync for AllocError
impl Unpin for AllocError
impl UnwindSafe for AllocError
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
Source§impl<T> CloneToUninit for Twhere
│ │ │ │ - T: Clone,
impl<T> CloneToUninit for Twhere
│ │ │ │ - T: Clone,
Source§impl<T, U> Into<U> for Twhere
│ │ │ │ - U: From<T>,
impl<T, U> Into<U> for Twhere
│ │ │ │ - U: From<T>,
Trait Implementations§
Source§impl Clone for AllocError
impl Clone for AllocError
Source§fn clone(&self) -> AllocError
fn clone(&self) -> AllocError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for AllocError
impl Debug for AllocError
Source§impl Display for AllocError
impl Display for AllocError
Source§impl Error for AllocError
impl Error for AllocError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl PartialEq for AllocError
impl PartialEq for AllocError
impl Copy for AllocError
impl Eq for AllocError
impl StructuralPartialEq for AllocError
Auto Trait Implementations§
impl Freeze for AllocError
impl RefUnwindSafe for AllocError
impl Send for AllocError
impl Sync for AllocError
impl Unpin for AllocError
impl UnwindSafe for AllocError
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
Source§impl<T> CloneToUninit for Twhere
│ │ │ │ + T: Clone,
impl<T> CloneToUninit for Twhere
│ │ │ │ + T: Clone,
Source§fn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
pub struct Global;
allocator_api
#32838)Expand description
The global memory allocator.
│ │ │ │This type implements the Allocator
trait by forwarding calls
│ │ │ │ to the allocator registered with the #[global_allocator]
attribute
│ │ │ │ if there is one, or the std
crate’s default.
Note: while this type is unstable, the functionality it provides can be
│ │ │ │ accessed through the free functions in alloc
.
Trait Implementations§
Source§impl Allocator for Global
impl Allocator for Global
Source§fn allocate(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
fn allocate(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
allocator_api
#32838)Source§fn allocate_zeroed(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
fn allocate_zeroed(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
allocator_api
#32838)allocate
, but also ensures that the returned memory is zero-initialized. Read moreTrait Implementations§
Source§impl Allocator for Global
impl Allocator for Global
Source§fn allocate(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
fn allocate(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
allocator_api
#32838)Source§fn allocate_zeroed(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
fn allocate_zeroed(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
allocator_api
#32838)allocate
, but also ensures that the returned memory is zero-initialized. Read moreSource§unsafe fn deallocate(&self, ptr: NonNull<u8>, layout: Layout)
unsafe fn deallocate(&self, ptr: NonNull<u8>, layout: Layout)
allocator_api
#32838)ptr
. Read moreSource§unsafe fn grow(
│ │ │ │ &self,
│ │ │ │ - ptr: NonNull<u8>,
│ │ │ │ + ptr: NonNull<u8>,
│ │ │ │ old_layout: Layout,
│ │ │ │ new_layout: Layout,
│ │ │ │ -) -> Result<NonNull<[u8]>, AllocError>
unsafe fn grow( │ │ │ │ &self, │ │ │ │ - ptr: NonNull<u8>, │ │ │ │ + ptr: NonNull<u8>, │ │ │ │ old_layout: Layout, │ │ │ │ new_layout: Layout, │ │ │ │ -) -> Result<NonNull<[u8]>, AllocError>
allocator_api
#32838)Source§unsafe fn grow_zeroed(
│ │ │ │ +) -> Result<NonNull<[u8]>, AllocError>
unsafe fn grow_zeroed( │ │ │ │ +) -> Result<NonNull<[u8]>, AllocError>
allocator_api
#32838)Source§unsafe fn grow_zeroed(
│ │ │ │ &self,
│ │ │ │ - ptr: NonNull<u8>,
│ │ │ │ + ptr: NonNull<u8>,
│ │ │ │ old_layout: Layout,
│ │ │ │ new_layout: Layout,
│ │ │ │ -) -> Result<NonNull<[u8]>, AllocError>
unsafe fn grow_zeroed( │ │ │ │ &self, │ │ │ │ - ptr: NonNull<u8>, │ │ │ │ + ptr: NonNull<u8>, │ │ │ │ old_layout: Layout, │ │ │ │ new_layout: Layout, │ │ │ │ -) -> Result<NonNull<[u8]>, AllocError>
allocator_api
#32838)grow
, but also ensures that the new contents are set to zero before being
│ │ │ │ +) -> Result<NonNull<[u8]>, AllocError>allocator_api
#32838)grow
, but also ensures that the new contents are set to zero before being
│ │ │ │ returned. Read moreSource§unsafe fn shrink(
│ │ │ │ &self,
│ │ │ │ - ptr: NonNull<u8>,
│ │ │ │ + ptr: NonNull<u8>,
│ │ │ │ old_layout: Layout,
│ │ │ │ new_layout: Layout,
│ │ │ │ -) -> Result<NonNull<[u8]>, AllocError>
unsafe fn shrink( │ │ │ │ &self, │ │ │ │ - ptr: NonNull<u8>, │ │ │ │ + ptr: NonNull<u8>, │ │ │ │ old_layout: Layout, │ │ │ │ new_layout: Layout, │ │ │ │ -) -> Result<NonNull<[u8]>, AllocError>
allocator_api
#32838)impl Copy for Global
impl<T: ?Sized + Unsize<U>, U: ?Sized> DispatchFromDyn<Box<U>> for Box<T, Global>
Auto Trait Implementations§
impl Freeze for Global
impl RefUnwindSafe for Global
impl Send for Global
impl Sync for Global
impl Unpin for Global
impl UnwindSafe for Global
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
Source§impl<T> CloneToUninit for Twhere
│ │ │ │ - T: Clone,
impl<T> CloneToUninit for Twhere
│ │ │ │ - T: Clone,
Source§impl<T, U> Into<U> for Twhere
│ │ │ │ - U: From<T>,
impl<T, U> Into<U> for Twhere
│ │ │ │ - U: From<T>,
Source§fn into(self) -> U
fn into(self) -> U
impl Copy for Global
impl<T: ?Sized + Unsize<U>, U: ?Sized> DispatchFromDyn<Box<U>> for Box<T, Global>
Auto Trait Implementations§
impl Freeze for Global
impl RefUnwindSafe for Global
impl Send for Global
impl Sync for Global
impl Unpin for Global
impl UnwindSafe for Global
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
Source§impl<T> CloneToUninit for Twhere
│ │ │ │ + T: Clone,
impl<T> CloneToUninit for Twhere
│ │ │ │ + T: Clone,
Source§fn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
pub struct Layout { /* private fields */ }
Expand description
Layout of a block of memory.
│ │ │ │ +pub struct Layout { /* private fields */ }
Expand description
Layout of a block of memory.
│ │ │ │An instance of Layout
describes a particular layout of memory.
│ │ │ │ You build a Layout
up as an input to give to an allocator.
All layouts have an associated size and a power-of-two alignment. The size, when rounded up to
│ │ │ │ the nearest multiple of align
, does not overflow isize
(i.e., the rounded value will always be
│ │ │ │ less than or equal to isize::MAX
).
(Note that layouts are not required to have non-zero size,
│ │ │ │ even though GlobalAlloc
requires that all memory requests
│ │ │ │ be non-zero in size. A caller must either ensure that conditions
│ │ │ │ like this are met, use specific allocators with looser
│ │ │ │ requirements, or use the more lenient Allocator
interface.)
Implementations§
Source§impl Layout
impl Layout
1.28.0 (const: 1.50.0) · Sourcepub const fn from_size_align(
│ │ │ │ - size: usize,
│ │ │ │ - align: usize,
│ │ │ │ -) -> Result<Layout, LayoutError>
pub const fn from_size_align( │ │ │ │ - size: usize, │ │ │ │ - align: usize, │ │ │ │ -) -> Result<Layout, LayoutError>
Constructs a Layout
from a given size
and align
,
│ │ │ │ +
Implementations§
Source§impl Layout
impl Layout
1.28.0 (const: 1.50.0) · Sourcepub const fn from_size_align(
│ │ │ │ + size: usize,
│ │ │ │ + align: usize,
│ │ │ │ +) -> Result<Layout, LayoutError>
pub const fn from_size_align( │ │ │ │ + size: usize, │ │ │ │ + align: usize, │ │ │ │ +) -> Result<Layout, LayoutError>
Constructs a Layout
from a given size
and align
,
│ │ │ │ or returns LayoutError
if any of the following conditions
│ │ │ │ are not met:
-
│ │ │ │
-
│ │ │ │
│ │ │ │align
must not be zero,
│ │ │ │ - │ │ │ │ @@ -24,40 +24,40 @@ │ │ │ │ │ │ │ │
-
│ │ │ │
│ │ │ │size
, when rounded up to the nearest multiple ofalign
, │ │ │ │ must not overflowisize
(i.e., the rounded value must be │ │ │ │ less than or equal toisize::MAX
).
│ │ │ │
1.28.0 (const: 1.36.0) · Sourcepub const unsafe fn from_size_align_unchecked(
│ │ │ │ - size: usize,
│ │ │ │ - align: usize,
│ │ │ │ +
pub const unsafe fn from_size_align_unchecked( │ │ │ │ - size: usize, │ │ │ │ - align: usize, │ │ │ │ +
1.28.0 (const: 1.36.0) · Sourcepub const unsafe fn from_size_align_unchecked(
│ │ │ │ + size: usize,
│ │ │ │ + align: usize,
│ │ │ │ ) -> Layout
pub const unsafe fn from_size_align_unchecked( │ │ │ │ + size: usize, │ │ │ │ + align: usize, │ │ │ │ ) -> Layout
Creates a layout, bypassing all checks.
│ │ │ │§Safety
│ │ │ │This function is unsafe as it does not verify the preconditions from
│ │ │ │ Layout::from_size_align
.
1.28.0 (const: 1.50.0) · Sourcepub const fn size(&self) -> usize
pub const fn size(&self) -> usize
The minimum size in bytes for a memory block of this layout.
│ │ │ │ -1.28.0 (const: 1.50.0) · Sourcepub const fn align(&self) -> usize
pub const fn align(&self) -> usize
The minimum byte alignment for a memory block of this layout.
│ │ │ │ +1.28.0 (const: 1.50.0) · Sourcepub const fn size(&self) -> usize
pub const fn size(&self) -> usize
The minimum size in bytes for a memory block of this layout.
│ │ │ │ +1.28.0 (const: 1.50.0) · Sourcepub const fn align(&self) -> usize
pub const fn align(&self) -> usize
The minimum byte alignment for a memory block of this layout.
│ │ │ │The returned alignment is guaranteed to be a power of two.
│ │ │ │ -1.28.0 (const: 1.42.0) · Sourcepub const fn new<T>() -> Layout
pub const fn new<T>() -> Layout
Constructs a Layout
suitable for holding a value of type T
.
1.28.0 (const: 1.85.0) · Sourcepub const fn for_value<T>(t: &T) -> Layoutwhere
│ │ │ │ - T: ?Sized,
pub const fn for_value<T>(t: &T) -> Layoutwhere
│ │ │ │ - T: ?Sized,
Produces layout describing a record that could be used to │ │ │ │ +
1.28.0 (const: 1.42.0) · Sourcepub const fn new<T>() -> Layout
pub const fn new<T>() -> Layout
Constructs a Layout
suitable for holding a value of type T
.
1.28.0 (const: 1.85.0) · Sourcepub const fn for_value<T>(t: &T) -> Layoutwhere
│ │ │ │ + T: ?Sized,
pub const fn for_value<T>(t: &T) -> Layoutwhere
│ │ │ │ + T: ?Sized,
Produces layout describing a record that could be used to
│ │ │ │ allocate backing structure for T
(which could be a trait
│ │ │ │ or other unsized type like a slice).
Sourcepub const unsafe fn for_value_raw<T>(t: *const T) -> Layoutwhere
│ │ │ │ - T: ?Sized,
🔬This is a nightly-only experimental API. (layout_for_ptr
#69835)
pub const unsafe fn for_value_raw<T>(t: *const T) -> Layoutwhere
│ │ │ │ - T: ?Sized,
layout_for_ptr
#69835)Produces layout describing a record that could be used to │ │ │ │ +
Sourcepub const unsafe fn for_value_raw<T>(t: *const T) -> Layoutwhere
│ │ │ │ + T: ?Sized,
🔬This is a nightly-only experimental API. (layout_for_ptr
#69835)
pub const unsafe fn for_value_raw<T>(t: *const T) -> Layoutwhere
│ │ │ │ + T: ?Sized,
layout_for_ptr
#69835)Produces layout describing a record that could be used to
│ │ │ │ allocate backing structure for T
(which could be a trait
│ │ │ │ or other unsized type like a slice).
§Safety
│ │ │ │This function is only safe to call if the following conditions hold:
│ │ │ │-
│ │ │ │
- If
T
isSized
, this function is always safe to call.
│ │ │ │ - If the unsized tail of
T
is: │ │ │ │-
│ │ │ │ -
- a slice, then the length of the slice tail must be an initialized │ │ │ │ +
- a slice, then the length of the slice tail must be an initialized
│ │ │ │ integer, and the size of the entire value
│ │ │ │ (dynamic tail length + statically sized prefix) must fit in
isize
. │ │ │ │ For the special case where the dynamic tail length is 0, this function │ │ │ │ is safe to call.
│ │ │ │ - a trait object, then the vtable part of the pointer must point
│ │ │ │ to a valid vtable for the type
T
acquired by an unsizing coercion, │ │ │ │ and the size of the entire value │ │ │ │ @@ -66,48 +66,48 @@ │ │ │ │ call, but may panic or otherwise return the wrong value, as the │ │ │ │ extern type’s layout is not known. This is the same behavior as │ │ │ │Layout::for_value
on a reference to an extern type tail.
│ │ │ │ - otherwise, it is conservatively not allowed to call this function. │ │ │ │
│ │ │ │
Sourcepub const fn dangling(&self) -> NonNull<u8>
🔬This is a nightly-only experimental API. (alloc_layout_extra
#55724)
pub const fn dangling(&self) -> NonNull<u8>
alloc_layout_extra
#55724)Creates a NonNull
that is dangling, but well-aligned for this Layout.
Sourcepub const fn dangling(&self) -> NonNull<u8>
🔬This is a nightly-only experimental API. (alloc_layout_extra
#55724)
pub const fn dangling(&self) -> NonNull<u8>
alloc_layout_extra
#55724)Creates a NonNull
that is dangling, but well-aligned for this Layout.
Note that the pointer value may potentially represent a valid pointer, │ │ │ │ which means this must not be used as a “not yet initialized” │ │ │ │ sentinel value. Types that lazily allocate must track initialization by │ │ │ │ some other means.
│ │ │ │ -1.44.0 (const: 1.85.0) · Sourcepub const fn align_to(&self, align: usize) -> Result<Layout, LayoutError>
pub const fn align_to(&self, align: usize) -> Result<Layout, LayoutError>
Creates a layout describing the record that can hold a value │ │ │ │ +
1.44.0 (const: 1.85.0) · Sourcepub const fn align_to(&self, align: usize) -> Result<Layout, LayoutError>
pub const fn align_to(&self, align: usize) -> Result<Layout, LayoutError>
Creates a layout describing the record that can hold a value
│ │ │ │ of the same layout as self
, but that also is aligned to
│ │ │ │ alignment align
(measured in bytes).
If self
already meets the prescribed alignment, then returns
│ │ │ │ self
.
Note that this method does not add any padding to the overall
│ │ │ │ size, regardless of whether the returned layout has a different
│ │ │ │ alignment. In other words, if K
has size 16, K.align_to(32)
│ │ │ │ will still have size 16.
Returns an error if the combination of self.size()
and the given
│ │ │ │ align
violates the conditions listed in Layout::from_size_align
.
Sourcepub const fn padding_needed_for(&self, align: usize) -> usize
🔬This is a nightly-only experimental API. (alloc_layout_extra
#55724)
pub const fn padding_needed_for(&self, align: usize) -> usize
alloc_layout_extra
#55724)Returns the amount of padding we must insert after self
│ │ │ │ +
Sourcepub const fn padding_needed_for(&self, align: usize) -> usize
🔬This is a nightly-only experimental API. (alloc_layout_extra
#55724)
pub const fn padding_needed_for(&self, align: usize) -> usize
alloc_layout_extra
#55724)Returns the amount of padding we must insert after self
│ │ │ │ to ensure that the following address will satisfy align
│ │ │ │ (measured in bytes).
e.g., if self.size()
is 9, then self.padding_needed_for(4)
│ │ │ │ returns 3, because that is the minimum number of bytes of
│ │ │ │ padding required to get a 4-aligned address (assuming that the
│ │ │ │ corresponding memory block starts at a 4-aligned address).
The return value of this function has no meaning if align
is
│ │ │ │ not a power-of-two.
Note that the utility of the returned value requires align
│ │ │ │ to be less than or equal to the alignment of the starting
│ │ │ │ address for the whole allocated block of memory. One way to
│ │ │ │ satisfy this constraint is to ensure align <= self.align()
.
1.44.0 (const: 1.85.0) · Sourcepub const fn pad_to_align(&self) -> Layout
pub const fn pad_to_align(&self) -> Layout
Creates a layout by rounding the size of this layout up to a multiple │ │ │ │ +
1.44.0 (const: 1.85.0) · Sourcepub const fn pad_to_align(&self) -> Layout
pub const fn pad_to_align(&self) -> Layout
Creates a layout by rounding the size of this layout up to a multiple │ │ │ │ of the layout’s alignment.
│ │ │ │This is equivalent to adding the result of padding_needed_for
│ │ │ │ to the layout’s current size.
Sourcepub const fn repeat(&self, n: usize) -> Result<(Layout, usize), LayoutError>
🔬This is a nightly-only experimental API. (alloc_layout_extra
#55724)
pub const fn repeat(&self, n: usize) -> Result<(Layout, usize), LayoutError>
alloc_layout_extra
#55724)Creates a layout describing the record for n
instances of
│ │ │ │ +
Sourcepub const fn repeat(&self, n: usize) -> Result<(Layout, usize), LayoutError>
🔬This is a nightly-only experimental API. (alloc_layout_extra
#55724)
pub const fn repeat(&self, n: usize) -> Result<(Layout, usize), LayoutError>
alloc_layout_extra
#55724)Creates a layout describing the record for n
instances of
│ │ │ │ self
, with a suitable amount of padding between each to
│ │ │ │ ensure that each instance is given its requested size and
│ │ │ │ alignment. On success, returns (k, offs)
where k
is the
│ │ │ │ layout of the array and offs
is the distance between the start
│ │ │ │ of each element in the array.
(That distance between elements is sometimes known as “stride”.)
│ │ │ │On arithmetic overflow, returns LayoutError
.
1.44.0 (const: 1.85.0) · Sourcepub const fn extend(&self, next: Layout) -> Result<(Layout, usize), LayoutError>
pub const fn extend(&self, next: Layout) -> Result<(Layout, usize), LayoutError>
Creates a layout describing the record for self
followed by
│ │ │ │ +
1.44.0 (const: 1.85.0) · Sourcepub const fn extend(&self, next: Layout) -> Result<(Layout, usize), LayoutError>
pub const fn extend(&self, next: Layout) -> Result<(Layout, usize), LayoutError>
Creates a layout describing the record for self
followed by
│ │ │ │ next
, including any necessary padding to ensure that next
│ │ │ │ will be properly aligned, but no trailing padding.
In order to match C representation layout repr(C)
, you should
│ │ │ │ call pad_to_align
after extending the layout with all fields.
│ │ │ │ (There is no way to match the default Rust representation
│ │ │ │ layout repr(Rust)
, as it is unspecified.)
Note that the alignment of the resulting layout will be the maximum of │ │ │ │ @@ -149,42 +149,42 @@ │ │ │ │ let (new_layout, offset) = layout.extend(field)?; │ │ │ │ layout = new_layout; │ │ │ │ offsets.push(offset); │ │ │ │ } │ │ │ │ // Remember to finalize with `pad_to_align`! │ │ │ │ Ok((layout.pad_to_align(), offsets)) │ │ │ │ }
Sourcepub const fn repeat_packed(&self, n: usize) -> Result<Layout, LayoutError>
🔬This is a nightly-only experimental API. (alloc_layout_extra
#55724)
pub const fn repeat_packed(&self, n: usize) -> Result<Layout, LayoutError>
alloc_layout_extra
#55724)Creates a layout describing the record for n
instances of
│ │ │ │ +
Sourcepub const fn repeat_packed(&self, n: usize) -> Result<Layout, LayoutError>
🔬This is a nightly-only experimental API. (alloc_layout_extra
#55724)
pub const fn repeat_packed(&self, n: usize) -> Result<Layout, LayoutError>
alloc_layout_extra
#55724)Creates a layout describing the record for n
instances of
│ │ │ │ self
, with no padding between each instance.
Note that, unlike repeat
, repeat_packed
does not guarantee
│ │ │ │ that the repeated instances of self
will be properly
│ │ │ │ aligned, even if a given instance of self
is properly
│ │ │ │ aligned. In other words, if the layout returned by
│ │ │ │ repeat_packed
is used to allocate an array, it is not
│ │ │ │ guaranteed that all elements in the array will be properly
│ │ │ │ aligned.
On arithmetic overflow, returns LayoutError
.
Sourcepub const fn extend_packed(&self, next: Layout) -> Result<Layout, LayoutError>
🔬This is a nightly-only experimental API. (alloc_layout_extra
#55724)
pub const fn extend_packed(&self, next: Layout) -> Result<Layout, LayoutError>
alloc_layout_extra
#55724)Creates a layout describing the record for self
followed by
│ │ │ │ +
Sourcepub const fn extend_packed(&self, next: Layout) -> Result<Layout, LayoutError>
🔬This is a nightly-only experimental API. (alloc_layout_extra
#55724)
pub const fn extend_packed(&self, next: Layout) -> Result<Layout, LayoutError>
alloc_layout_extra
#55724)Creates a layout describing the record for self
followed by
│ │ │ │ next
with no additional padding between the two. Since no
│ │ │ │ padding is inserted, the alignment of next
is irrelevant,
│ │ │ │ and is not incorporated at all into the resulting layout.
On arithmetic overflow, returns LayoutError
.
Trait Implementations§
impl Copy for Layout
impl Eq for Layout
impl StructuralPartialEq for Layout
Auto Trait Implementations§
impl Freeze for Layout
impl RefUnwindSafe for Layout
impl Send for Layout
impl Sync for Layout
impl Unpin for Layout
impl UnwindSafe for Layout
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
Source§impl<T> CloneToUninit for Twhere
│ │ │ │ - T: Clone,
impl<T> CloneToUninit for Twhere
│ │ │ │ - T: Clone,
Trait Implementations§
impl Copy for Layout
impl Eq for Layout
impl StructuralPartialEq for Layout
Auto Trait Implementations§
impl Freeze for Layout
impl RefUnwindSafe for Layout
impl Send for Layout
impl Sync for Layout
impl Unpin for Layout
impl UnwindSafe for Layout
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
Source§impl<T> CloneToUninit for Twhere
│ │ │ │ + T: Clone,
impl<T> CloneToUninit for Twhere
│ │ │ │ + T: Clone,
Source§fn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
#[non_exhaustive]pub struct LayoutError;
Expand description
The LayoutError
is returned when the parameters given
│ │ │ │ +
#[non_exhaustive]pub struct LayoutError;
Expand description
The LayoutError
is returned when the parameters given
│ │ │ │ to Layout::from_size_align
│ │ │ │ or some other Layout
constructor
│ │ │ │ do not satisfy its documented constraints.
Trait Implementations§
1.50.0 · Source§impl Clone for LayoutError
impl Clone for LayoutError
Source§fn clone(&self) -> LayoutError
fn clone(&self) -> LayoutError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more1.50.0 · Source§impl Debug for LayoutError
impl Debug for LayoutError
1.28.0 · Source§impl Display for LayoutError
impl Display for LayoutError
1.28.0 · Source§impl Error for LayoutError
impl Error for LayoutError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl From<LayoutError> for TryReserveErrorKind
impl From<LayoutError> for TryReserveErrorKind
Source§fn from(_: LayoutError) -> Self
fn from(_: LayoutError) -> Self
Always evaluates to TryReserveErrorKind::CapacityOverflow
.
1.50.0 · Source§impl PartialEq for LayoutError
impl PartialEq for LayoutError
impl Eq for LayoutError
impl StructuralPartialEq for LayoutError
Auto Trait Implementations§
impl Freeze for LayoutError
impl RefUnwindSafe for LayoutError
impl Send for LayoutError
impl Sync for LayoutError
impl Unpin for LayoutError
impl UnwindSafe for LayoutError
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
Source§impl<T> CloneToUninit for Twhere
│ │ │ │ - T: Clone,
impl<T> CloneToUninit for Twhere
│ │ │ │ - T: Clone,
Source§impl<T, U> Into<U> for Twhere
│ │ │ │ - U: From<T>,
impl<T, U> Into<U> for Twhere
│ │ │ │ - U: From<T>,
Trait Implementations§
1.50.0 · Source§impl Clone for LayoutError
impl Clone for LayoutError
Source§fn clone(&self) -> LayoutError
fn clone(&self) -> LayoutError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more1.50.0 · Source§impl Debug for LayoutError
impl Debug for LayoutError
1.28.0 · Source§impl Display for LayoutError
impl Display for LayoutError
1.28.0 · Source§impl Error for LayoutError
impl Error for LayoutError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl From<LayoutError> for TryReserveErrorKind
impl From<LayoutError> for TryReserveErrorKind
Source§fn from(_: LayoutError) -> Self
fn from(_: LayoutError) -> Self
Always evaluates to TryReserveErrorKind::CapacityOverflow
.
1.50.0 · Source§impl PartialEq for LayoutError
impl PartialEq for LayoutError
impl Eq for LayoutError
impl StructuralPartialEq for LayoutError
Auto Trait Implementations§
impl Freeze for LayoutError
impl RefUnwindSafe for LayoutError
impl Send for LayoutError
impl Sync for LayoutError
impl Unpin for LayoutError
impl UnwindSafe for LayoutError
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
Source§impl<T> CloneToUninit for Twhere
│ │ │ │ + T: Clone,
impl<T> CloneToUninit for Twhere
│ │ │ │ + T: Clone,
Source§fn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
pub unsafe trait Allocator {
│ │ │ │ +Allocator in alloc::alloc - Rust pub unsafe trait Allocator {
│ │ │ │ // Required methods
│ │ │ │ - fn allocate(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>;
│ │ │ │ - unsafe fn deallocate(&self, ptr: NonNull<u8>, layout: Layout);
│ │ │ │ + fn allocate(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>;
│ │ │ │ + unsafe fn deallocate(&self, ptr: NonNull<u8>, layout: Layout);
│ │ │ │
│ │ │ │ // Provided methods
│ │ │ │ fn allocate_zeroed(
│ │ │ │ &self,
│ │ │ │ layout: Layout,
│ │ │ │ - ) -> Result<NonNull<[u8]>, AllocError> { ... }
│ │ │ │ + ) -> Result<NonNull<[u8]>, AllocError> { ... }
│ │ │ │ unsafe fn grow(
│ │ │ │ &self,
│ │ │ │ - ptr: NonNull<u8>,
│ │ │ │ + ptr: NonNull<u8>,
│ │ │ │ old_layout: Layout,
│ │ │ │ new_layout: Layout,
│ │ │ │ - ) -> Result<NonNull<[u8]>, AllocError> { ... }
│ │ │ │ + ) -> Result<NonNull<[u8]>, AllocError> { ... }
│ │ │ │ unsafe fn grow_zeroed(
│ │ │ │ &self,
│ │ │ │ - ptr: NonNull<u8>,
│ │ │ │ + ptr: NonNull<u8>,
│ │ │ │ old_layout: Layout,
│ │ │ │ new_layout: Layout,
│ │ │ │ - ) -> Result<NonNull<[u8]>, AllocError> { ... }
│ │ │ │ + ) -> Result<NonNull<[u8]>, AllocError> { ... }
│ │ │ │ unsafe fn shrink(
│ │ │ │ &self,
│ │ │ │ - ptr: NonNull<u8>,
│ │ │ │ + ptr: NonNull<u8>,
│ │ │ │ old_layout: Layout,
│ │ │ │ new_layout: Layout,
│ │ │ │ - ) -> Result<NonNull<[u8]>, AllocError> { ... }
│ │ │ │ + ) -> Result<NonNull<[u8]>, AllocError> { ... }
│ │ │ │ fn by_ref(&self) -> &Self
│ │ │ │ - where Self: Sized { ... }
│ │ │ │ + where Self: Sized { ... }
│ │ │ │ }
🔬This is a nightly-only experimental API. (allocator_api
#32838)Expand description
An implementation of Allocator
can allocate, grow, shrink, and deallocate arbitrary blocks of
│ │ │ │ data described via Layout
.
│ │ │ │ Allocator
is designed to be implemented on ZSTs, references, or smart pointers because having
│ │ │ │ an allocator like MyAlloc([u8; N])
cannot be moved, without updating the pointers to the
│ │ │ │ allocated memory.
│ │ │ │ Unlike GlobalAlloc
, zero-sized allocations are allowed in Allocator
. If an underlying
│ │ │ │ allocator does not support this (like jemalloc) or return a null pointer (such as
│ │ │ │ @@ -83,16 +83,16 @@
│ │ │ │ allocator. A copied or cloned allocator must behave like the same allocator, and
│ │ │ │
│ │ │ │
│ │ │ │ any pointer to a memory block which is currently allocated may be passed to any other
│ │ │ │ method of the allocator.
│ │ │ │
│ │ │ │
│ │ │ │ -Required Methods§
Sourcefn allocate(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
🔬This is a nightly-only experimental API. (allocator_api
#32838)
Attempts to allocate a block of memory.
│ │ │ │ -On success, returns a NonNull<[u8]>
meeting the size and alignment guarantees of layout
.
│ │ │ │ +Required Methods§
Sourcefn allocate(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
🔬This is a nightly-only experimental API. (allocator_api
#32838)
Attempts to allocate a block of memory.
│ │ │ │ +On success, returns a NonNull<[u8]>
meeting the size and alignment guarantees of layout
.
│ │ │ │ The returned block may have a larger size than specified by layout.size()
, and may or may
│ │ │ │ not have its contents initialized.
│ │ │ │ The returned block of memory remains valid as long as it is [currently allocated] and the shorter of:
│ │ │ │
│ │ │ │ - the borrow-checker lifetime of the allocator type itself.
│ │ │ │ - as long as at the allocator and all its clones has not been dropped.
│ │ │ │
│ │ │ │ @@ -100,36 +100,36 @@
│ │ │ │ Returning Err
indicates that either memory is exhausted or layout
does not meet
│ │ │ │ allocator’s size or alignment constraints.
│ │ │ │ Implementations are encouraged to return Err
on memory exhaustion rather than panicking or
│ │ │ │ aborting, but this is not a strict requirement. (Specifically: it is legal to implement
│ │ │ │ this trait atop an underlying native allocation library that aborts on memory exhaustion.)
│ │ │ │ Clients wishing to abort computation in response to an allocation error are encouraged to
│ │ │ │ call the handle_alloc_error
function, rather than directly invoking panic!
or similar.
│ │ │ │ -Sourceunsafe fn deallocate(&self, ptr: NonNull<u8>, layout: Layout)
🔬This is a nightly-only experimental API. (allocator_api
#32838)
Deallocates the memory referenced by ptr
.
│ │ │ │ +Sourceunsafe fn deallocate(&self, ptr: NonNull<u8>, layout: Layout)
🔬This is a nightly-only experimental API. (allocator_api
#32838)
Deallocates the memory referenced by ptr
.
│ │ │ │ §Safety
│ │ │ │
│ │ │ │ ptr
must denote a block of memory currently allocated via this allocator, and
│ │ │ │ layout
must fit that block of memory.
│ │ │ │
│ │ │ │ -Provided Methods§
Sourcefn allocate_zeroed(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
🔬This is a nightly-only experimental API. (allocator_api
#32838)
Behaves like allocate
, but also ensures that the returned memory is zero-initialized.
│ │ │ │ +Provided Methods§
Sourcefn allocate_zeroed(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
🔬This is a nightly-only experimental API. (allocator_api
#32838)
Behaves like allocate
, but also ensures that the returned memory is zero-initialized.
│ │ │ │ §Errors
│ │ │ │ Returning Err
indicates that either memory is exhausted or layout
does not meet
│ │ │ │ allocator’s size or alignment constraints.
│ │ │ │ Implementations are encouraged to return Err
on memory exhaustion rather than panicking or
│ │ │ │ aborting, but this is not a strict requirement. (Specifically: it is legal to implement
│ │ │ │ this trait atop an underlying native allocation library that aborts on memory exhaustion.)
│ │ │ │ Clients wishing to abort computation in response to an allocation error are encouraged to
│ │ │ │ call the handle_alloc_error
function, rather than directly invoking panic!
or similar.
│ │ │ │ -Sourceunsafe fn grow(
│ │ │ │ &self,
│ │ │ │ - ptr: NonNull<u8>,
│ │ │ │ + ptr: NonNull<u8>,
│ │ │ │ old_layout: Layout,
│ │ │ │ new_layout: Layout,
│ │ │ │ -) -> Result<NonNull<[u8]>, AllocError>
🔬This is a nightly-only experimental API. (allocator_api
#32838)
Attempts to extend the memory block.
│ │ │ │ -Returns a new NonNull<[u8]>
containing a pointer and the actual size of the allocated
│ │ │ │ +) -> Result<NonNull<[u8]>, AllocError>🔬This is a nightly-only experimental API. (allocator_api
#32838)
Attempts to extend the memory block.
│ │ │ │ +Returns a new NonNull<[u8]>
containing a pointer and the actual size of the allocated
│ │ │ │ memory. The pointer is suitable for holding data described by new_layout
. To accomplish
│ │ │ │ this, the allocator may extend the allocation referenced by ptr
to fit the new layout.
│ │ │ │ If this returns Ok
, then ownership of the memory block referenced by ptr
has been
│ │ │ │ transferred to this allocator. Any access to the old ptr
is Undefined Behavior, even if the
│ │ │ │ allocation was grown in-place. The newly returned pointer is the only valid pointer
│ │ │ │ for accessing this memory now.
│ │ │ │ If this method returns Err
, then ownership of the memory block has not been transferred to
│ │ │ │ @@ -145,20 +145,20 @@
│ │ │ │
Returns Err
if the new layout does not meet the allocator’s size and alignment
│ │ │ │ constraints of the allocator, or if growing otherwise fails.
│ │ │ │ Implementations are encouraged to return Err
on memory exhaustion rather than panicking or
│ │ │ │ aborting, but this is not a strict requirement. (Specifically: it is legal to implement
│ │ │ │ this trait atop an underlying native allocation library that aborts on memory exhaustion.)
│ │ │ │ Clients wishing to abort computation in response to an allocation error are encouraged to
│ │ │ │ call the handle_alloc_error
function, rather than directly invoking panic!
or similar.
│ │ │ │ -Sourceunsafe fn grow_zeroed(
│ │ │ │ +
Sourceunsafe fn grow_zeroed(
│ │ │ │ &self,
│ │ │ │ - ptr: NonNull<u8>,
│ │ │ │ + ptr: NonNull<u8>,
│ │ │ │ old_layout: Layout,
│ │ │ │ new_layout: Layout,
│ │ │ │ -) -> Result<NonNull<[u8]>, AllocError>
🔬This is a nightly-only experimental API. (allocator_api
#32838)
Behaves like grow
, but also ensures that the new contents are set to zero before being
│ │ │ │ +) -> Result<NonNull<[u8]>, AllocError>🔬This is a nightly-only experimental API. (allocator_api
#32838)
Behaves like grow
, but also ensures that the new contents are set to zero before being
│ │ │ │ returned.
│ │ │ │ The memory block will contain the following contents after a successful call to
│ │ │ │ grow_zeroed
:
│ │ │ │
│ │ │ │ - Bytes
0..old_layout.size()
are preserved from the original allocation.
│ │ │ │ - Bytes
old_layout.size()..old_size
will either be preserved or zeroed, depending on
│ │ │ │ the allocator implementation. old_size
refers to the size of the memory block prior
│ │ │ │ @@ -178,21 +178,21 @@
│ │ │ │ Returns Err
if the new layout does not meet the allocator’s size and alignment
│ │ │ │ constraints of the allocator, or if growing otherwise fails.
│ │ │ │ Implementations are encouraged to return Err
on memory exhaustion rather than panicking or
│ │ │ │ aborting, but this is not a strict requirement. (Specifically: it is legal to implement
│ │ │ │ this trait atop an underlying native allocation library that aborts on memory exhaustion.)
│ │ │ │ Clients wishing to abort computation in response to an allocation error are encouraged to
│ │ │ │ call the handle_alloc_error
function, rather than directly invoking panic!
or similar.
│ │ │ │ -
Sourceunsafe fn shrink(
│ │ │ │ &self,
│ │ │ │ - ptr: NonNull<u8>,
│ │ │ │ + ptr: NonNull<u8>,
│ │ │ │ old_layout: Layout,
│ │ │ │ new_layout: Layout,
│ │ │ │ -) -> Result<NonNull<[u8]>, AllocError>
🔬This is a nightly-only experimental API. (allocator_api
#32838)
Attempts to shrink the memory block.
│ │ │ │ -Returns a new NonNull<[u8]>
containing a pointer and the actual size of the allocated
│ │ │ │ +) -> Result<NonNull<[u8]>, AllocError>🔬This is a nightly-only experimental API. (allocator_api
#32838)
Attempts to shrink the memory block.
│ │ │ │ +Returns a new NonNull<[u8]>
containing a pointer and the actual size of the allocated
│ │ │ │ memory. The pointer is suitable for holding data described by new_layout
. To accomplish
│ │ │ │ this, the allocator may shrink the allocation referenced by ptr
to fit the new layout.
│ │ │ │ If this returns Ok
, then ownership of the memory block referenced by ptr
has been
│ │ │ │ transferred to this allocator. Any access to the old ptr
is Undefined Behavior, even if the
│ │ │ │ allocation was shrunk in-place. The newly returned pointer is the only valid pointer
│ │ │ │ for accessing this memory now.
│ │ │ │ If this method returns Err
, then ownership of the memory block has not been transferred to
│ │ │ │ @@ -208,12 +208,12 @@
│ │ │ │
Returns Err
if the new layout does not meet the allocator’s size and alignment
│ │ │ │ constraints of the allocator, or if shrinking otherwise fails.
│ │ │ │ Implementations are encouraged to return Err
on memory exhaustion rather than panicking or
│ │ │ │ aborting, but this is not a strict requirement. (Specifically: it is legal to implement
│ │ │ │ this trait atop an underlying native allocation library that aborts on memory exhaustion.)
│ │ │ │ Clients wishing to abort computation in response to an allocation error are encouraged to
│ │ │ │ call the handle_alloc_error
function, rather than directly invoking panic!
or similar.
│ │ │ │ -Implementors§
│ │ │ │ +
Implementors§
pub unsafe trait GlobalAlloc {
│ │ │ │ +GlobalAlloc in alloc::alloc - Rust pub unsafe trait GlobalAlloc {
│ │ │ │ // Required methods
│ │ │ │ - unsafe fn alloc(&self, layout: Layout) -> *mut u8;
│ │ │ │ - unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout);
│ │ │ │ + unsafe fn alloc(&self, layout: Layout) -> *mut u8;
│ │ │ │ + unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout);
│ │ │ │
│ │ │ │ // Provided methods
│ │ │ │ - unsafe fn alloc_zeroed(&self, layout: Layout) -> *mut u8 { ... }
│ │ │ │ + unsafe fn alloc_zeroed(&self, layout: Layout) -> *mut u8 { ... }
│ │ │ │ unsafe fn realloc(
│ │ │ │ &self,
│ │ │ │ - ptr: *mut u8,
│ │ │ │ + ptr: *mut u8,
│ │ │ │ layout: Layout,
│ │ │ │ - new_size: usize,
│ │ │ │ - ) -> *mut u8 { ... }
│ │ │ │ + new_size: usize,
│ │ │ │ + ) -> *mut u8 { ... }
│ │ │ │ }
Expand description
A memory allocator that can be registered as the standard library’s default
│ │ │ │ through the #[global_allocator]
attribute.
│ │ │ │ Some of the methods require that a memory block be currently
│ │ │ │ allocated via an allocator. This means that:
│ │ │ │
│ │ │ │ -
│ │ │ │
the starting address for that memory block was previously
│ │ │ │ @@ -119,15 +119,15 @@
│ │ │ │ optimization that can be applied. You may generally not rely on heap allocations
│ │ │ │ happening if they can be removed without changing program behavior.
│ │ │ │ Whether allocations happen or not is not part of the program behavior, even if it
│ │ │ │ could be detected via an allocator that tracks allocations by printing or otherwise
│ │ │ │ having side effects.
│ │ │ │
│ │ │ │
│ │ │ │ -Required Methods§
1.28.0 · Sourceunsafe fn alloc(&self, layout: Layout) -> *mut u8
Allocates memory as described by the given layout
.
│ │ │ │ +Required Methods§
1.28.0 · Sourceunsafe fn alloc(&self, layout: Layout) -> *mut u8
Allocates memory as described by the given layout
.
│ │ │ │ Returns a pointer to newly-allocated memory,
│ │ │ │ or null to indicate allocation failure.
│ │ │ │ §Safety
│ │ │ │ layout
must have non-zero size. Attempting to allocate for a zero-sized layout
may
│ │ │ │ result in undefined behavior.
│ │ │ │ (Extension subtraits might provide more specific bounds on
│ │ │ │ behavior, e.g., guarantee a sentinel address or a null pointer
│ │ │ │ @@ -140,46 +140,46 @@
│ │ │ │ exhaustion rather than aborting, but this is not
│ │ │ │ a strict requirement. (Specifically: it is legal to
│ │ │ │ implement this trait atop an underlying native allocation
│ │ │ │ library that aborts on memory exhaustion.)
│ │ │ │ Clients wishing to abort computation in response to an
│ │ │ │ allocation error are encouraged to call the handle_alloc_error
function,
│ │ │ │ rather than directly invoking panic!
or similar.
│ │ │ │ -1.28.0 · Sourceunsafe fn dealloc(&self, ptr: *mut u8, layout: Layout)
Deallocates the block of memory at the given ptr
pointer with the given layout
.
│ │ │ │ +1.28.0 · Sourceunsafe fn dealloc(&self, ptr: *mut u8, layout: Layout)
Deallocates the block of memory at the given ptr
pointer with the given layout
.
│ │ │ │ §Safety
│ │ │ │ The caller must ensure:
│ │ │ │
│ │ │ │ -
│ │ │ │
ptr
is a block of memory currently allocated via this allocator and,
│ │ │ │
│ │ │ │ -
│ │ │ │
layout
is the same layout that was used to allocate that block of
│ │ │ │ memory.
│ │ │ │
│ │ │ │
│ │ │ │ Otherwise undefined behavior can result.
│ │ │ │ -Provided Methods§
1.28.0 · Sourceunsafe fn alloc_zeroed(&self, layout: Layout) -> *mut u8
Behaves like alloc
, but also ensures that the contents
│ │ │ │ +
Provided Methods§
1.28.0 · Sourceunsafe fn alloc_zeroed(&self, layout: Layout) -> *mut u8
Behaves like alloc
, but also ensures that the contents
│ │ │ │ are set to zero before being returned.
│ │ │ │ §Safety
│ │ │ │ The caller has to ensure that layout
has non-zero size. Like alloc
│ │ │ │ zero sized layout
can result in undefined behavior.
│ │ │ │ However the allocated block of memory is guaranteed to be initialized.
│ │ │ │ §Errors
│ │ │ │ Returning a null pointer indicates that either memory is exhausted
│ │ │ │ or layout
does not meet allocator’s size or alignment constraints,
│ │ │ │ just as in alloc
.
│ │ │ │ Clients wishing to abort computation in response to an
│ │ │ │ allocation error are encouraged to call the handle_alloc_error
function,
│ │ │ │ rather than directly invoking panic!
or similar.
│ │ │ │ -1.28.0 · Sourceunsafe fn realloc(
│ │ │ │ &self,
│ │ │ │ - ptr: *mut u8,
│ │ │ │ + ptr: *mut u8,
│ │ │ │ layout: Layout,
│ │ │ │ - new_size: usize,
│ │ │ │ -) -> *mut u8
Shrinks or grows a block of memory to the given new_size
in bytes.
│ │ │ │ + new_size: usize,
│ │ │ │ +) -> *mut u8
Shrinks or grows a block of memory to the given new_size
in bytes.
│ │ │ │ The block is described by the given ptr
pointer and layout
.
│ │ │ │ If this returns a non-null pointer, then ownership of the memory block
│ │ │ │ referenced by ptr
has been transferred to this allocator.
│ │ │ │ Any access to the old ptr
is Undefined Behavior, even if the
│ │ │ │ allocation remained in-place. The newly returned pointer is the only valid pointer
│ │ │ │ for accessing this memory now.
│ │ │ │ The new memory block is allocated with layout
,
│ │ │ ├── ./usr/share/doc/rust-doc/html/alloc/alloc/type.LayoutErr.html
│ │ │ │ @@ -1 +1 @@
│ │ │ │ -
LayoutErr in alloc::alloc - Rust pub type LayoutErr = LayoutError;
👎Deprecated since 1.52.0: Name does not follow std convention, use LayoutErrorAliased Type§
struct LayoutErr;
│ │ │ │ +LayoutErr in alloc::alloc - Rust pub type LayoutErr = LayoutError;
👎Deprecated since 1.52.0: Name does not follow std convention, use LayoutErrorAliased Type§
struct LayoutErr;
│ │ │ ├── ./usr/share/doc/rust-doc/html/alloc/borrow/enum.Cow.html
│ │ │ │ @@ -1,10 +1,10 @@
│ │ │ │ Cow in alloc::borrow - Rust {
│ │ │ │ + Borrowed(&'a B),
│ │ │ │ Owned(<B as ToOwned>::Owned),
│ │ │ │ }Expand description
A clone-on-write smart pointer.
│ │ │ │ The type Cow
is a smart pointer providing clone-on-write functionality: it
│ │ │ │ can enclose and provide immutable access to borrowed data, and clone the
│ │ │ │ data lazily when mutation or ownership is required. The type is designed to
│ │ │ │ work with general borrowed data via the Borrow
trait.
│ │ │ │ Cow
implements Deref
, which means that you can call
│ │ │ │ @@ -69,27 +69,27 @@
│ │ │ │ println!("clone_on_write = {:?}", clone_on_write.values);
│ │ │ │
│ │ │ │ // The data was mutated. Let's check it out.
│ │ │ │ match clone_on_write {
│ │ │ │ Items { values: Cow::Owned(_) } => println!("clone_on_write contains owned data"),
│ │ │ │ _ => panic!("expect owned data"),
│ │ │ │ }
│ │ │ │ - Variants§
§1.36.0Borrowed(&'a B)
Borrowed data.
│ │ │ │ +Variants§
§1.36.0Borrowed(&'a B)
Borrowed data.
│ │ │ │ §1.36.0Owned(<B as ToOwned>::Owned)
Owned data.
│ │ │ │ -Implementations§
Source§impl<B: ?Sized + ToOwned> Cow<'_, B>
Sourcepub const fn is_borrowed(&self) -> bool
🔬This is a nightly-only experimental API. (cow_is_borrowed
#65143)
Returns true if the data is borrowed, i.e. if to_mut
would require additional work.
│ │ │ │ +Implementations§
Source§impl<B: ?Sized + ToOwned> Cow<'_, B>
Sourcepub const fn is_borrowed(&self) -> bool
🔬This is a nightly-only experimental API. (cow_is_borrowed
#65143)
Returns true if the data is borrowed, i.e. if to_mut
would require additional work.
│ │ │ │ §Examples
│ │ │ │
│ │ │ │ -Sourcepub const fn is_owned(&self) -> bool
🔬This is a nightly-only experimental API. (cow_is_borrowed
#65143)
Returns true if the data is owned, i.e. if to_mut
would be a no-op.
│ │ │ │ +Sourcepub const fn is_owned(&self) -> bool
🔬This is a nightly-only experimental API. (cow_is_borrowed
#65143)
Returns true if the data is owned, i.e. if to_mut
would be a no-op.
│ │ │ │ §Examples
│ │ │ │ #![feature(cow_is_borrowed)]
│ │ │ │ use std::borrow::Cow;
│ │ │ │
│ │ │ │ let cow: Cow<'_, str> = Cow::Owned("moo".to_string());
│ │ │ │ assert!(cow.is_owned());
│ │ │ │
│ │ │ │ @@ -129,181 +129,181 @@
│ │ │ │ let s = "Hello world!";
│ │ │ │ let cow: Cow<'_, str> = Cow::Owned(String::from(s));
│ │ │ │
│ │ │ │ assert_eq!(
│ │ │ │ cow.into_owned(),
│ │ │ │ String::from(s)
│ │ │ │ );
│ │ │ │ -Trait Implementations§
1.14.0 · Source§impl<'a> AddAssign<&'a str> for Cow<'a, str>
Source§fn add_assign(&mut self, rhs: &'a str)
Performs the +=
operation. Read more1.19.0 · Source§impl<'a> Extend<Cow<'a, str>> for String
Trait Implementations§
1.14.0 · Source§impl<'a> AddAssign<&'a str> for Cow<'a, str>
Source§fn add_assign(&mut self, rhs: &'a str)
Performs the +=
operation. Read more1.19.0 · Source§impl<'a> Extend<Cow<'a, str>> for String
1.28.0 · Source§impl<'a> From<&'a String> for Cow<'a, str>
1.45.0 · Source§impl From<Cow<'_, str>> for Box<str>
Source§fn from(cow: Cow<'_, str>) -> Box<str>
Converts a Cow<'_, str>
into a Box<str>
│ │ │ │ When cow
is the Cow::Borrowed
variant, this
│ │ │ │ conversion allocates on the heap and copies the
│ │ │ │ underlying str
. Otherwise, it will try to reuse the owned
│ │ │ │ String
’s allocation.
│ │ │ │ §Examples
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -1.14.0 · Source§impl<'a, T> From<Cow<'a, [T]>> for Vec<T>
Source§fn from(s: Cow<'a, [T]>) -> Vec<T>
Converts a clone-on-write slice into a vector.
│ │ │ │ If s
already owns a Vec<T>
, it will be returned directly.
│ │ │ │ If s
is borrowing a slice, a new Vec<T>
will be allocated and
│ │ │ │ filled by cloning s
’s items into it.
│ │ │ │ §Examples
│ │ │ │
│ │ │ │ -1.45.0 · Source§impl<'a, B> From<Cow<'a, B>> for Arc<B>
1.45.0 · Source§impl<'a, B> From<Cow<'a, B>> for Rc<B>
1.14.0 · Source§impl<'a> From<Cow<'a, str>> for String
1.22.0 · Source§impl<'a, 'b> From<Cow<'b, str>> for Box<dyn Error + 'a>
1.22.0 · Source§impl<'a, 'b> From<Cow<'b, str>> for Box<dyn Error + Send + Sync + 'a>
Source§fn from(err: Cow<'b, str>) -> Box<dyn Error + Send + Sync + 'a>
Converts a Cow
into a box of dyn Error
+ Send
+ Sync
.
│ │ │ │ §Examples
│ │ │ │ use std::error::Error;
│ │ │ │ use std::mem;
│ │ │ │ use std::borrow::Cow;
│ │ │ │
│ │ │ │ let a_cow_str_error = Cow::from("a str error");
│ │ │ │ let a_boxed_error = Box::<dyn Error + Send + Sync>::from(a_cow_str_error);
│ │ │ │ assert!(
│ │ │ │ mem::size_of::<Box<dyn Error + Send + Sync>>() == mem::size_of_val(&a_boxed_error))
│ │ │ │ -1.0.0 · Source§impl<B> Ord for Cow<'_, B>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
│ │ │ │ - Self: Sized,
Compares and returns the maximum of two values. Read more1.0.0 · Source§impl<'a, B> PartialOrd for Cow<'a, B>
Source§impl<B: ?Sized + ToOwned> DerefPure for Cow<'_, B>
1.0.0 · Source§impl<B> Eq for Cow<'_, B>
Auto Trait Implementations§
§impl<'a, B> Freeze for Cow<'a, B>
§impl<'a, B> RefUnwindSafe for Cow<'a, B>
§impl<'a, B> Send for Cow<'a, B>
§impl<'a, B> Sync for Cow<'a, B>
§impl<'a, B> Unpin for Cow<'a, B>
§impl<'a, B> UnwindSafe for Cow<'a, B>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
│ │ │ │ - T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moreSource§impl<T> CloneToUninit for Twhere
│ │ │ │ - T: Clone,
1.0.0 · Source§impl<B> Ord for Cow<'_, B>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
│ │ │ │ + Self: Sized,
Compares and returns the maximum of two values. Read more1.0.0 · Source§impl<'a, B> PartialOrd for Cow<'a, B>
Source§impl<B: ?Sized + ToOwned> DerefPure for Cow<'_, B>
1.0.0 · Source§impl<B> Eq for Cow<'_, B>
Auto Trait Implementations§
§impl<'a, B> Freeze for Cow<'a, B>
§impl<'a, B> RefUnwindSafe for Cow<'a, B>
§impl<'a, B> Send for Cow<'a, B>
§impl<'a, B> Sync for Cow<'a, B>
§impl<'a, B> Unpin for Cow<'a, B>
§impl<'a, B> UnwindSafe for Cow<'a, B>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
│ │ │ │ + T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moreSource§impl<T> CloneToUninit for Twhere
│ │ │ │ + T: Clone,
│ │ │ │ +From<T> for U
chooses to do.
│ │ │ │ +
│ │ │ ├── ./usr/share/doc/rust-doc/html/alloc/borrow/trait.Borrow.html
│ │ │ │ @@ -1,20 +1,20 @@
│ │ │ │ -Borrow in alloc::borrow - Rust pub trait Borrow<Borrowed>where
│ │ │ │ - Borrowed: ?Sized,{
│ │ │ │ +Borrow in alloc::borrow - Rust pub trait Borrow<Borrowed>where
│ │ │ │ + Borrowed: ?Sized,{
│ │ │ │ // Required method
│ │ │ │ - fn borrow(&self) -> &Borrowed;
│ │ │ │ + fn borrow(&self) -> &Borrowed;
│ │ │ │ }
Expand description
A trait for borrowing data.
│ │ │ │ In Rust, it is common to provide different representations of a type for
│ │ │ │ different use cases. For instance, storage location and management for a
│ │ │ │ value can be specifically chosen as appropriate for a particular use via
│ │ │ │ pointer types such as Box<T>
or Rc<T>
. Beyond these generic
│ │ │ │ wrappers that can be used with any type, some types provide optional
│ │ │ │ facets providing potentially costly functionality. An example for such a
│ │ │ │ type is String
which adds the ability to extend a string to the basic
│ │ │ │ -str
. This requires keeping additional information unnecessary for a
│ │ │ │ +str
. This requires keeping additional information unnecessary for a
│ │ │ │ simple, immutable string.
│ │ │ │ These types provide access to the underlying data through references
│ │ │ │ to the type of that data. They are said to be ‘borrowed as’ that type.
│ │ │ │ For instance, a Box<T>
can be borrowed as T
while a String
│ │ │ │ can be borrowed as str
.
│ │ │ │ Types express that they can be borrowed as some type T
by implementing
│ │ │ │ Borrow<T>
, providing a reference to a T
in the trait’s
│ │ │ │ @@ -28,22 +28,22 @@
│ │ │ │ on the identical behavior of these additional trait implementations.
│ │ │ │ These traits will likely appear as additional trait bounds.
│ │ │ │ In particular Eq
, Ord
and Hash
must be equivalent for
│ │ │ │ borrowed and owned values: x.borrow() == y.borrow()
should give the
│ │ │ │ same result as x == y
.
│ │ │ │ If generic code merely needs to work for all types that can
│ │ │ │ provide a reference to related type T
, it is often better to use
│ │ │ │ -AsRef<T>
as more types can safely implement it.
│ │ │ │ +AsRef<T>
as more types can safely implement it.
│ │ │ │ §Examples
│ │ │ │ As a data collection, HashMap<K, V>
owns both keys and values. If
│ │ │ │ the key’s actual data is wrapped in a managing type of some kind, it
│ │ │ │ should, however, still be possible to search for a value using a
│ │ │ │ reference to the key’s data. For instance, if the key is a string, then
│ │ │ │ it is likely stored with the hash map as a String
, while it should
│ │ │ │ -be possible to search using a &str
. Thus, insert
needs to
│ │ │ │ +be possible to search using a &str
. Thus, insert
needs to
│ │ │ │ operate on a String
while get
needs to be able to use a &str
.
│ │ │ │ Slightly simplified, the relevant parts of HashMap<K, V>
look like
│ │ │ │ this:
│ │ │ │
│ │ │ │ use std::borrow::Borrow;
│ │ │ │ use std::hash::Hash;
│ │ │ │
│ │ │ │ @@ -111,27 +111,27 @@
│ │ │ │ }
│ │ │ │ Can CaseInsensitiveString
implement Borrow<str>
? It certainly can
│ │ │ │ provide a reference to a string slice via its contained owned string.
│ │ │ │ But because its Hash
implementation differs, it behaves differently
│ │ │ │ from str
and therefore must not, in fact, implement Borrow<str>
.
│ │ │ │ If it wants to allow others access to the underlying str
, it can do
│ │ │ │ that via AsRef<str>
which doesn’t carry any extra requirements.
│ │ │ │ -Required Methods§
Required Methods§
Implementors§
1.0.0 · Source§impl Borrow<str> for String
1.3.0 · Source§impl Borrow<CStr> for CString
1.0.0 · Source§impl<'a, B> Borrow<B> for Cow<'a, B>
1.0.0 · Source§impl<T> Borrow<T> for &Twhere
│ │ │ │ - T: ?Sized,
1.0.0 · Source§impl<T> Borrow<T> for &mut Twhere
│ │ │ │ - T: ?Sized,
1.0.0 · Source§impl<T> Borrow<T> for Twhere
│ │ │ │ - T: ?Sized,
1.0.0 · Source§impl<T, A: Allocator> Borrow<[T]> for Vec<T, A>
1.4.0 · Source§impl<T, const N: usize> Borrow<[T]> for [T; N]
1.1.0 · Source§impl<T: ?Sized, A: Allocator> Borrow<T> for Box<T, A>
1.0.0 · Source§impl<T: ?Sized, A: Allocator> Borrow<T> for Rc<T, A>
Source§impl<T: ?Sized, A: Allocator> Borrow<T> for UniqueRc<T, A>
1.0.0 · Source§impl<T: ?Sized, A: Allocator> Borrow<T> for Arc<T, A>
│ │ │ │ +
Implementors§
1.0.0 · Source§impl Borrow<str> for String
1.3.0 · Source§impl Borrow<CStr> for CString
1.0.0 · Source§impl<'a, B> Borrow<B> for Cow<'a, B>
1.0.0 · Source§impl<T> Borrow<T> for &Twhere
│ │ │ │ + T: ?Sized,
1.0.0 · Source§impl<T> Borrow<T> for &mut Twhere
│ │ │ │ + T: ?Sized,
1.0.0 · Source§impl<T> Borrow<T> for Twhere
│ │ │ │ + T: ?Sized,
1.0.0 · Source§impl<T, A: Allocator> Borrow<[T]> for Vec<T, A>
1.4.0 · Source§impl<T, const N: usize> Borrow<[T]> for [T; N]
1.1.0 · Source§impl<T: ?Sized, A: Allocator> Borrow<T> for Box<T, A>
1.0.0 · Source§impl<T: ?Sized, A: Allocator> Borrow<T> for Rc<T, A>
Source§impl<T: ?Sized, A: Allocator> Borrow<T> for UniqueRc<T, A>
1.0.0 · Source§impl<T: ?Sized, A: Allocator> Borrow<T> for Arc<T, A>
pub trait BorrowMut<Borrowed>: Borrow<Borrowed>where
│ │ │ │ - Borrowed: ?Sized,{
│ │ │ │ +BorrowMut in alloc::borrow - Rust pub trait BorrowMut<Borrowed>: Borrow<Borrowed>where
│ │ │ │ + Borrowed: ?Sized,{
│ │ │ │ // Required method
│ │ │ │ - fn borrow_mut(&mut self) -> &mut Borrowed;
│ │ │ │ + fn borrow_mut(&mut self) -> &mut Borrowed;
│ │ │ │ }
Expand description
Required Methods§
1.0.0 · Sourcefn borrow_mut(&mut self) -> &mut Borrowed
Mutably borrows from an owned value.
│ │ │ │ +Required Methods§
1.0.0 · Sourcefn borrow_mut(&mut self) -> &mut Borrowed
Mutably borrows from an owned value.
│ │ │ │ §Examples
│ │ │ │
│ │ │ │ -Implementors§
1.36.0 · Source§impl BorrowMut<str> for String
1.0.0 · Source§impl<T> BorrowMut<T> for &mut Twhere
│ │ │ │ - T: ?Sized,
1.0.0 · Source§impl<T> BorrowMut<T> for Twhere
│ │ │ │ - T: ?Sized,
1.0.0 · Source§impl<T, A: Allocator> BorrowMut<[T]> for Vec<T, A>
1.4.0 · Source§impl<T, const N: usize> BorrowMut<[T]> for [T; N]
1.1.0 · Source§impl<T: ?Sized, A: Allocator> BorrowMut<T> for Box<T, A>
Source§impl<T: ?Sized, A: Allocator> BorrowMut<T> for UniqueRc<T, A>
│ │ │ │ +
Implementors§
impl BorrowMut<str> for String
impl<T> BorrowMut<T> for &mut Twhere
│ │ │ │ + T: ?Sized,
impl<T> BorrowMut<T> for Twhere
│ │ │ │ + T: ?Sized,
impl<T, A: Allocator> BorrowMut<[T]> for Vec<T, A>
impl<T, const N: usize> BorrowMut<[T]> for [T; N]
impl<T: ?Sized, A: Allocator> BorrowMut<T> for Box<T, A>
impl<T: ?Sized, A: Allocator> BorrowMut<T> for UniqueRc<T, A>
Provided Methods§
1.63.0 · Sourcefn clone_into(&self, target: &mut Self::Owned)
fn clone_into(&self, target: &mut Self::Owned)
Uses borrowed data to replace owned data, usually by cloning.
│ │ │ │ -This is borrow-generalized version of Clone::clone_from
.
This is borrow-generalized version of Clone::clone_from
.
§Examples
│ │ │ │Basic usage:
│ │ │ │ │ │ │ │ │ │ │ │ -Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
isize::MAX
bytes.
│ │ │ │ §Examples
│ │ │ │Move a value from the stack to the heap by creating a Box
:
Move a value from a Box
back to the stack by dereferencing:
Move a value from a Box
back to the stack by dereferencing:
Creating a recursive data structure:
│ │ │ │ │ │ │ │#[allow(dead_code)]
│ │ │ │ #[derive(Debug)]
│ │ │ │ @@ -39,15 +39,15 @@
│ │ │ │ pointer points to a valid value of the right type. More precisely, a value: *mut T
that has
│ │ │ │ been allocated with the Global
allocator with Layout::for_value(&*value)
may be converted
│ │ │ │ into a box using Box::<T>::from_raw(value)
. Conversely, the memory backing a value: *mut T
│ │ │ │ obtained from Box::<T>::into_raw
may be deallocated using the Global
allocator with
│ │ │ │ Layout::for_value(&*value)
.
│ │ │ │ For zero-sized values, the Box
pointer has to be non-null and sufficiently aligned. The
│ │ │ │ recommended way to build a Box to a ZST if Box::new
cannot be used is to use
│ │ │ │ -ptr::NonNull::dangling
.
│ │ │ │ +ptr::NonNull::dangling
.
│ │ │ │ On top of these basic layout requirements, a Box<T>
must point to a valid value of T
.
│ │ │ │ So long as T: Sized
, a Box<T>
is guaranteed to be represented
│ │ │ │ as a single pointer and is also ABI-compatible with C pointers
│ │ │ │ (i.e. the C type T*
). This means that if you have extern “C”
│ │ │ │ Rust functions that will be called from C, you can define those
│ │ │ │ Rust functions using Box<T>
types, and use T*
as corresponding
│ │ │ │ type on the C side. As an example, consider this C header which
│ │ │ │ @@ -96,15 +96,15 @@
│ │ │ │
The aliasing rules for Box<T>
are the same as for &mut T
. Box<T>
│ │ │ │ asserts uniqueness over its content. Using raw pointers derived from a box
│ │ │ │ after that box has been mutated through, moved or borrowed as &mut T
│ │ │ │ is not allowed. For more guidance on working with box from unsafe code, see
│ │ │ │ rust-lang/unsafe-code-guidelines#326.
│ │ │ │ §Editions
│ │ │ │ A special case exists for the implementation of IntoIterator
for arrays on the Rust 2021
│ │ │ │ -edition, as documented here. Unfortunately, it was later found that a similar
│ │ │ │ +edition, as documented here. Unfortunately, it was later found that a similar
│ │ │ │ workaround should be added for boxed slices, and this was applied in the 2024 edition.
│ │ │ │ Specifically, IntoIterator
is implemented for Box<[T]>
on all editions, but specific calls
│ │ │ │ to into_iter()
for boxed slices will defer to the slice implementation on editions before
│ │ │ │ 2024:
│ │ │ │
│ │ │ │ ⓘ// Rust 2015, 2018, and 2021:
│ │ │ ├── ./usr/share/doc/rust-doc/html/alloc/boxed/struct.Box.html
│ │ │ │ @@ -1,79 +1,79 @@
│ │ │ │ -Box in alloc::boxed - Rust pub struct Box<T: ?Sized, A: Allocator = Global>(/* private fields */);
Expand description
A pointer type that uniquely owns a heap allocation of type T
.
│ │ │ │ +Box in alloc::boxed - Rust pub struct Box<T: ?Sized, A: Allocator = Global>(/* private fields */);
Expand description
A pointer type that uniquely owns a heap allocation of type T
.
│ │ │ │ See the module-level documentation for more.
│ │ │ │ -Implementations§
Source§impl<A: Allocator> Box<dyn Any, A>
1.0.0 · Sourcepub fn downcast<T: Any>(self) -> Result<Box<T, A>, Self>
Attempts to downcast the box to a concrete type.
│ │ │ │ +Implementations§
Source§impl<A: Allocator> Box<dyn Any, A>
1.0.0 · Sourcepub fn downcast<T: Any>(self) -> Result<Box<T, A>, Self>
Attempts to downcast the box to a concrete type.
│ │ │ │ §Examples
│ │ │ │ use std::any::Any;
│ │ │ │
│ │ │ │ fn print_if_string(value: Box<dyn Any>) {
│ │ │ │ if let Ok(string) = value.downcast::<String>() {
│ │ │ │ println!("String ({}): {}", string.len(), string);
│ │ │ │ }
│ │ │ │ }
│ │ │ │
│ │ │ │ let my_string = "Hello World".to_string();
│ │ │ │ print_if_string(Box::new(my_string));
│ │ │ │ print_if_string(Box::new(0i8));
│ │ │ │ -Sourcepub unsafe fn downcast_unchecked<T: Any>(self) -> Box<T, A>
🔬This is a nightly-only experimental API. (downcast_unchecked
#90850)
Downcasts the box to a concrete type.
│ │ │ │ +Sourcepub unsafe fn downcast_unchecked<T: Any>(self) -> Box<T, A>
🔬This is a nightly-only experimental API. (downcast_unchecked
#90850)
Downcasts the box to a concrete type.
│ │ │ │ For a safe alternative see downcast
.
│ │ │ │ §Examples
│ │ │ │ #![feature(downcast_unchecked)]
│ │ │ │
│ │ │ │ use std::any::Any;
│ │ │ │
│ │ │ │ let x: Box<dyn Any> = Box::new(1_usize);
│ │ │ │
│ │ │ │ unsafe {
│ │ │ │ assert_eq!(*x.downcast_unchecked::<usize>(), 1);
│ │ │ │ }
│ │ │ │ §Safety
│ │ │ │ The contained value must be of type T
. Calling this method
│ │ │ │ with the incorrect type is undefined behavior.
│ │ │ │ -Source§impl<A: Allocator> Box<dyn Any + Send, A>
1.0.0 · Sourcepub fn downcast<T: Any>(self) -> Result<Box<T, A>, Self>
Attempts to downcast the box to a concrete type.
│ │ │ │ §Examples
│ │ │ │ use std::any::Any;
│ │ │ │
│ │ │ │ fn print_if_string(value: Box<dyn Any + Send>) {
│ │ │ │ if let Ok(string) = value.downcast::<String>() {
│ │ │ │ println!("String ({}): {}", string.len(), string);
│ │ │ │ }
│ │ │ │ }
│ │ │ │
│ │ │ │ let my_string = "Hello World".to_string();
│ │ │ │ print_if_string(Box::new(my_string));
│ │ │ │ print_if_string(Box::new(0i8));
│ │ │ │ -Sourcepub unsafe fn downcast_unchecked<T: Any>(self) -> Box<T, A>
🔬This is a nightly-only experimental API. (downcast_unchecked
#90850)
Downcasts the box to a concrete type.
│ │ │ │ +Sourcepub unsafe fn downcast_unchecked<T: Any>(self) -> Box<T, A>
🔬This is a nightly-only experimental API. (downcast_unchecked
#90850)
Downcasts the box to a concrete type.
│ │ │ │ For a safe alternative see downcast
.
│ │ │ │ §Examples
│ │ │ │ #![feature(downcast_unchecked)]
│ │ │ │
│ │ │ │ use std::any::Any;
│ │ │ │
│ │ │ │ let x: Box<dyn Any + Send> = Box::new(1_usize);
│ │ │ │
│ │ │ │ unsafe {
│ │ │ │ assert_eq!(*x.downcast_unchecked::<usize>(), 1);
│ │ │ │ }
│ │ │ │ §Safety
│ │ │ │ The contained value must be of type T
. Calling this method
│ │ │ │ with the incorrect type is undefined behavior.
│ │ │ │ -Source§impl<A: Allocator> Box<dyn Any + Send + Sync, A>
1.51.0 · Sourcepub fn downcast<T: Any>(self) -> Result<Box<T, A>, Self>
Attempts to downcast the box to a concrete type.
│ │ │ │ §Examples
│ │ │ │ use std::any::Any;
│ │ │ │
│ │ │ │ fn print_if_string(value: Box<dyn Any + Send + Sync>) {
│ │ │ │ if let Ok(string) = value.downcast::<String>() {
│ │ │ │ println!("String ({}): {}", string.len(), string);
│ │ │ │ }
│ │ │ │ }
│ │ │ │
│ │ │ │ let my_string = "Hello World".to_string();
│ │ │ │ print_if_string(Box::new(my_string));
│ │ │ │ print_if_string(Box::new(0i8));
│ │ │ │ -Sourcepub unsafe fn downcast_unchecked<T: Any>(self) -> Box<T, A>
🔬This is a nightly-only experimental API. (downcast_unchecked
#90850)
Downcasts the box to a concrete type.
│ │ │ │ +Sourcepub unsafe fn downcast_unchecked<T: Any>(self) -> Box<T, A>
🔬This is a nightly-only experimental API. (downcast_unchecked
#90850)
Downcasts the box to a concrete type.
│ │ │ │ For a safe alternative see downcast
.
│ │ │ │ §Examples
│ │ │ │ #![feature(downcast_unchecked)]
│ │ │ │
│ │ │ │ use std::any::Any;
│ │ │ │
│ │ │ │ let x: Box<dyn Any + Send + Sync> = Box::new(1_usize);
│ │ │ │ @@ -84,68 +84,68 @@
│ │ │ │ §Safety
│ │ │ │ The contained value must be of type T
. Calling this method
│ │ │ │ with the incorrect type is undefined behavior.
│ │ │ │
Source§impl<T> Box<T>
1.0.0 · Sourcepub fn new(x: T) -> Self
Allocates memory on the heap and then places x
into it.
│ │ │ │ This doesn’t actually allocate if T
is zero-sized.
│ │ │ │ §Examples
│ │ │ │
│ │ │ │ -1.82.0 · Sourcepub fn new_uninit() -> Box<MaybeUninit<T>>
Constructs a new box with uninitialized contents.
│ │ │ │ +1.82.0 · Sourcepub fn new_uninit() -> Box<MaybeUninit<T>>
Constructs a new box with uninitialized contents.
│ │ │ │ §Examples
│ │ │ │
│ │ │ │ -Sourcepub fn new_zeroed() -> Box<MaybeUninit<T>>
🔬This is a nightly-only experimental API. (new_zeroed_alloc
#129396)
Constructs a new Box
with uninitialized contents, with the memory
│ │ │ │ +
Sourcepub fn new_zeroed() -> Box<MaybeUninit<T>>
🔬This is a nightly-only experimental API. (new_zeroed_alloc
#129396)
Constructs a new Box
with uninitialized contents, with the memory
│ │ │ │ being filled with 0
bytes.
│ │ │ │ -See MaybeUninit::zeroed
for examples of correct and incorrect usage
│ │ │ │ +
See MaybeUninit::zeroed
for examples of correct and incorrect usage
│ │ │ │ of this method.
│ │ │ │ §Examples
│ │ │ │
│ │ │ │ -1.33.0 · Sourcepub fn pin(x: T) -> Pin<Box<T>>
Constructs a new Pin<Box<T>>
. If T
does not implement Unpin
, then
│ │ │ │ +
1.33.0 · Sourcepub fn pin(x: T) -> Pin<Box<T>>
Constructs a new Pin<Box<T>>
. If T
does not implement Unpin
, then
│ │ │ │ x
will be pinned in memory and unable to be moved.
│ │ │ │ Constructing and pinning of the Box
can also be done in two steps: Box::pin(x)
│ │ │ │ does the same as Box::into_pin(Box::new(x))
. Consider using
│ │ │ │ into_pin
if you already have a Box<T>
, or if you want to
│ │ │ │ construct a (pinned) Box
in a different way than with Box::new
.
│ │ │ │ -Sourcepub fn try_new(x: T) -> Result<Self, AllocError>
🔬This is a nightly-only experimental API. (allocator_api
#32838)
Allocates memory on the heap then places x
into it,
│ │ │ │ +
Sourcepub fn try_new(x: T) -> Result<Self, AllocError>
🔬This is a nightly-only experimental API. (allocator_api
#32838)
Allocates memory on the heap then places x
into it,
│ │ │ │ returning an error if the allocation fails
│ │ │ │ This doesn’t actually allocate if T
is zero-sized.
│ │ │ │ §Examples
│ │ │ │
│ │ │ │ -Sourcepub fn try_new_uninit() -> Result<Box<MaybeUninit<T>>, AllocError>
🔬This is a nightly-only experimental API. (allocator_api
#32838)
Constructs a new box with uninitialized contents on the heap,
│ │ │ │ +
Sourcepub fn try_new_uninit() -> Result<Box<MaybeUninit<T>>, AllocError>
🔬This is a nightly-only experimental API. (allocator_api
#32838)
Constructs a new box with uninitialized contents on the heap,
│ │ │ │ returning an error if the allocation fails
│ │ │ │ §Examples
│ │ │ │
│ │ │ │ -Sourcepub fn try_new_zeroed() -> Result<Box<MaybeUninit<T>>, AllocError>
🔬This is a nightly-only experimental API. (allocator_api
#32838)
Constructs a new Box
with uninitialized contents, with the memory
│ │ │ │ +
Sourcepub fn try_new_zeroed() -> Result<Box<MaybeUninit<T>>, AllocError>
🔬This is a nightly-only experimental API. (allocator_api
#32838)
Constructs a new Box
with uninitialized contents, with the memory
│ │ │ │ being filled with 0
bytes on the heap
│ │ │ │ -See MaybeUninit::zeroed
for examples of correct and incorrect usage
│ │ │ │ +
See MaybeUninit::zeroed
for examples of correct and incorrect usage
│ │ │ │ of this method.
│ │ │ │ §Examples
│ │ │ │ #![feature(allocator_api)]
│ │ │ │
│ │ │ │ let zero = Box::<u32>::try_new_zeroed()?;
│ │ │ │ let zero = unsafe { zero.assume_init() };
│ │ │ │
│ │ │ │ @@ -155,25 +155,25 @@
│ │ │ │ This doesn’t actually allocate if T
is zero-sized.
│ │ │ │ §Examples
│ │ │ │
│ │ │ │ -
Sourcepub fn try_new_in(x: T, alloc: A) -> Result<Self, AllocError>where
│ │ │ │ +
Sourcepub fn try_new_in(x: T, alloc: A) -> Result<Self, AllocError>where
│ │ │ │ A: Allocator,
🔬This is a nightly-only experimental API. (allocator_api
#32838)
Allocates memory in the given allocator then places x
into it,
│ │ │ │ returning an error if the allocation fails
│ │ │ │ This doesn’t actually allocate if T
is zero-sized.
│ │ │ │ §Examples
│ │ │ │
│ │ │ │ -Sourcepub fn new_uninit_in(alloc: A) -> Box<MaybeUninit<T>, A>where
│ │ │ │ +
Sourcepub fn new_uninit_in(alloc: A) -> Box<MaybeUninit<T>, A>where
│ │ │ │ A: Allocator,
🔬This is a nightly-only experimental API. (allocator_api
#32838)
Constructs a new box with uninitialized contents in the provided allocator.
│ │ │ │ §Examples
│ │ │ │ #![feature(allocator_api)]
│ │ │ │
│ │ │ │ use std::alloc::System;
│ │ │ │
│ │ │ │ let mut five = Box::<u32, _>::new_uninit_in(System);
│ │ │ │ @@ -182,15 +182,15 @@
│ │ │ │ // Deferred initialization:
│ │ │ │ five.as_mut_ptr().write(5);
│ │ │ │
│ │ │ │ five.assume_init()
│ │ │ │ };
│ │ │ │
│ │ │ │ assert_eq!(*five, 5)
│ │ │ │ -Sourcepub fn try_new_uninit_in(alloc: A) -> Result<Box<MaybeUninit<T>, A>, AllocError>where
│ │ │ │ +
Sourcepub fn try_new_uninit_in(alloc: A) -> Result<Box<MaybeUninit<T>, A>, AllocError>where
│ │ │ │ A: Allocator,
🔬This is a nightly-only experimental API. (allocator_api
#32838)
Constructs a new box with uninitialized contents in the provided allocator,
│ │ │ │ returning an error if the allocation fails
│ │ │ │ §Examples
│ │ │ │
│ │ │ │ -Sourcepub fn new_zeroed_in(alloc: A) -> Box<MaybeUninit<T>, A>where
│ │ │ │ +
Sourcepub fn new_zeroed_in(alloc: A) -> Box<MaybeUninit<T>, A>where
│ │ │ │ A: Allocator,
🔬This is a nightly-only experimental API. (allocator_api
#32838)
Constructs a new Box
with uninitialized contents, with the memory
│ │ │ │ being filled with 0
bytes in the provided allocator.
│ │ │ │ -See MaybeUninit::zeroed
for examples of correct and incorrect usage
│ │ │ │ +
See MaybeUninit::zeroed
for examples of correct and incorrect usage
│ │ │ │ of this method.
│ │ │ │ §Examples
│ │ │ │
│ │ │ │ -Sourcepub fn try_new_zeroed_in(alloc: A) -> Result<Box<MaybeUninit<T>, A>, AllocError>where
│ │ │ │ +
Sourcepub fn try_new_zeroed_in(alloc: A) -> Result<Box<MaybeUninit<T>, A>, AllocError>where
│ │ │ │ A: Allocator,
🔬This is a nightly-only experimental API. (allocator_api
#32838)
Constructs a new Box
with uninitialized contents, with the memory
│ │ │ │ being filled with 0
bytes in the provided allocator,
│ │ │ │ returning an error if the allocation fails,
│ │ │ │ -See MaybeUninit::zeroed
for examples of correct and incorrect usage
│ │ │ │ +
See MaybeUninit::zeroed
for examples of correct and incorrect usage
│ │ │ │ of this method.
│ │ │ │ §Examples
│ │ │ │
│ │ │ │ -Sourcepub fn pin_in(x: T, alloc: A) -> Pin<Self>where
│ │ │ │ - A: 'static + Allocator,
🔬This is a nightly-only experimental API. (allocator_api
#32838)
Constructs a new Pin<Box<T, A>>
. If T
does not implement Unpin
, then
│ │ │ │ +
Sourcepub fn pin_in(x: T, alloc: A) -> Pin<Self>where
│ │ │ │ + A: 'static + Allocator,
🔬This is a nightly-only experimental API. (allocator_api
#32838)
Constructs a new Pin<Box<T, A>>
. If T
does not implement Unpin
, then
│ │ │ │ x
will be pinned in memory and unable to be moved.
│ │ │ │ Constructing and pinning of the Box
can also be done in two steps: Box::pin_in(x, alloc)
│ │ │ │ does the same as Box::into_pin(Box::new_in(x, alloc))
. Consider using
│ │ │ │ into_pin
if you already have a Box<T, A>
, or if you want to
│ │ │ │ construct a (pinned) Box
in a different way than with Box::new_in
.
│ │ │ │ -Sourcepub fn into_boxed_slice(boxed: Self) -> Box<[T], A>
🔬This is a nightly-only experimental API. (box_into_boxed_slice
#71582)
Converts a Box<T>
into a Box<[T]>
│ │ │ │ +Sourcepub fn into_boxed_slice(boxed: Self) -> Box<[T], A>
🔬This is a nightly-only experimental API. (box_into_boxed_slice
#71582)
Converts a Box<T>
into a Box<[T]>
│ │ │ │ This conversion does not allocate on the heap and happens in place.
│ │ │ │ Sourcepub fn into_inner(boxed: Self) -> T
🔬This is a nightly-only experimental API. (box_into_inner
#80437)
Consumes the Box
, returning the wrapped value.
│ │ │ │ §Examples
│ │ │ │
│ │ │ │ -Source§impl<T> Box<[T]>
1.82.0 · Sourcepub fn new_uninit_slice(len: usize) -> Box<[MaybeUninit<T>]>
Constructs a new boxed slice with uninitialized contents.
│ │ │ │ +Source§impl<T> Box<[T]>
1.82.0 · Sourcepub fn new_uninit_slice(len: usize) -> Box<[MaybeUninit<T>]>
Constructs a new boxed slice with uninitialized contents.
│ │ │ │ §Examples
│ │ │ │ let mut values = Box::<[u32]>::new_uninit_slice(3);
│ │ │ │
│ │ │ │ let values = unsafe {
│ │ │ │ // Deferred initialization:
│ │ │ │ values[0].as_mut_ptr().write(1);
│ │ │ │ values[1].as_mut_ptr().write(2);
│ │ │ │ values[2].as_mut_ptr().write(3);
│ │ │ │
│ │ │ │ values.assume_init()
│ │ │ │ };
│ │ │ │
│ │ │ │ assert_eq!(*values, [1, 2, 3])
│ │ │ │ -Sourcepub fn new_zeroed_slice(len: usize) -> Box<[MaybeUninit<T>]>
🔬This is a nightly-only experimental API. (new_zeroed_alloc
#129396)
Constructs a new boxed slice with uninitialized contents, with the memory
│ │ │ │ +
Sourcepub fn new_zeroed_slice(len: usize) -> Box<[MaybeUninit<T>]>
🔬This is a nightly-only experimental API. (new_zeroed_alloc
#129396)
Constructs a new boxed slice with uninitialized contents, with the memory
│ │ │ │ being filled with 0
bytes.
│ │ │ │ -See MaybeUninit::zeroed
for examples of correct and incorrect usage
│ │ │ │ +
See MaybeUninit::zeroed
for examples of correct and incorrect usage
│ │ │ │ of this method.
│ │ │ │ §Examples
│ │ │ │
│ │ │ │ Sourcepub fn try_new_uninit_slice(
│ │ │ │ - len: usize,
│ │ │ │ -) -> Result<Box<[MaybeUninit<T>]>, AllocError>
🔬This is a nightly-only experimental API. (allocator_api
#32838)
Constructs a new boxed slice with uninitialized contents. Returns an error if
│ │ │ │ + len: usize,
│ │ │ │ +) -> Result<Box<[MaybeUninit<T>]>, AllocError>🔬This is a nightly-only experimental API. (allocator_api
#32838)
Constructs a new boxed slice with uninitialized contents. Returns an error if
│ │ │ │ the allocation fails.
│ │ │ │ §Examples
│ │ │ │ #![feature(allocator_api)]
│ │ │ │
│ │ │ │ let mut values = Box::<[u32]>::try_new_uninit_slice(3)?;
│ │ │ │ let values = unsafe {
│ │ │ │ // Deferred initialization:
│ │ │ │ @@ -288,30 +288,30 @@
│ │ │ │ values[1].as_mut_ptr().write(2);
│ │ │ │ values[2].as_mut_ptr().write(3);
│ │ │ │ values.assume_init()
│ │ │ │ };
│ │ │ │
│ │ │ │ assert_eq!(*values, [1, 2, 3]);
│ │ │ │ Sourcepub fn try_new_zeroed_slice(
│ │ │ │ - len: usize,
│ │ │ │ -) -> Result<Box<[MaybeUninit<T>]>, AllocError>
🔬This is a nightly-only experimental API. (allocator_api
#32838)
Constructs a new boxed slice with uninitialized contents, with the memory
│ │ │ │ + len: usize,
│ │ │ │ +) -> Result<Box<[MaybeUninit<T>]>, AllocError>🔬This is a nightly-only experimental API. (allocator_api
#32838)
Constructs a new boxed slice with uninitialized contents, with the memory
│ │ │ │ being filled with 0
bytes. Returns an error if the allocation fails.
│ │ │ │ -See MaybeUninit::zeroed
for examples of correct and incorrect usage
│ │ │ │ +
See MaybeUninit::zeroed
for examples of correct and incorrect usage
│ │ │ │ of this method.
│ │ │ │ §Examples
│ │ │ │
│ │ │ │ -Sourcepub fn into_array<const N: usize>(self) -> Option<Box<[T; N]>>
🔬This is a nightly-only experimental API. (slice_as_array
#133508)
Converts the boxed slice into a boxed array.
│ │ │ │ +Sourcepub fn into_array<const N: usize>(self) -> Option<Box<[T; N]>>
🔬This is a nightly-only experimental API. (slice_as_array
#133508)
Converts the boxed slice into a boxed array.
│ │ │ │ This operation does not reallocate; the underlying array of the slice is simply reinterpreted as an array type.
│ │ │ │ If N
is not exactly equal to the length of self
, then this method returns None
.
│ │ │ │ -Source§impl<T, A: Allocator> Box<[T], A>
Sourcepub fn new_uninit_slice_in(len: usize, alloc: A) -> Box<[MaybeUninit<T>], A>
🔬This is a nightly-only experimental API. (allocator_api
#32838)
Constructs a new boxed slice with uninitialized contents in the provided allocator.
│ │ │ │ +Source§impl<T, A: Allocator> Box<[T], A>
Sourcepub fn new_uninit_slice_in(len: usize, alloc: A) -> Box<[MaybeUninit<T>], A>
🔬This is a nightly-only experimental API. (allocator_api
#32838)
Constructs a new boxed slice with uninitialized contents in the provided allocator.
│ │ │ │ §Examples
│ │ │ │ #![feature(allocator_api)]
│ │ │ │
│ │ │ │ use std::alloc::System;
│ │ │ │
│ │ │ │ let mut values = Box::<[u32], _>::new_uninit_slice_in(3, System);
│ │ │ │
│ │ │ │ @@ -321,31 +321,31 @@
│ │ │ │ values[1].as_mut_ptr().write(2);
│ │ │ │ values[2].as_mut_ptr().write(3);
│ │ │ │
│ │ │ │ values.assume_init()
│ │ │ │ };
│ │ │ │
│ │ │ │ assert_eq!(*values, [1, 2, 3])
│ │ │ │ -Sourcepub fn new_zeroed_slice_in(len: usize, alloc: A) -> Box<[MaybeUninit<T>], A>
🔬This is a nightly-only experimental API. (allocator_api
#32838)
Constructs a new boxed slice with uninitialized contents in the provided allocator,
│ │ │ │ +
Sourcepub fn new_zeroed_slice_in(len: usize, alloc: A) -> Box<[MaybeUninit<T>], A>
🔬This is a nightly-only experimental API. (allocator_api
#32838)
Constructs a new boxed slice with uninitialized contents in the provided allocator,
│ │ │ │ with the memory being filled with 0
bytes.
│ │ │ │ -See MaybeUninit::zeroed
for examples of correct and incorrect usage
│ │ │ │ +
See MaybeUninit::zeroed
for examples of correct and incorrect usage
│ │ │ │ of this method.
│ │ │ │ §Examples
│ │ │ │
│ │ │ │ Sourcepub fn try_new_uninit_slice_in(
│ │ │ │ - len: usize,
│ │ │ │ + len: usize,
│ │ │ │ alloc: A,
│ │ │ │ -) -> Result<Box<[MaybeUninit<T>], A>, AllocError>
🔬This is a nightly-only experimental API. (allocator_api
#32838)
Constructs a new boxed slice with uninitialized contents in the provided allocator. Returns an error if
│ │ │ │ +) -> Result<Box<[MaybeUninit<T>], A>, AllocError>🔬This is a nightly-only experimental API. (allocator_api
#32838)
Constructs a new boxed slice with uninitialized contents in the provided allocator. Returns an error if
│ │ │ │ the allocation fails.
│ │ │ │ §Examples
│ │ │ │ #![feature(allocator_api)]
│ │ │ │
│ │ │ │ use std::alloc::System;
│ │ │ │
│ │ │ │ let mut values = Box::<[u32], _>::try_new_uninit_slice_in(3, System)?;
│ │ │ │ @@ -355,32 +355,32 @@
│ │ │ │ values[1].as_mut_ptr().write(2);
│ │ │ │ values[2].as_mut_ptr().write(3);
│ │ │ │ values.assume_init()
│ │ │ │ };
│ │ │ │
│ │ │ │ assert_eq!(*values, [1, 2, 3]);
│ │ │ │ Sourcepub fn try_new_zeroed_slice_in(
│ │ │ │ - len: usize,
│ │ │ │ + len: usize,
│ │ │ │ alloc: A,
│ │ │ │ -) -> Result<Box<[MaybeUninit<T>], A>, AllocError>
🔬This is a nightly-only experimental API. (allocator_api
#32838)
Constructs a new boxed slice with uninitialized contents in the provided allocator, with the memory
│ │ │ │ +) -> Result<Box<[MaybeUninit<T>], A>, AllocError>🔬This is a nightly-only experimental API. (allocator_api
#32838)
Constructs a new boxed slice with uninitialized contents in the provided allocator, with the memory
│ │ │ │ being filled with 0
bytes. Returns an error if the allocation fails.
│ │ │ │ -See MaybeUninit::zeroed
for examples of correct and incorrect usage
│ │ │ │ +
See MaybeUninit::zeroed
for examples of correct and incorrect usage
│ │ │ │ of this method.
│ │ │ │ §Examples
│ │ │ │
│ │ │ │ -Source§impl<T, A: Allocator> Box<MaybeUninit<T>, A>
1.82.0 · Sourcepub unsafe fn assume_init(self) -> Box<T, A>
Converts to Box<T, A>
.
│ │ │ │ +Source§impl<T, A: Allocator> Box<MaybeUninit<T>, A>
1.82.0 · Sourcepub unsafe fn assume_init(self) -> Box<T, A>
Converts to Box<T, A>
.
│ │ │ │ §Safety
│ │ │ │ -As with MaybeUninit::assume_init
,
│ │ │ │ +
As with MaybeUninit::assume_init
,
│ │ │ │ it is up to the caller to guarantee that the value
│ │ │ │ really is in an initialized state.
│ │ │ │ Calling this when the content is not yet fully initialized
│ │ │ │ causes immediate undefined behavior.
│ │ │ │ §Examples
│ │ │ │ let mut five = Box::<u32>::new_uninit();
│ │ │ │
│ │ │ │ @@ -410,17 +410,17 @@
│ │ │ │ // The optimizer may be able to elide this copy, so previous code writes
│ │ │ │ // to heap directly.
│ │ │ │ let big_box = Box::write(big_box, array);
│ │ │ │
│ │ │ │ for (i, x) in big_box.iter().enumerate() {
│ │ │ │ assert_eq!(*x, i);
│ │ │ │ }
│ │ │ │ -Source§impl<T, A: Allocator> Box<[MaybeUninit<T>], A>
1.82.0 · Sourcepub unsafe fn assume_init(self) -> Box<[T], A>
Converts to Box<[T], A>
.
│ │ │ │ +Source§impl<T, A: Allocator> Box<[MaybeUninit<T>], A>
1.82.0 · Sourcepub unsafe fn assume_init(self) -> Box<[T], A>
Converts to Box<[T], A>
.
│ │ │ │ §Safety
│ │ │ │ -As with MaybeUninit::assume_init
,
│ │ │ │ +
As with MaybeUninit::assume_init
,
│ │ │ │ it is up to the caller to guarantee that the values
│ │ │ │ really are in an initialized state.
│ │ │ │ Calling this when the content is not yet fully initialized
│ │ │ │ causes immediate undefined behavior.
│ │ │ │ §Examples
│ │ │ │
│ │ │ │ -Source§impl<T: ?Sized> Box<T>
1.4.0 · Sourcepub unsafe fn from_raw(raw: *mut T) -> Self
Constructs a box from a raw pointer.
│ │ │ │ After calling this function, the raw pointer is owned by the
│ │ │ │ resulting Box
. Specifically, the Box
destructor will call
│ │ │ │ the destructor of T
and free the allocated memory. For this
│ │ │ │ to be safe, the memory must have been allocated in accordance
│ │ │ │ with the memory layout used by Box
.
│ │ │ │ §Safety
│ │ │ │ This function is unsafe because improper use may lead to
│ │ │ │ @@ -461,15 +461,15 @@
│ │ │ │ let ptr = alloc(Layout::new::<i32>()) as *mut i32;
│ │ │ │ // In general .write is required to avoid attempting to destruct
│ │ │ │ // the (uninitialized) previous contents of `ptr`, though for this
│ │ │ │ // simple example `*ptr = 5` would have worked as well.
│ │ │ │ ptr.write(5);
│ │ │ │ let x = Box::from_raw(ptr);
│ │ │ │ }
│ │ │ │ -Sourcepub unsafe fn from_non_null(ptr: NonNull<T>) -> Self
🔬This is a nightly-only experimental API. (box_vec_non_null
#130364)
Constructs a box from a NonNull
pointer.
│ │ │ │ +Sourcepub unsafe fn from_non_null(ptr: NonNull<T>) -> Self
🔬This is a nightly-only experimental API. (box_vec_non_null
#130364)
Constructs a box from a NonNull
pointer.
│ │ │ │ After calling this function, the NonNull
pointer is owned by
│ │ │ │ the resulting Box
. Specifically, the Box
destructor will call
│ │ │ │ the destructor of T
and free the allocated memory. For this
│ │ │ │ to be safe, the memory must have been allocated in accordance
│ │ │ │ with the memory layout used by Box
.
│ │ │ │ §Safety
│ │ │ │ This function is unsafe because improper use may lead to
│ │ │ │ @@ -496,15 +496,15 @@
│ │ │ │ let non_null = NonNull::new(alloc(Layout::new::<i32>()).cast::<i32>())
│ │ │ │ .expect("allocation failed");
│ │ │ │ // In general .write is required to avoid attempting to destruct
│ │ │ │ // the (uninitialized) previous contents of `non_null`.
│ │ │ │ non_null.write(5);
│ │ │ │ let x = Box::from_non_null(non_null);
│ │ │ │ }
│ │ │ │ -Source§impl<T: ?Sized, A: Allocator> Box<T, A>
Sourcepub const unsafe fn from_raw_in(raw: *mut T, alloc: A) -> Self
🔬This is a nightly-only experimental API. (allocator_api
#32838)
Constructs a box from a raw pointer in the given allocator.
│ │ │ │ +Source§impl<T: ?Sized, A: Allocator> Box<T, A>
Sourcepub const unsafe fn from_raw_in(raw: *mut T, alloc: A) -> Self
🔬This is a nightly-only experimental API. (allocator_api
#32838)
Constructs a box from a raw pointer in the given allocator.
│ │ │ │ After calling this function, the raw pointer is owned by the
│ │ │ │ resulting Box
. Specifically, the Box
destructor will call
│ │ │ │ the destructor of T
and free the allocated memory. For this
│ │ │ │ to be safe, the memory must have been allocated in accordance
│ │ │ │ with the memory layout used by Box
.
│ │ │ │ §Safety
│ │ │ │ This function is unsafe because improper use may lead to
│ │ │ │ @@ -532,15 +532,15 @@
│ │ │ │ let ptr = System.allocate(Layout::new::<i32>())?.as_mut_ptr() as *mut i32;
│ │ │ │ // In general .write is required to avoid attempting to destruct
│ │ │ │ // the (uninitialized) previous contents of `ptr`, though for this
│ │ │ │ // simple example `*ptr = 5` would have worked as well.
│ │ │ │ ptr.write(5);
│ │ │ │ let x = Box::from_raw_in(ptr, System);
│ │ │ │ }
│ │ │ │ -Sourcepub const unsafe fn from_non_null_in(raw: NonNull<T>, alloc: A) -> Self
🔬This is a nightly-only experimental API. (allocator_api
#32838)
Constructs a box from a NonNull
pointer in the given allocator.
│ │ │ │ +Sourcepub const unsafe fn from_non_null_in(raw: NonNull<T>, alloc: A) -> Self
🔬This is a nightly-only experimental API. (allocator_api
#32838)
Constructs a box from a NonNull
pointer in the given allocator.
│ │ │ │ After calling this function, the NonNull
pointer is owned by
│ │ │ │ the resulting Box
. Specifically, the Box
destructor will call
│ │ │ │ the destructor of T
and free the allocated memory. For this
│ │ │ │ to be safe, the memory must have been allocated in accordance
│ │ │ │ with the memory layout used by Box
.
│ │ │ │ §Safety
│ │ │ │ This function is unsafe because improper use may lead to
│ │ │ │ @@ -566,15 +566,15 @@
│ │ │ │ unsafe {
│ │ │ │ let non_null = System.allocate(Layout::new::<i32>())?.cast::<i32>();
│ │ │ │ // In general .write is required to avoid attempting to destruct
│ │ │ │ // the (uninitialized) previous contents of `non_null`.
│ │ │ │ non_null.write(5);
│ │ │ │ let x = Box::from_non_null_in(non_null, System);
│ │ │ │ }
│ │ │ │ -1.4.0 · Sourcepub fn into_raw(b: Self) -> *mut T
Consumes the Box
, returning a wrapped raw pointer.
│ │ │ │ +1.4.0 · Sourcepub fn into_raw(b: Self) -> *mut T
Consumes the Box
, returning a wrapped raw pointer.
│ │ │ │ The pointer will be properly aligned and non-null.
│ │ │ │ After calling this function, the caller is responsible for the
│ │ │ │ memory previously managed by the Box
. In particular, the
│ │ │ │ caller should properly destroy T
and release the memory, taking
│ │ │ │ into account the memory layout used by Box
. The easiest way to
│ │ │ │ do this is to convert the raw pointer back into a Box
with the
│ │ │ │ Box::from_raw
function, allowing the Box
destructor to perform
│ │ │ │ @@ -604,15 +604,15 @@
│ │ │ │
Note: This is equivalent to the following:
│ │ │ │
│ │ │ │
│ │ │ │ -Sourcepub fn into_non_null(b: Self) -> NonNull<T>
🔬This is a nightly-only experimental API. (box_vec_non_null
#130364)
Consumes the Box
, returning a wrapped NonNull
pointer.
│ │ │ │ +Sourcepub fn into_non_null(b: Self) -> NonNull<T>
🔬This is a nightly-only experimental API. (box_vec_non_null
#130364)
Consumes the Box
, returning a wrapped NonNull
pointer.
│ │ │ │ The pointer will be properly aligned.
│ │ │ │ After calling this function, the caller is responsible for the
│ │ │ │ memory previously managed by the Box
. In particular, the
│ │ │ │ caller should properly destroy T
and release the memory, taking
│ │ │ │ into account the memory layout used by Box
. The easiest way to
│ │ │ │ do this is to convert the NonNull
pointer back into a Box
with the
│ │ │ │ Box::from_non_null
function, allowing the Box
destructor to
│ │ │ │ @@ -647,15 +647,15 @@
│ │ │ │
│ │ │ │ -Sourcepub fn into_raw_with_allocator(b: Self) -> (*mut T, A)
🔬This is a nightly-only experimental API. (allocator_api
#32838)
Consumes the Box
, returning a wrapped raw pointer and the allocator.
│ │ │ │ +Sourcepub fn into_raw_with_allocator(b: Self) -> (*mut T, A)
🔬This is a nightly-only experimental API. (allocator_api
#32838)
Consumes the Box
, returning a wrapped raw pointer and the allocator.
│ │ │ │ The pointer will be properly aligned and non-null.
│ │ │ │ After calling this function, the caller is responsible for the
│ │ │ │ memory previously managed by the Box
. In particular, the
│ │ │ │ caller should properly destroy T
and release the memory, taking
│ │ │ │ into account the memory layout used by Box
. The easiest way to
│ │ │ │ do this is to convert the raw pointer back into a Box
with the
│ │ │ │ Box::from_raw_in
function, allowing the Box
destructor to perform
│ │ │ │ @@ -685,15 +685,15 @@
│ │ │ │ let x = Box::new_in(String::from("Hello"), System);
│ │ │ │ let (ptr, alloc) = Box::into_raw_with_allocator(x);
│ │ │ │ unsafe {
│ │ │ │ ptr::drop_in_place(ptr);
│ │ │ │ let non_null = NonNull::new_unchecked(ptr);
│ │ │ │ alloc.deallocate(non_null.cast(), Layout::new::<String>());
│ │ │ │ }
│ │ │ │ -Sourcepub fn into_non_null_with_allocator(b: Self) -> (NonNull<T>, A)
🔬This is a nightly-only experimental API. (allocator_api
#32838)
Consumes the Box
, returning a wrapped NonNull
pointer and the allocator.
│ │ │ │ +Sourcepub fn into_non_null_with_allocator(b: Self) -> (NonNull<T>, A)
🔬This is a nightly-only experimental API. (allocator_api
#32838)
Consumes the Box
, returning a wrapped NonNull
pointer and the allocator.
│ │ │ │ The pointer will be properly aligned.
│ │ │ │ After calling this function, the caller is responsible for the
│ │ │ │ memory previously managed by the Box
. In particular, the
│ │ │ │ caller should properly destroy T
and release the memory, taking
│ │ │ │ into account the memory layout used by Box
. The easiest way to
│ │ │ │ do this is to convert the NonNull
pointer back into a Box
with the
│ │ │ │ Box::from_non_null_in
function, allowing the Box
destructor to
│ │ │ │ @@ -722,15 +722,15 @@
│ │ │ │
│ │ │ │ let x = Box::new_in(String::from("Hello"), System);
│ │ │ │ let (non_null, alloc) = Box::into_non_null_with_allocator(x);
│ │ │ │ unsafe {
│ │ │ │ non_null.drop_in_place();
│ │ │ │ alloc.deallocate(non_null.cast::<u8>(), Layout::new::<String>());
│ │ │ │ }
│ │ │ │ -Sourcepub fn as_mut_ptr(b: &mut Self) -> *mut T
🔬This is a nightly-only experimental API. (box_as_ptr
#129090)
Returns a raw mutable pointer to the Box
’s contents.
│ │ │ │ +Sourcepub fn as_mut_ptr(b: &mut Self) -> *mut T
🔬This is a nightly-only experimental API. (box_as_ptr
#129090)
Returns a raw mutable pointer to the Box
’s contents.
│ │ │ │ The caller must ensure that the Box
outlives the pointer this
│ │ │ │ function returns, or else it will end up dangling.
│ │ │ │ This method guarantees that for the purpose of the aliasing model, this method
│ │ │ │ does not materialize a reference to the underlying memory, and thus the returned pointer
│ │ │ │ will remain valid when mixed with other calls to as_ptr
and as_mut_ptr
.
│ │ │ │ Note that calling other methods that materialize references to the memory
│ │ │ │ may still invalidate this pointer.
│ │ │ │ @@ -745,15 +745,15 @@
│ │ │ │ let ptr1 = Box::as_mut_ptr(&mut b);
│ │ │ │ ptr1.write(1);
│ │ │ │ let ptr2 = Box::as_mut_ptr(&mut b);
│ │ │ │ ptr2.write(2);
│ │ │ │ // Notably, the write to `ptr2` did *not* invalidate `ptr1`:
│ │ │ │ ptr1.write(3);
│ │ │ │ }
│ │ │ │ -Sourcepub fn as_ptr(b: &Self) -> *const T
🔬This is a nightly-only experimental API. (box_as_ptr
#129090)
Returns a raw pointer to the Box
’s contents.
│ │ │ │ +Sourcepub fn as_ptr(b: &Self) -> *const T
🔬This is a nightly-only experimental API. (box_as_ptr
#129090)
Returns a raw pointer to the Box
’s contents.
│ │ │ │ The caller must ensure that the Box
outlives the pointer this
│ │ │ │ function returns, or else it will end up dangling.
│ │ │ │ The caller must also ensure that the memory the pointer (non-transitively) points to
│ │ │ │ is never written to (except inside an UnsafeCell
) using this pointer or any pointer
│ │ │ │ derived from it. If you need to mutate the contents of the Box
, use as_mut_ptr
.
│ │ │ │ This method guarantees that for the purpose of the aliasing model, this method
│ │ │ │ does not materialize a reference to the underlying memory, and thus the returned pointer
│ │ │ │ @@ -774,19 +774,19 @@
│ │ │ │ // No write to this memory has happened yet, so `ptr1` is still valid.
│ │ │ │ let _val = ptr1.read();
│ │ │ │ // However, once we do a write...
│ │ │ │ ptr2.write(1);
│ │ │ │ // ... `ptr1` is no longer valid.
│ │ │ │ // This would be UB: let _val = ptr1.read();
│ │ │ │ }
│ │ │ │ -Sourcepub const fn allocator(b: &Self) -> &A
🔬This is a nightly-only experimental API. (allocator_api
#32838)
Returns a reference to the underlying allocator.
│ │ │ │ +Sourcepub const fn allocator(b: &Self) -> &A
🔬This is a nightly-only experimental API. (allocator_api
#32838)
Returns a reference to the underlying allocator.
│ │ │ │ Note: this is an associated function, which means that you have
│ │ │ │ to call it as Box::allocator(&b)
instead of b.allocator()
. This
│ │ │ │ is so that there is no conflict with a method on the inner type.
│ │ │ │ -1.26.0 · Sourcepub fn leak<'a>(b: Self) -> &'a mut Twhere
│ │ │ │ A: 'a,
Consumes and leaks the Box
, returning a mutable reference,
│ │ │ │ &'a mut T
.
│ │ │ │ Note that the type T
must outlive the chosen lifetime 'a
. If the type
│ │ │ │ has only static references, or none at all, then this may be chosen to be
│ │ │ │ 'static
.
│ │ │ │ This function is mainly useful for data that lives for the remainder of
│ │ │ │ the program’s life. Dropping the returned reference will cause a memory
│ │ │ │ @@ -806,19 +806,19 @@
│ │ │ │ assert_eq!(*static_ref, 42);
│ │ │ │ Unsized data:
│ │ │ │
│ │ │ │
│ │ │ │ -1.63.0 (const: unstable) · Sourcepub fn into_pin(boxed: Self) -> Pin<Self>where
│ │ │ │ - A: 'static,
Converts a Box<T>
into a Pin<Box<T>>
. If T
does not implement Unpin
, then
│ │ │ │ +
1.63.0 (const: unstable) · Sourcepub fn into_pin(boxed: Self) -> Pin<Self>where
│ │ │ │ + A: 'static,
Converts a Box<T>
into a Pin<Box<T>>
. If T
does not implement Unpin
, then
│ │ │ │ *boxed
will be pinned in memory and unable to be moved.
│ │ │ │ This conversion does not allocate on the heap and happens in place.
│ │ │ │ -This is also available via From
.
│ │ │ │ +This is also available via From
.
│ │ │ │ Constructing and pinning a Box
with Box::into_pin(Box::new(x))
│ │ │ │ can also be written more concisely using Box::pin(x)
.
│ │ │ │ This into_pin
method is useful if you already have a Box<T>
, or you are
│ │ │ │ constructing a (pinned) Box
in a different way than with Box::new
.
│ │ │ │ §Notes
│ │ │ │ It’s not recommended that crates add an impl like From<Box<T>> for Pin<T>
,
│ │ │ │ as it’ll introduce an ambiguity when calling Pin::from
.
│ │ │ │ @@ -829,231 +829,231 @@
│ │ │ │ fn from(_: Box<()>) -> Pin<Foo> {
│ │ │ │ Pin::new(Foo)
│ │ │ │ }
│ │ │ │ }
│ │ │ │
│ │ │ │ let foo = Box::new(());
│ │ │ │ let bar = Pin::from(foo);
│ │ │ │ -Trait Implementations§
Trait Implementations§
1.85.0 · Source§impl<Args: Tuple, F: AsyncFn<Args> + ?Sized, A: Allocator> AsyncFn<Args> for Box<F, A>
Source§extern "rust-call" fn async_call(
│ │ │ │ &self,
│ │ │ │ args: Args,
│ │ │ │ -) -> Self::CallRefFuture<'_>
🔬This is a nightly-only experimental API. (async_fn_traits
)Call the AsyncFn
, returning a future which may borrow from the called closure.1.85.0 · Source§impl<Args: Tuple, F: AsyncFnMut<Args> + ?Sized, A: Allocator> AsyncFnMut<Args> for Box<F, A>
Source§type CallRefFuture<'a> = <F as AsyncFnMut<Args>>::CallRefFuture<'a>
│ │ │ │ +) -> Self::CallRefFuture<'_>
🔬This is a nightly-only experimental API. (async_fn_traits
)Call the AsyncFn
, returning a future which may borrow from the called closure.1.85.0 · Source§impl<Args: Tuple, F: AsyncFnMut<Args> + ?Sized, A: Allocator> AsyncFnMut<Args> for Box<F, A>
Source§type CallRefFuture<'a> = <F as AsyncFnMut<Args>>::CallRefFuture<'a>
│ │ │ │ where
│ │ │ │ - Self: 'a
🔬This is a nightly-only experimental API. (async_fn_traits
)Future returned by AsyncFnMut::async_call_mut
and AsyncFn::async_call
.Source§extern "rust-call" fn async_call_mut(
│ │ │ │ + Self: 'a
🔬This is a nightly-only experimental API. (async_fn_traits
)Future returned by AsyncFnMut::async_call_mut
and AsyncFn::async_call
.Source§extern "rust-call" fn async_call_mut(
│ │ │ │ &mut self,
│ │ │ │ args: Args,
│ │ │ │ -) -> Self::CallRefFuture<'_>
🔬This is a nightly-only experimental API. (async_fn_traits
)Call the AsyncFnMut
, returning a future which may borrow from the called closure.1.85.0 · Source§impl<Args: Tuple, F: AsyncFnOnce<Args> + ?Sized, A: Allocator> AsyncFnOnce<Args> for Box<F, A>
Source§type Output = <F as AsyncFnOnce<Args>>::Output
🔬This is a nightly-only experimental API. (async_fn_traits
)Output type of the called closure’s future.Source§type CallOnceFuture = <F as AsyncFnOnce<Args>>::CallOnceFuture
🔬This is a nightly-only experimental API. (async_fn_traits
)Future returned by AsyncFnOnce::async_call_once
.Source§extern "rust-call" fn async_call_once(
│ │ │ │ +) -> Self::CallRefFuture<'_>
🔬This is a nightly-only experimental API. (async_fn_traits
)Call the AsyncFnMut
, returning a future which may borrow from the called closure.1.85.0 · Source§impl<Args: Tuple, F: AsyncFnOnce<Args> + ?Sized, A: Allocator> AsyncFnOnce<Args> for Box<F, A>
Source§type Output = <F as AsyncFnOnce<Args>>::Output
🔬This is a nightly-only experimental API. (async_fn_traits
)Output type of the called closure’s future.Source§type CallOnceFuture = <F as AsyncFnOnce<Args>>::CallOnceFuture
🔬This is a nightly-only experimental API. (async_fn_traits
)Future returned by AsyncFnOnce::async_call_once
.Source§extern "rust-call" fn async_call_once(
│ │ │ │ self,
│ │ │ │ args: Args,
│ │ │ │ -) -> Self::CallOnceFuture
🔬This is a nightly-only experimental API. (async_fn_traits
)Call the AsyncFnOnce
, returning a future which may move out of the called closure.Source§impl<S: ?Sized + AsyncIterator + Unpin> AsyncIterator for Box<S>
Source§type Item = <S as AsyncIterator>::Item
🔬This is a nightly-only experimental API. (async_iterator
#79024)The type of items yielded by the async iterator.Source§fn poll_next(
│ │ │ │ - self: Pin<&mut Self>,
│ │ │ │ - cx: &mut Context<'_>,
│ │ │ │ -) -> Poll<Option<Self::Item>>
🔬This is a nightly-only experimental API. (async_iterator
#79024)Attempts to pull out the next value of this async iterator, registering the
│ │ │ │ +) -> Self::CallOnceFuture🔬This is a nightly-only experimental API. (async_fn_traits
)Call the AsyncFnOnce
, returning a future which may move out of the called closure.Source§impl<S: ?Sized + AsyncIterator + Unpin> AsyncIterator for Box<S>
Source§type Item = <S as AsyncIterator>::Item
🔬This is a nightly-only experimental API. (async_iterator
#79024)The type of items yielded by the async iterator.Source§fn poll_next(
│ │ │ │ + self: Pin<&mut Self>,
│ │ │ │ + cx: &mut Context<'_>,
│ │ │ │ +) -> Poll<Option<Self::Item>>
🔬This is a nightly-only experimental API. (async_iterator
#79024)Attempts to pull out the next value of this async iterator, registering the
│ │ │ │ current task for wakeup if the value is not yet available, and returning
│ │ │ │ -None
if the async iterator is exhausted. Read more1.1.0 · Source§impl<T: ?Sized, A: Allocator> BorrowMut<T> for Box<T, A>
Source§fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more1.3.0 · Source§impl<T: Clone, A: Allocator + Clone> Clone for Box<[T], A>
Source§fn clone_from(&mut self, source: &Self)
Copies source
’s contents into self
without creating a new allocation,
│ │ │ │ +None
if the async iterator is exhausted. Read more
1.1.0 · Source§impl<T: ?Sized, A: Allocator> BorrowMut<T> for Box<T, A>
Source§fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more1.3.0 · Source§impl<T: Clone, A: Allocator + Clone> Clone for Box<[T], A>
Source§fn clone_from(&mut self, source: &Self)
Copies source
’s contents into self
without creating a new allocation,
│ │ │ │ so long as the two are of the same length.
│ │ │ │ §Examples
│ │ │ │
│ │ │ │ -1.0.0 · Source§impl<T: Clone, A: Allocator + Clone> Clone for Box<T, A>
Source§fn clone(&self) -> Self
Returns a new box with a clone()
of this box’s contents.
│ │ │ │ §Examples
│ │ │ │
│ │ │ │ -Source§fn clone_from(&mut self, source: &Self)
Copies source
’s contents into self
without creating a new allocation.
│ │ │ │ +Source§fn clone_from(&mut self, source: &Self)
Copies source
’s contents into self
without creating a new allocation.
│ │ │ │ §Examples
│ │ │ │
│ │ │ │ -Source§impl<G: ?Sized + Coroutine<R> + Unpin, R, A: Allocator> Coroutine<R> for Box<G, A>
Source§type Yield = <G as Coroutine<R>>::Yield
🔬This is a nightly-only experimental API. (coroutine_trait
#43122)The type of value this coroutine yields. Read moreSource§impl<G: ?Sized + Coroutine<R> + Unpin, R, A: Allocator> Coroutine<R> for Box<G, A>
Source§type Yield = <G as Coroutine<R>>::Yield
🔬This is a nightly-only experimental API. (coroutine_trait
#43122)The type of value this coroutine yields. Read moreSource§impl<G: ?Sized + Coroutine<R>, R, A> Coroutine<R> for Pin<Box<G, A>>where
│ │ │ │ - A: 'static + Allocator,
Source§type Yield = <G as Coroutine<R>>::Yield
🔬This is a nightly-only experimental API. (coroutine_trait
#43122)The type of value this coroutine yields. Read moreSource§impl<G: ?Sized + Coroutine<R>, R, A> Coroutine<R> for Pin<Box<G, A>>where
│ │ │ │ + A: 'static + Allocator,
Source§type Yield = <G as Coroutine<R>>::Yield
🔬This is a nightly-only experimental API. (coroutine_trait
#43122)The type of value this coroutine yields. Read more1.0.0 · Source§impl<I: DoubleEndedIterator + ?Sized, A: Allocator> DoubleEndedIterator for Box<I, A>
Source§fn next_back(&mut self) -> Option<I::Item>
Removes and returns an element from the end of the iterator. Read moreSource§fn nth_back(&mut self, n: usize) -> Option<I::Item>
Returns the n
th element from the end of the iterator. Read moreSource§fn advance_back_by(&mut self, n: usize) -> Result<(), NonZero<usize>>
🔬This is a nightly-only experimental API. (iter_advance_by
#77404)Advances the iterator from the back by n
elements. Read more1.27.0 · Source§fn try_rfold<B, F, R>(&mut self, init: B, f: F) -> R
This is the reverse version of Iterator::try_fold()
: it takes
│ │ │ │ -elements starting from the back of the iterator. Read more1.8.0 · Source§impl<E: Error> Error for Box<E>
Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()Source§fn cause(&self) -> Option<&dyn Error>
👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting1.0.0 · Source§impl<I: ExactSizeIterator + ?Sized, A: Allocator> ExactSizeIterator for Box<I, A>
1.45.0 · Source§impl<A: Allocator> Extend<Box<str, A>> for String
1.35.0 · Source§impl<Args: Tuple, F: FnOnce<Args> + ?Sized, A: Allocator> FnOnce<Args> for Box<F, A>
1.17.0 · Source§impl<T: Clone> From<&[T]> for Box<[T]>
Source§fn from(slice: &[T]) -> Box<[T]>
Converts a &[T]
into a Box<[T]>
│ │ │ │ +) -> CoroutineState<Self::Yield, Self::Return>🔬This is a nightly-only experimental API. (coroutine_trait
#43122)Resumes the execution of this coroutine. Read more1.0.0 · Source§impl<I: DoubleEndedIterator + ?Sized, A: Allocator> DoubleEndedIterator for Box<I, A>
Source§fn next_back(&mut self) -> Option<I::Item>
Removes and returns an element from the end of the iterator. Read moreSource§fn nth_back(&mut self, n: usize) -> Option<I::Item>
Returns the n
th element from the end of the iterator. Read moreSource§fn advance_back_by(&mut self, n: usize) -> Result<(), NonZero<usize>>
🔬This is a nightly-only experimental API. (iter_advance_by
#77404)Advances the iterator from the back by n
elements. Read more1.27.0 · Source§fn try_rfold<B, F, R>(&mut self, init: B, f: F) -> R
This is the reverse version of Iterator::try_fold()
: it takes
│ │ │ │ +elements starting from the back of the iterator. Read more1.8.0 · Source§impl<E: Error> Error for Box<E>
Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()Source§fn cause(&self) -> Option<&dyn Error>
👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting1.0.0 · Source§impl<I: ExactSizeIterator + ?Sized, A: Allocator> ExactSizeIterator for Box<I, A>
1.45.0 · Source§impl<A: Allocator> Extend<Box<str, A>> for String
1.35.0 · Source§impl<Args: Tuple, F: FnOnce<Args> + ?Sized, A: Allocator> FnOnce<Args> for Box<F, A>
1.17.0 · Source§impl<T: Clone> From<&[T]> for Box<[T]>
1.84.0 · Source§impl<T: Clone> From<&mut [T]> for Box<[T]>
1.84.0 · Source§impl From<&mut str> for Box<str>
1.6.0 · Source§impl<'a> From<&str> for Box<dyn Error + 'a>
1.0.0 · Source§impl<'a> From<&str> for Box<dyn Error + Send + Sync + 'a>
1.33.0 · Source§impl<T: ?Sized, A> From<Box<T, A>> for Pin<Box<T, A>>where
│ │ │ │ - A: 'static + Allocator,
1.33.0 · Source§impl<T: ?Sized, A> From<Box<T, A>> for Pin<Box<T, A>>where
│ │ │ │ + A: 'static + Allocator,
Source§fn from(boxed: Box<T, A>) -> Self
Converts a Box<T>
into a Pin<Box<T>>
. If T
does not implement Unpin
, then
│ │ │ │ *boxed
will be pinned in memory and unable to be moved.
│ │ │ │ This conversion does not allocate on the heap and happens in place.
│ │ │ │ This is also available via Box::into_pin
.
│ │ │ │ Constructing and pinning a Box
with <Pin<Box<T>>>::from(Box::new(x))
│ │ │ │ can also be written more concisely using Box::pin(x)
.
│ │ │ │ This From
implementation is useful if you already have a Box<T>
, or you are
│ │ │ │ constructing a (pinned) Box
in a different way than with Box::new
.
│ │ │ │ -1.18.0 · Source§impl From<Box<str>> for String
1.19.0 · Source§impl<A: Allocator> From<Box<str, A>> for Box<[u8], A>
Source§fn from(s: Box<str, A>) -> Self
Converts a Box<str>
into a Box<[u8]>
│ │ │ │ This conversion does not allocate on the heap and happens in place.
│ │ │ │ §Examples
│ │ │ │ // create a Box<str> which will be used to create a Box<[u8]>
│ │ │ │ let boxed: Box<str> = Box::from("hello");
│ │ │ │ let boxed_str: Box<[u8]> = Box::from(boxed);
│ │ │ │
│ │ │ │ // create a &[u8] which will be used to create a Box<[u8]>
│ │ │ │ let slice: &[u8] = &[104, 101, 108, 108, 111];
│ │ │ │ let boxed_slice = Box::from(slice);
│ │ │ │
│ │ │ │ assert_eq!(boxed_slice, boxed_str);
│ │ │ │ -1.45.0 · Source§impl From<Cow<'_, str>> for Box<str>
Source§fn from(cow: Cow<'_, str>) -> Box<str>
Converts a Cow<'_, str>
into a Box<str>
│ │ │ │ When cow
is the Cow::Borrowed
variant, this
│ │ │ │ conversion allocates on the heap and copies the
│ │ │ │ underlying str
. Otherwise, it will try to reuse the owned
│ │ │ │ String
’s allocation.
│ │ │ │ §Examples
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -1.22.0 · Source§impl<'a, 'b> From<Cow<'b, str>> for Box<dyn Error + 'a>
1.22.0 · Source§impl<'a, 'b> From<Cow<'b, str>> for Box<dyn Error + Send + Sync + 'a>
Source§fn from(err: Cow<'b, str>) -> Box<dyn Error + Send + Sync + 'a>
Converts a Cow
into a box of dyn Error
+ Send
+ Sync
.
│ │ │ │ §Examples
│ │ │ │ use std::error::Error;
│ │ │ │ use std::mem;
│ │ │ │ use std::borrow::Cow;
│ │ │ │
│ │ │ │ let a_cow_str_error = Cow::from("a str error");
│ │ │ │ let a_boxed_error = Box::<dyn Error + Send + Sync>::from(a_cow_str_error);
│ │ │ │ assert!(
│ │ │ │ mem::size_of::<Box<dyn Error + Send + Sync>>() == mem::size_of_val(&a_boxed_error))
│ │ │ │ -1.0.0 · Source§impl<'a, E: Error + 'a> From<E> for Box<dyn Error + 'a>
Source§fn from(err: E) -> Box<dyn Error + 'a>
Converts a type of Error
into a box of dyn Error
.
│ │ │ │ §Examples
│ │ │ │ use std::error::Error;
│ │ │ │ use std::fmt;
│ │ │ │ use std::mem;
│ │ │ │
│ │ │ │ #[derive(Debug)]
│ │ │ │ struct AnError;
│ │ │ │ @@ -1066,16 +1066,16 @@
│ │ │ │
│ │ │ │ impl Error for AnError {}
│ │ │ │
│ │ │ │ let an_error = AnError;
│ │ │ │ assert!(0 == mem::size_of_val(&an_error));
│ │ │ │ let a_boxed_error = Box::<dyn Error>::from(an_error);
│ │ │ │ assert!(mem::size_of::<Box<dyn Error>>() == mem::size_of_val(&a_boxed_error))
│ │ │ │ -1.0.0 · Source§impl<'a, E: Error + Send + Sync + 'a> From<E> for Box<dyn Error + Send + Sync + 'a>
Source§fn from(err: E) -> Box<dyn Error + Send + Sync + 'a>
Converts a type of Error
+ Send
+ Sync
into a box of
│ │ │ │ +dyn Error
+ Send
+ Sync
.
│ │ │ │ §Examples
│ │ │ │ use std::error::Error;
│ │ │ │ use std::fmt;
│ │ │ │ use std::mem;
│ │ │ │
│ │ │ │ #[derive(Debug)]
│ │ │ │ struct AnError;
│ │ │ │ @@ -1093,321 +1093,321 @@
│ │ │ │ unsafe impl Sync for AnError {}
│ │ │ │
│ │ │ │ let an_error = AnError;
│ │ │ │ assert!(0 == mem::size_of_val(&an_error));
│ │ │ │ let a_boxed_error = Box::<dyn Error + Send + Sync>::from(an_error);
│ │ │ │ assert!(
│ │ │ │ mem::size_of::<Box<dyn Error + Send + Sync>>() == mem::size_of_val(&a_boxed_error))
│ │ │ │ -1.6.0 · Source§impl<'a> From<String> for Box<dyn Error + 'a>
1.0.0 · Source§impl<'a> From<String> for Box<dyn Error + Send + Sync + 'a>
Source§fn from(err: String) -> Box<dyn Error + Send + Sync + 'a>
Converts a String
into a box of dyn Error
+ Send
+ Sync
.
│ │ │ │ §Examples
│ │ │ │ use std::error::Error;
│ │ │ │ use std::mem;
│ │ │ │
│ │ │ │ let a_string_error = "a string error".to_string();
│ │ │ │ let a_boxed_error = Box::<dyn Error + Send + Sync>::from(a_string_error);
│ │ │ │ assert!(
│ │ │ │ mem::size_of::<Box<dyn Error + Send + Sync>>() == mem::size_of_val(&a_boxed_error))
│ │ │ │ -1.20.0 · Source§impl<T, A: Allocator> From<Vec<T, A>> for Box<[T], A>
1.32.0 · Source§impl<I> FromIterator<I> for Box<[I]>
Source§fn from_iter<T: IntoIterator<Item = I>>(iter: T) -> Self
Creates a value from an iterator. Read more1.22.0 · Source§impl<T: ?Sized + Hasher, A: Allocator> Hasher for Box<T, A>
Source§fn write_u128(&mut self, i: u128)
Writes a single u128
into this hasher.Source§fn write_usize(&mut self, i: usize)
Writes a single usize
into this hasher.Source§fn write_i128(&mut self, i: i128)
Writes a single i128
into this hasher.Source§fn write_isize(&mut self, i: isize)
Writes a single isize
into this hasher.1.0.0 · Source§impl<I: Iterator + ?Sized, A: Allocator> Iterator for Box<I, A>
Source§fn next(&mut self) -> Option<I::Item>
Advances the iterator and returns the next value. Read moreSource§fn size_hint(&self) -> (usize, Option<usize>)
Returns the bounds on the remaining length of the iterator. Read moreSource§fn nth(&mut self, n: usize) -> Option<I::Item>
Returns the n
th element of the iterator. Read moreSource§fn next_chunk<const N: usize>(
│ │ │ │ +
1.32.0 · Source§impl<I> FromIterator<I> for Box<[I]>
Source§fn from_iter<T: IntoIterator<Item = I>>(iter: T) -> Self
Creates a value from an iterator. Read more1.22.0 · Source§impl<T: ?Sized + Hasher, A: Allocator> Hasher for Box<T, A>
Source§fn write_u128(&mut self, i: u128)
Writes a single u128
into this hasher.Source§fn write_usize(&mut self, i: usize)
Writes a single usize
into this hasher.Source§fn write_i128(&mut self, i: i128)
Writes a single i128
into this hasher.Source§fn write_isize(&mut self, i: isize)
Writes a single isize
into this hasher.1.0.0 · Source§impl<I: Iterator + ?Sized, A: Allocator> Iterator for Box<I, A>
Source§fn next(&mut self) -> Option<I::Item>
Advances the iterator and returns the next value. Read moreSource§fn size_hint(&self) -> (usize, Option<usize>)
Returns the bounds on the remaining length of the iterator. Read moreSource§fn nth(&mut self, n: usize) -> Option<I::Item>
Returns the n
th element of the iterator. Read moreSource§fn next_chunk<const N: usize>(
│ │ │ │ &mut self,
│ │ │ │ -) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>where
│ │ │ │ - Self: Sized,
🔬This is a nightly-only experimental API. (iter_next_chunk
#98326)Advances the iterator and returns an array containing the next N
values. Read more1.0.0 · Source§fn count(self) -> usizewhere
│ │ │ │ - Self: Sized,
Consumes the iterator, counting the number of iterations and returning it. Read moreSource§fn advance_by(&mut self, n: usize) -> Result<(), NonZero<usize>>
🔬This is a nightly-only experimental API. (iter_advance_by
#77404)Advances the iterator by n
elements. Read more1.28.0 · Source§fn step_by(self, step: usize) -> StepBy<Self>where
│ │ │ │ - Self: Sized,
Creates an iterator starting at the same point, but stepping by
│ │ │ │ -the given amount at each iteration. Read more1.0.0 · Source§fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>
Takes two iterators and creates a new iterator over both in sequence. Read more1.0.0 · Source§fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>where
│ │ │ │ - Self: Sized,
│ │ │ │ - U: IntoIterator,
‘Zips up’ two iterators into a single iterator of pairs. Read moreSource§fn intersperse(self, separator: Self::Item) -> Intersperse<Self>
🔬This is a nightly-only experimental API. (iter_intersperse
#79524)Creates a new iterator which places a copy of separator
between adjacent
│ │ │ │ -items of the original iterator. Read moreSource§fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G>
🔬This is a nightly-only experimental API. (iter_intersperse
#79524)Creates a new iterator which places an item generated by separator
│ │ │ │ -between adjacent items of the original iterator. Read more1.0.0 · Source§fn map<B, F>(self, f: F) -> Map<Self, F>
Takes a closure and creates an iterator which calls that closure on each
│ │ │ │ -element. Read more1.0.0 · Source§fn filter<P>(self, predicate: P) -> Filter<Self, P>
Creates an iterator which uses a closure to determine if an element
│ │ │ │ -should be yielded. Read more1.0.0 · Source§fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>
Creates an iterator that both filters and maps. Read more1.0.0 · Source§fn enumerate(self) -> Enumerate<Self>where
│ │ │ │ - Self: Sized,
Creates an iterator which gives the current iteration count as well as
│ │ │ │ -the next value. Read more1.0.0 · Source§fn peekable(self) -> Peekable<Self>where
│ │ │ │ - Self: Sized,
Creates an iterator which can use the peek
and peek_mut
methods
│ │ │ │ +) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>where
│ │ │ │ + Self: Sized,🔬This is a nightly-only experimental API. (iter_next_chunk
#98326)Advances the iterator and returns an array containing the next N
values. Read more1.0.0 · Source§fn count(self) -> usizewhere
│ │ │ │ + Self: Sized,
Consumes the iterator, counting the number of iterations and returning it. Read moreSource§fn advance_by(&mut self, n: usize) -> Result<(), NonZero<usize>>
🔬This is a nightly-only experimental API. (iter_advance_by
#77404)Advances the iterator by n
elements. Read more1.28.0 · Source§fn step_by(self, step: usize) -> StepBy<Self>where
│ │ │ │ + Self: Sized,
Creates an iterator starting at the same point, but stepping by
│ │ │ │ +the given amount at each iteration. Read more1.0.0 · Source§fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>
Takes two iterators and creates a new iterator over both in sequence. Read more1.0.0 · Source§fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>where
│ │ │ │ + Self: Sized,
│ │ │ │ + U: IntoIterator,
‘Zips up’ two iterators into a single iterator of pairs. Read moreSource§fn intersperse(self, separator: Self::Item) -> Intersperse<Self>
🔬This is a nightly-only experimental API. (iter_intersperse
#79524)Creates a new iterator which places a copy of separator
between adjacent
│ │ │ │ +items of the original iterator. Read moreSource§fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G>
🔬This is a nightly-only experimental API. (iter_intersperse
#79524)Creates a new iterator which places an item generated by separator
│ │ │ │ +between adjacent items of the original iterator. Read more1.0.0 · Source§fn map<B, F>(self, f: F) -> Map<Self, F>
Takes a closure and creates an iterator which calls that closure on each
│ │ │ │ +element. Read more1.0.0 · Source§fn filter<P>(self, predicate: P) -> Filter<Self, P>
Creates an iterator which uses a closure to determine if an element
│ │ │ │ +should be yielded. Read more1.0.0 · Source§fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>
Creates an iterator that both filters and maps. Read more1.0.0 · Source§fn enumerate(self) -> Enumerate<Self>where
│ │ │ │ + Self: Sized,
Creates an iterator which gives the current iteration count as well as
│ │ │ │ +the next value. Read more1.0.0 · Source§fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>
1.0.0 · Source§fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>
Creates an iterator that yields elements based on a predicate. Read more1.57.0 · Source§fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P>
Creates an iterator that both yields elements based on a predicate and maps. Read more1.0.0 · Source§fn skip(self, n: usize) -> Skip<Self>where
│ │ │ │ - Self: Sized,
Creates an iterator that skips the first n
elements. Read more1.0.0 · Source§fn take(self, n: usize) -> Take<Self>where
│ │ │ │ - Self: Sized,
Creates an iterator that yields the first n
elements, or fewer
│ │ │ │ -if the underlying iterator ends sooner. Read more1.0.0 · Source§fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>
Creates an iterator that works like map, but flattens nested structure. Read more1.29.0 · Source§fn flatten(self) -> Flatten<Self>
Creates an iterator that flattens nested structure. Read moreSource§fn map_windows<F, R, const N: usize>(self, f: F) -> MapWindows<Self, F, N>
🔬This is a nightly-only experimental API. (iter_map_windows
#87155)Calls the given function f
for each contiguous window of size N
over
│ │ │ │ -self
and returns an iterator over the outputs of f
. Like slice::windows()
,
│ │ │ │ -the windows during mapping overlap as well. Read more1.0.0 · Source§fn inspect<F>(self, f: F) -> Inspect<Self, F>
Does something with each element of an iterator, passing the value on. Read more1.0.0 · Source§fn by_ref(&mut self) -> &mut Selfwhere
│ │ │ │ - Self: Sized,
Borrows an iterator, rather than consuming it. Read moreSource§fn try_collect<B>(
│ │ │ │ +their documentation for more information. Read more
1.0.0 · Source§fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>
1.0.0 · Source§fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>
Creates an iterator that yields elements based on a predicate. Read more1.57.0 · Source§fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P>
Creates an iterator that both yields elements based on a predicate and maps. Read more1.0.0 · Source§fn skip(self, n: usize) -> Skip<Self>where
│ │ │ │ + Self: Sized,
Creates an iterator that skips the first n
elements. Read more1.0.0 · Source§fn take(self, n: usize) -> Take<Self>where
│ │ │ │ + Self: Sized,
Creates an iterator that yields the first n
elements, or fewer
│ │ │ │ +if the underlying iterator ends sooner. Read more1.0.0 · Source§fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>
Creates an iterator that works like map, but flattens nested structure. Read more1.29.0 · Source§fn flatten(self) -> Flatten<Self>
Creates an iterator that flattens nested structure. Read moreSource§fn map_windows<F, R, const N: usize>(self, f: F) -> MapWindows<Self, F, N>
🔬This is a nightly-only experimental API. (iter_map_windows
#87155)Calls the given function f
for each contiguous window of size N
over
│ │ │ │ +self
and returns an iterator over the outputs of f
. Like slice::windows()
,
│ │ │ │ +the windows during mapping overlap as well. Read more1.0.0 · Source§fn inspect<F>(self, f: F) -> Inspect<Self, F>
Does something with each element of an iterator, passing the value on. Read more1.0.0 · Source§fn by_ref(&mut self) -> &mut Selfwhere
│ │ │ │ + Self: Sized,
Borrows an iterator, rather than consuming it. Read moreSource§fn try_collect<B>(
│ │ │ │ &mut self,
│ │ │ │ -) -> <<Self::Item as Try>::Residual as Residual<B>>::TryType
🔬This is a nightly-only experimental API. (iterator_try_collect
#94047)Fallibly transforms an iterator into a collection, short circuiting if
│ │ │ │ -a failure is encountered. Read moreSource§fn collect_into<E>(self, collection: &mut E) -> &mut E
🔬This is a nightly-only experimental API. (iter_collect_into
#94780)Collects all the items from an iterator into a collection. Read more1.0.0 · Source§fn partition<B, F>(self, f: F) -> (B, B)
Consumes an iterator, creating two collections from it. Read moreSource§fn partition_in_place<'a, T, P>(self, predicate: P) -> usizewhere
│ │ │ │ +) -> <<Self::Item as Try>::Residual as Residual<B>>::TryTypewhere
│ │ │ │ + Self: Sized,
│ │ │ │ + Self::Item: Try,
│ │ │ │ + <Self::Item as Try>::Residual: Residual<B>,
│ │ │ │ + B: FromIterator<<Self::Item as Try>::Output>,🔬This is a nightly-only experimental API. (iterator_try_collect
#94047)Fallibly transforms an iterator into a collection, short circuiting if
│ │ │ │ +a failure is encountered. Read moreSource§fn collect_into<E>(self, collection: &mut E) -> &mut E
🔬This is a nightly-only experimental API. (iter_collect_into
#94780)Collects all the items from an iterator into a collection. Read more1.0.0 · Source§fn partition<B, F>(self, f: F) -> (B, B)
Consumes an iterator, creating two collections from it. Read moreSource§fn partition_in_place<'a, T, P>(self, predicate: P) -> usize
🔬This is a nightly-only experimental API. (iter_partition_in_place
#62543)Reorders the elements of this iterator in-place according to the given predicate,
│ │ │ │ + Self: Sized + DoubleEndedIterator<Item = &'a mut T>,
│ │ │ │ + P: FnMut(&T) -> bool,🔬This is a nightly-only experimental API. (iter_partition_in_place
#62543)Reorders the elements of this iterator in-place according to the given predicate,
│ │ │ │ such that all those that return true
precede all those that return false
.
│ │ │ │ -Returns the number of true
elements found. Read moreSource§fn is_partitioned<P>(self, predicate: P) -> bool
🔬This is a nightly-only experimental API. (iter_is_partitioned
#62544)Checks if the elements of this iterator are partitioned according to the given predicate,
│ │ │ │ -such that all those that return true
precede all those that return false
. Read more1.27.0 · Source§fn try_fold<B, F, R>(&mut self, init: B, f: F) -> R
An iterator method that applies a function as long as it returns
│ │ │ │ -successfully, producing a single, final value. Read more1.27.0 · Source§fn try_for_each<F, R>(&mut self, f: F) -> R
An iterator method that applies a fallible function to each item in the
│ │ │ │ -iterator, stopping at the first error and returning that error. Read more1.0.0 · Source§fn fold<B, F>(self, init: B, f: F) -> B
Folds every element into an accumulator by applying an operation,
│ │ │ │ -returning the final result. Read more1.51.0 · Source§fn reduce<F>(self, f: F) -> Option<Self::Item>
Reduces the elements to a single one, by repeatedly applying a reducing
│ │ │ │ -operation. Read moreSource§fn try_reduce<R>(
│ │ │ │ +Returns the number of true
elements found. Read more
Source§fn is_partitioned<P>(self, predicate: P) -> bool
🔬This is a nightly-only experimental API. (iter_is_partitioned
#62544)Checks if the elements of this iterator are partitioned according to the given predicate,
│ │ │ │ +such that all those that return true
precede all those that return false
. Read more1.27.0 · Source§fn try_fold<B, F, R>(&mut self, init: B, f: F) -> R
An iterator method that applies a function as long as it returns
│ │ │ │ +successfully, producing a single, final value. Read more1.27.0 · Source§fn try_for_each<F, R>(&mut self, f: F) -> R
An iterator method that applies a fallible function to each item in the
│ │ │ │ +iterator, stopping at the first error and returning that error. Read more1.0.0 · Source§fn fold<B, F>(self, init: B, f: F) -> B
Folds every element into an accumulator by applying an operation,
│ │ │ │ +returning the final result. Read more1.51.0 · Source§fn reduce<F>(self, f: F) -> Option<Self::Item>
Reduces the elements to a single one, by repeatedly applying a reducing
│ │ │ │ +operation. Read moreSource§fn try_reduce<R>(
│ │ │ │ &mut self,
│ │ │ │ - f: impl FnMut(Self::Item, Self::Item) -> R,
│ │ │ │ -) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryType
🔬This is a nightly-only experimental API. (iterator_try_reduce
#87053)Reduces the elements to a single one by repeatedly applying a reducing operation. If the
│ │ │ │ -closure returns a failure, the failure is propagated back to the caller immediately. Read more1.0.0 · Source§fn all<F>(&mut self, f: F) -> bool
Tests if every element of the iterator matches a predicate. Read more1.0.0 · Source§fn any<F>(&mut self, f: F) -> bool
Tests if any element of the iterator matches a predicate. Read more1.0.0 · Source§fn find<P>(&mut self, predicate: P) -> Option<Self::Item>
Searches for an element of an iterator that satisfies a predicate. Read more1.30.0 · Source§fn find_map<B, F>(&mut self, f: F) -> Option<B>
Applies function to the elements of iterator and returns
│ │ │ │ -the first non-none result. Read moreSource§fn try_find<R>(
│ │ │ │ + f: impl FnMut(Self::Item, Self::Item) -> R,
│ │ │ │ +) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryType
🔬This is a nightly-only experimental API. (iterator_try_reduce
#87053)Reduces the elements to a single one by repeatedly applying a reducing operation. If the
│ │ │ │ +closure returns a failure, the failure is propagated back to the caller immediately. Read more1.0.0 · Source§fn all<F>(&mut self, f: F) -> bool
Tests if every element of the iterator matches a predicate. Read more1.0.0 · Source§fn any<F>(&mut self, f: F) -> bool
Tests if any element of the iterator matches a predicate. Read more1.0.0 · Source§fn find<P>(&mut self, predicate: P) -> Option<Self::Item>
Searches for an element of an iterator that satisfies a predicate. Read more1.30.0 · Source§fn find_map<B, F>(&mut self, f: F) -> Option<B>
Applies function to the elements of iterator and returns
│ │ │ │ +the first non-none result. Read moreSource§fn try_find<R>(
│ │ │ │ &mut self,
│ │ │ │ - f: impl FnMut(&Self::Item) -> R,
│ │ │ │ -) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryType
🔬This is a nightly-only experimental API. (try_find
#63178)Applies function to the elements of iterator and returns
│ │ │ │ -the first true result or the first error. Read more1.0.0 · Source§fn position<P>(&mut self, predicate: P) -> Option<usize>
Searches for an element in an iterator, returning its index. Read more1.0.0 · Source§fn rposition<P>(&mut self, predicate: P) -> Option<usize>where
│ │ │ │ - P: FnMut(Self::Item) -> bool,
│ │ │ │ - Self: Sized + ExactSizeIterator + DoubleEndedIterator,
Searches for an element in an iterator from the right, returning its
│ │ │ │ -index. Read more1.0.0 · Source§fn max(self) -> Option<Self::Item>
Returns the maximum element of an iterator. Read more1.0.0 · Source§fn min(self) -> Option<Self::Item>
Returns the minimum element of an iterator. Read more1.6.0 · Source§fn max_by_key<B, F>(self, f: F) -> Option<Self::Item>
Returns the element that gives the maximum value from the
│ │ │ │ -specified function. Read more1.15.0 · Source§fn max_by<F>(self, compare: F) -> Option<Self::Item>
Returns the element that gives the maximum value with respect to the
│ │ │ │ -specified comparison function. Read more1.6.0 · Source§fn min_by_key<B, F>(self, f: F) -> Option<Self::Item>
Returns the element that gives the minimum value from the
│ │ │ │ -specified function. Read more1.15.0 · Source§fn min_by<F>(self, compare: F) -> Option<Self::Item>
Returns the element that gives the minimum value with respect to the
│ │ │ │ -specified comparison function. Read more1.0.0 · Source§fn rev(self) -> Rev<Self>where
│ │ │ │ - Self: Sized + DoubleEndedIterator,
Reverses an iterator’s direction. Read more1.0.0 · Source§fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)
Converts an iterator of pairs into a pair of containers. Read more1.36.0 · Source§fn copied<'a, T>(self) -> Copied<Self>
Creates an iterator which copies all of its elements. Read moreSource§fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N>where
│ │ │ │ - Self: Sized,
🔬This is a nightly-only experimental API. (iter_array_chunks
#100450)Returns an iterator over N
elements of the iterator at a time. Read more1.11.0 · Source§fn product<P>(self) -> P
Iterates over the entire iterator, multiplying all the elements Read more1.5.0 · Source§fn cmp<I>(self, other: I) -> Orderingwhere
│ │ │ │ - I: IntoIterator<Item = Self::Item>,
│ │ │ │ - Self::Item: Ord,
│ │ │ │ - Self: Sized,
Source§fn cmp_by<I, F>(self, other: I, cmp: F) -> Orderingwhere
│ │ │ │ - Self: Sized,
│ │ │ │ - I: IntoIterator,
│ │ │ │ - F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Ordering,
🔬This is a nightly-only experimental API. (iter_order_by
#64295)Lexicographically compares the elements of this Iterator
with those
│ │ │ │ -of another with respect to the specified comparison function. Read more1.5.0 · Source§fn partial_cmp<I>(self, other: I) -> Option<Ordering>where
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
Lexicographically compares the PartialOrd
elements of
│ │ │ │ -this Iterator
with those of another. The comparison works like short-circuit
│ │ │ │ + f: impl FnMut(&Self::Item) -> R,
│ │ │ │ +) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryTypewhere
│ │ │ │ + Self: Sized,
│ │ │ │ + R: Try<Output = bool>,
│ │ │ │ + <R as Try>::Residual: Residual<Option<Self::Item>>,🔬This is a nightly-only experimental API. (try_find
#63178)Applies function to the elements of iterator and returns
│ │ │ │ +the first true result or the first error. Read more1.0.0 · Source§fn position<P>(&mut self, predicate: P) -> Option<usize>
Searches for an element in an iterator, returning its index. Read more1.0.0 · Source§fn rposition<P>(&mut self, predicate: P) -> Option<usize>where
│ │ │ │ + P: FnMut(Self::Item) -> bool,
│ │ │ │ + Self: Sized + ExactSizeIterator + DoubleEndedIterator,
Searches for an element in an iterator from the right, returning its
│ │ │ │ +index. Read more1.0.0 · Source§fn max(self) -> Option<Self::Item>
Returns the maximum element of an iterator. Read more1.0.0 · Source§fn min(self) -> Option<Self::Item>
Returns the minimum element of an iterator. Read more1.6.0 · Source§fn max_by_key<B, F>(self, f: F) -> Option<Self::Item>
Returns the element that gives the maximum value from the
│ │ │ │ +specified function. Read more1.15.0 · Source§fn max_by<F>(self, compare: F) -> Option<Self::Item>
Returns the element that gives the maximum value with respect to the
│ │ │ │ +specified comparison function. Read more1.6.0 · Source§fn min_by_key<B, F>(self, f: F) -> Option<Self::Item>
Returns the element that gives the minimum value from the
│ │ │ │ +specified function. Read more1.15.0 · Source§fn min_by<F>(self, compare: F) -> Option<Self::Item>
Returns the element that gives the minimum value with respect to the
│ │ │ │ +specified comparison function. Read more1.0.0 · Source§fn rev(self) -> Rev<Self>where
│ │ │ │ + Self: Sized + DoubleEndedIterator,
Reverses an iterator’s direction. Read more1.0.0 · Source§fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)
Converts an iterator of pairs into a pair of containers. Read more1.36.0 · Source§fn copied<'a, T>(self) -> Copied<Self>
Creates an iterator which copies all of its elements. Read moreSource§fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N>where
│ │ │ │ + Self: Sized,
🔬This is a nightly-only experimental API. (iter_array_chunks
#100450)Returns an iterator over N
elements of the iterator at a time. Read more1.11.0 · Source§fn product<P>(self) -> P
Iterates over the entire iterator, multiplying all the elements Read more1.5.0 · Source§fn cmp<I>(self, other: I) -> Orderingwhere
│ │ │ │ + I: IntoIterator<Item = Self::Item>,
│ │ │ │ + Self::Item: Ord,
│ │ │ │ + Self: Sized,
Source§fn cmp_by<I, F>(self, other: I, cmp: F) -> Orderingwhere
│ │ │ │ + Self: Sized,
│ │ │ │ + I: IntoIterator,
│ │ │ │ + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Ordering,
🔬This is a nightly-only experimental API. (iter_order_by
#64295)Lexicographically compares the elements of this Iterator
with those
│ │ │ │ +of another with respect to the specified comparison function. Read more1.5.0 · Source§fn partial_cmp<I>(self, other: I) -> Option<Ordering>where
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
Lexicographically compares the PartialOrd
elements of
│ │ │ │ +this Iterator
with those of another. The comparison works like short-circuit
│ │ │ │ evaluation, returning a result without comparing the remaining elements.
│ │ │ │ -As soon as an order can be determined, the evaluation stops and a result is returned. Read moreSource§fn partial_cmp_by<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering>where
│ │ │ │ - Self: Sized,
│ │ │ │ - I: IntoIterator,
│ │ │ │ - F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Option<Ordering>,
🔬This is a nightly-only experimental API. (iter_order_by
#64295)Lexicographically compares the elements of this Iterator
with those
│ │ │ │ -of another with respect to the specified comparison function. Read more1.5.0 · Source§fn eq<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialEq<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
Source§fn eq_by<I, F>(self, other: I, eq: F) -> boolwhere
│ │ │ │ - Self: Sized,
│ │ │ │ - I: IntoIterator,
│ │ │ │ - F: FnMut(Self::Item, <I as IntoIterator>::Item) -> bool,
🔬This is a nightly-only experimental API. (iter_order_by
#64295)1.5.0 · Source§fn ne<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialEq<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
1.5.0 · Source§fn lt<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
Determines if the elements of this Iterator
are lexicographically
│ │ │ │ -less than those of another. Read more1.5.0 · Source§fn le<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
Determines if the elements of this Iterator
are lexicographically
│ │ │ │ -less or equal to those of another. Read more1.5.0 · Source§fn gt<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
Determines if the elements of this Iterator
are lexicographically
│ │ │ │ -greater than those of another. Read more1.5.0 · Source§fn ge<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
Determines if the elements of this Iterator
are lexicographically
│ │ │ │ -greater than or equal to those of another. Read more1.82.0 · Source§fn is_sorted(self) -> bool
Checks if the elements of this iterator are sorted. Read more1.82.0 · Source§fn is_sorted_by<F>(self, compare: F) -> bool
Checks if the elements of this iterator are sorted using the given comparator function. Read more1.82.0 · Source§fn is_sorted_by_key<F, K>(self, f: F) -> bool
Checks if the elements of this iterator are sorted using the given key extraction
│ │ │ │ -function. Read more1.0.0 · Source§impl<T: ?Sized + Ord, A: Allocator> Ord for Box<T, A>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
│ │ │ │ - Self: Sized,
Compares and returns the maximum of two values. Read more1.0.0 · Source§impl<T: ?Sized + PartialOrd, A: Allocator> PartialOrd for Box<T, A>
1.43.0 · Source§impl<T, const N: usize> TryFrom<Box<[T]>> for Box<[T; N]>
Source§fn try_from(boxed_slice: Box<[T]>) -> Result<Self, Self::Error>
Attempts to convert a Box<[T]>
into a Box<[T; N]>
.
│ │ │ │ +As soon as an order can be determined, the evaluation stops and a result is returned. Read moreSource§fn partial_cmp_by<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering>where
│ │ │ │ + Self: Sized,
│ │ │ │ + I: IntoIterator,
│ │ │ │ + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Option<Ordering>,
🔬This is a nightly-only experimental API. (iter_order_by
#64295)Lexicographically compares the elements of this Iterator
with those
│ │ │ │ +of another with respect to the specified comparison function. Read more1.5.0 · Source§fn eq<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialEq<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
Source§fn eq_by<I, F>(self, other: I, eq: F) -> boolwhere
│ │ │ │ + Self: Sized,
│ │ │ │ + I: IntoIterator,
│ │ │ │ + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> bool,
🔬This is a nightly-only experimental API. (iter_order_by
#64295)1.5.0 · Source§fn ne<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialEq<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
1.5.0 · Source§fn lt<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
Determines if the elements of this Iterator
are lexicographically
│ │ │ │ +less than those of another. Read more1.5.0 · Source§fn le<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
Determines if the elements of this Iterator
are lexicographically
│ │ │ │ +less or equal to those of another. Read more1.5.0 · Source§fn gt<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
Determines if the elements of this Iterator
are lexicographically
│ │ │ │ +greater than those of another. Read more1.5.0 · Source§fn ge<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
Determines if the elements of this Iterator
are lexicographically
│ │ │ │ +greater than or equal to those of another. Read more1.82.0 · Source§fn is_sorted(self) -> bool
Checks if the elements of this iterator are sorted. Read more1.82.0 · Source§fn is_sorted_by<F>(self, compare: F) -> bool
Checks if the elements of this iterator are sorted using the given comparator function. Read more1.82.0 · Source§fn is_sorted_by_key<F, K>(self, f: F) -> bool
Checks if the elements of this iterator are sorted using the given key extraction
│ │ │ │ +function. Read more1.0.0 · Source§impl<T: ?Sized + Ord, A: Allocator> Ord for Box<T, A>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
│ │ │ │ + Self: Sized,
Compares and returns the maximum of two values. Read more1.0.0 · Source§impl<T: ?Sized + PartialOrd, A: Allocator> PartialOrd for Box<T, A>
1.43.0 · Source§impl<T, const N: usize> TryFrom<Box<[T]>> for Box<[T; N]>
Source§fn try_from(boxed_slice: Box<[T]>) -> Result<Self, Self::Error>
Attempts to convert a Box<[T]>
into a Box<[T; N]>
.
│ │ │ │ The conversion occurs in-place and does not require a
│ │ │ │ new memory allocation.
│ │ │ │ §Errors
│ │ │ │ Returns the old Box<[T]>
in the Err
variant if
│ │ │ │ boxed_slice.len()
does not equal N
.
│ │ │ │ -1.66.0 · Source§impl<T, const N: usize> TryFrom<Vec<T>> for Box<[T; N]>
Source§fn try_from(vec: Vec<T>) -> Result<Self, Self::Error>
Attempts to convert a Vec<T>
into a Box<[T; N]>
.
│ │ │ │ Like Vec::into_boxed_slice
, this is in-place if vec.capacity() == N
,
│ │ │ │ but will require a reallocation otherwise.
│ │ │ │ §Errors
│ │ │ │ Returns the original Vec<T>
in the Err
variant if
│ │ │ │ boxed_slice.len()
does not equal N
.
│ │ │ │ §Examples
│ │ │ │ This can be used with vec!
to create an array on the heap:
│ │ │ │
│ │ │ │
│ │ │ │ -Source§impl<T: ?Sized + Unsize<U>, U: ?Sized, A: Allocator> CoerceUnsized<Box<U, A>> for Box<T, A>
Source§impl<T: ?Sized, A: Allocator> DerefPure for Box<T, A>
Source§impl<T: ?Sized + Unsize<U>, U: ?Sized> DispatchFromDyn<Box<U>> for Box<T, Global>
1.0.0 · Source§impl<T: ?Sized + Eq, A: Allocator> Eq for Box<T, A>
1.26.0 · Source§impl<I: FusedIterator + ?Sized, A: Allocator> FusedIterator for Box<I, A>
1.80.0 · Source§impl<'a, I, A: Allocator> !Iterator for &'a Box<[I], A>
This implementation is required to make sure that the &Box<[I]>: IntoIterator
│ │ │ │ +
Source§impl<T: ?Sized + Unsize<U>, U: ?Sized, A: Allocator> CoerceUnsized<Box<U, A>> for Box<T, A>
Source§impl<T: ?Sized, A: Allocator> DerefPure for Box<T, A>
Source§impl<T: ?Sized + Unsize<U>, U: ?Sized> DispatchFromDyn<Box<U>> for Box<T, Global>
1.0.0 · Source§impl<T: ?Sized + Eq, A: Allocator> Eq for Box<T, A>
1.26.0 · Source§impl<I: FusedIterator + ?Sized, A: Allocator> FusedIterator for Box<I, A>
1.80.0 · Source§impl<'a, I, A: Allocator> !Iterator for &'a Box<[I], A>
This implementation is required to make sure that the &Box<[I]>: IntoIterator
│ │ │ │ implementation doesn’t overlap with IntoIterator for T where T: Iterator
blanket.
│ │ │ │ - 1.80.0 · Source§impl<'a, I, A: Allocator> !Iterator for &'a mut Box<[I], A>
This implementation is required to make sure that the &mut Box<[I]>: IntoIterator
│ │ │ │ +
1.80.0 · Source§impl<'a, I, A: Allocator> !Iterator for &'a mut Box<[I], A>
This implementation is required to make sure that the &mut Box<[I]>: IntoIterator
│ │ │ │ implementation doesn’t overlap with IntoIterator for T where T: Iterator
blanket.
│ │ │ │ - 1.80.0 · Source§impl<I, A: Allocator> !Iterator for Box<[I], A>
This implementation is required to make sure that the Box<[I]>: IntoIterator
│ │ │ │ +
1.80.0 · Source§impl<I, A: Allocator> !Iterator for Box<[I], A>
This implementation is required to make sure that the Box<[I]>: IntoIterator
│ │ │ │ implementation doesn’t overlap with IntoIterator for T where T: Iterator
blanket.
│ │ │ │ - Source§impl<T: ?Sized, A: Allocator> PinCoerceUnsized for Box<T, A>
Source§impl<T> PointerLike for Box<T>
1.33.0 · Source§impl<T: ?Sized, A: Allocator> Unpin for Box<T, A>
Auto Trait Implementations§
§impl<T, A> Freeze for Box<T, A>
§impl<T, A> RefUnwindSafe for Box<T, A>
§impl<T, A> Send for Box<T, A>
§impl<T, A> Sync for Box<T, A>
§impl<T, A> UnwindSafe for Box<T, A>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
│ │ │ │ - T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moreSource§impl<T> CloneToUninit for Twhere
│ │ │ │ - T: Clone,
Source§impl<T, U> Into<U> for Twhere
│ │ │ │ - U: From<T>,
Auto Trait Implementations§
§impl<T, A> Freeze for Box<T, A>
§impl<T, A> RefUnwindSafe for Box<T, A>
§impl<T, A> Send for Box<T, A>
§impl<T, A> Sync for Box<T, A>
§impl<T, A> UnwindSafe for Box<T, A>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
│ │ │ │ + T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moreSource§impl<T> CloneToUninit for Twhere
│ │ │ │ + T: Clone,
Source§impl<I> IntoAsyncIterator for Iwhere
│ │ │ │ - I: AsyncIterator,
Source§type Item = <I as AsyncIterator>::Item
🔬This is a nightly-only experimental API. (async_iterator
#79024)The type of the item yielded by the iteratorSource§type IntoAsyncIter = I
🔬This is a nightly-only experimental API. (async_iterator
#79024)The type of the resulting iteratorSource§fn into_async_iter(self) -> <I as IntoAsyncIterator>::IntoAsyncIter
🔬This is a nightly-only experimental API. (async_iterator
#79024)Converts self
into an async iteratorSource§impl<F> IntoFuture for Fwhere
│ │ │ │ - F: Future,
Source§type IntoFuture = F
Which kind of future are we turning this into?Source§fn into_future(self) -> <F as IntoFuture>::IntoFuture
Creates a future from a value. Read moreSource§impl<I> IntoIterator for Iwhere
│ │ │ │ - I: Iterator,
Source§impl<F> Pattern for F
Source§type Searcher<'a> = CharPredicateSearcher<'a, F>
🔬This is a nightly-only experimental API. (pattern
#27721)Associated searcher for this patternSource§fn into_searcher<'a>(self, haystack: &'a str) -> CharPredicateSearcher<'a, F>
🔬This is a nightly-only experimental API. (pattern
#27721)Constructs the associated searcher from
│ │ │ │ -self
and the haystack
to search in.Source§fn is_contained_in<'a>(self, haystack: &'a str) -> bool
🔬This is a nightly-only experimental API. (pattern
#27721)Checks whether the pattern matches anywhere in the haystackSource§fn is_prefix_of<'a>(self, haystack: &'a str) -> bool
🔬This is a nightly-only experimental API. (pattern
#27721)Checks whether the pattern matches at the front of the haystackSource§fn strip_prefix_of<'a>(self, haystack: &'a str) -> Option<&'a str>
🔬This is a nightly-only experimental API. (pattern
#27721)Removes the pattern from the front of haystack, if it matches.Source§fn is_suffix_of<'a>(self, haystack: &'a str) -> boolwhere
│ │ │ │ - CharPredicateSearcher<'a, F>: ReverseSearcher<'a>,
🔬This is a nightly-only experimental API. (pattern
#27721)Checks whether the pattern matches at the back of the haystackSource§fn strip_suffix_of<'a>(self, haystack: &'a str) -> Option<&'a str>where
│ │ │ │ - CharPredicateSearcher<'a, F>: ReverseSearcher<'a>,
🔬This is a nightly-only experimental API. (pattern
#27721)Removes the pattern from the back of haystack, if it matches.Source§fn as_utf8_pattern(&self) -> Option<Utf8Pattern<'_>>
🔬This is a nightly-only experimental API. (pattern
#27721)Returns the pattern as utf-8 bytes if possible.
│ │ │ │ +From<T> for U
chooses to do.
│ │ │ │ +
Source§impl<I> IntoAsyncIterator for Iwhere
│ │ │ │ + I: AsyncIterator,
impl<I> IntoAsyncIterator for Iwhere
│ │ │ │ + I: AsyncIterator,
Source§type Item = <I as AsyncIterator>::Item
type Item = <I as AsyncIterator>::Item
async_iterator
#79024)Source§type IntoAsyncIter = I
type IntoAsyncIter = I
async_iterator
#79024)Source§fn into_async_iter(self) -> <I as IntoAsyncIterator>::IntoAsyncIter
fn into_async_iter(self) -> <I as IntoAsyncIterator>::IntoAsyncIter
async_iterator
#79024)self
into an async iteratorSource§impl<F> IntoFuture for Fwhere
│ │ │ │ + F: Future,
impl<F> IntoFuture for Fwhere
│ │ │ │ + F: Future,
Source§type IntoFuture = F
type IntoFuture = F
Source§fn into_future(self) -> <F as IntoFuture>::IntoFuture
fn into_future(self) -> <F as IntoFuture>::IntoFuture
Source§impl<I> IntoIterator for Iwhere
│ │ │ │ + I: Iterator,
impl<I> IntoIterator for Iwhere
│ │ │ │ + I: Iterator,
Source§impl<F> Pattern for F
impl<F> Pattern for F
Source§type Searcher<'a> = CharPredicateSearcher<'a, F>
type Searcher<'a> = CharPredicateSearcher<'a, F>
pattern
#27721)Source§fn into_searcher<'a>(self, haystack: &'a str) -> CharPredicateSearcher<'a, F>
fn into_searcher<'a>(self, haystack: &'a str) -> CharPredicateSearcher<'a, F>
pattern
#27721)self
and the haystack
to search in.Source§fn is_contained_in<'a>(self, haystack: &'a str) -> bool
fn is_contained_in<'a>(self, haystack: &'a str) -> bool
pattern
#27721)Source§fn is_prefix_of<'a>(self, haystack: &'a str) -> bool
fn is_prefix_of<'a>(self, haystack: &'a str) -> bool
pattern
#27721)Source§fn strip_prefix_of<'a>(self, haystack: &'a str) -> Option<&'a str>
fn strip_prefix_of<'a>(self, haystack: &'a str) -> Option<&'a str>
pattern
#27721)Source§fn is_suffix_of<'a>(self, haystack: &'a str) -> boolwhere
│ │ │ │ + CharPredicateSearcher<'a, F>: ReverseSearcher<'a>,
fn is_suffix_of<'a>(self, haystack: &'a str) -> boolwhere
│ │ │ │ + CharPredicateSearcher<'a, F>: ReverseSearcher<'a>,
pattern
#27721)Source§fn strip_suffix_of<'a>(self, haystack: &'a str) -> Option<&'a str>where
│ │ │ │ + CharPredicateSearcher<'a, F>: ReverseSearcher<'a>,
fn strip_suffix_of<'a>(self, haystack: &'a str) -> Option<&'a str>where
│ │ │ │ + CharPredicateSearcher<'a, F>: ReverseSearcher<'a>,
pattern
#27721)Source§fn as_utf8_pattern(&self) -> Option<Utf8Pattern<'_>>
fn as_utf8_pattern(&self) -> Option<Utf8Pattern<'_>>
pattern
#27721)pub struct ThinBox<T: ?Sized> { /* private fields */ }
thin_box
#92791)Expand description
ThinBox.
│ │ │ │ +pub struct ThinBox<T: ?Sized> { /* private fields */ }
thin_box
#92791)Expand description
ThinBox.
│ │ │ │A thin pointer for heap allocation, regardless of T.
│ │ │ │§Examples
│ │ │ │#![feature(thin_box)]
│ │ │ │ use std::boxed::ThinBox;
│ │ │ │
│ │ │ │ let five = ThinBox::new(5);
│ │ │ │ let thin_slice = ThinBox::<[i32]>::new_unsize([1, 2, 3, 4]);
│ │ │ │
│ │ │ │ use std::mem::{size_of, size_of_val};
│ │ │ │ let size_of_ptr = size_of::<*const ()>();
│ │ │ │ assert_eq!(size_of_ptr, size_of_val(&five));
│ │ │ │ assert_eq!(size_of_ptr, size_of_val(&thin_slice));
Implementations§
Source§impl<T> ThinBox<T>
impl<T> ThinBox<T>
Sourcepub fn new(value: T) -> Self
🔬This is a nightly-only experimental API. (thin_box
#92791)
pub fn new(value: T) -> Self
thin_box
#92791)Moves a type to the heap with its Metadata
stored in the heap allocation instead of on
│ │ │ │ +
Implementations§
Source§impl<T> ThinBox<T>
impl<T> ThinBox<T>
Sourcepub fn try_new(value: T) -> Result<Self, AllocError>
🔬This is a nightly-only experimental API. (thin_box
#92791)
pub fn try_new(value: T) -> Result<Self, AllocError>
thin_box
#92791)Moves a type to the heap with its Metadata
stored in the heap allocation instead of on
│ │ │ │ +
Sourcepub fn try_new(value: T) -> Result<Self, AllocError>
🔬This is a nightly-only experimental API. (thin_box
#92791)
pub fn try_new(value: T) -> Result<Self, AllocError>
thin_box
#92791)Source§impl<Dyn: ?Sized> ThinBox<Dyn>
impl<Dyn: ?Sized> ThinBox<Dyn>
Sourcepub fn new_unsize<T>(value: T) -> Selfwhere
│ │ │ │ - T: Unsize<Dyn>,
🔬This is a nightly-only experimental API. (thin_box
#92791)
pub fn new_unsize<T>(value: T) -> Selfwhere
│ │ │ │ - T: Unsize<Dyn>,
thin_box
#92791)Moves a type to the heap with its Metadata
stored in the heap allocation instead of on
│ │ │ │ +
Trait Implementations§
Source§impl<T: ?Sized + Error> Error for ThinBox<T>
impl<T: ?Sized + Error> Error for ThinBox<T>
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
impl<T: ?Sized + Send> Send for ThinBox<T>
ThinBox<T>
is Send
if T
is Send
because the data is owned.
impl<T: ?Sized + Sync> Sync for ThinBox<T>
ThinBox<T>
is Sync
if T
is Sync
because the data is owned.
Auto Trait Implementations§
impl<T> Freeze for ThinBox<T>where
│ │ │ │ - T: ?Sized,
impl<T> RefUnwindSafe for ThinBox<T>where
│ │ │ │ - T: RefUnwindSafe + ?Sized,
impl<T> Unpin for ThinBox<T>
impl<T> UnwindSafe for ThinBox<T>where
│ │ │ │ - T: UnwindSafe + ?Sized,
Blanket Implementations§
Trait Implementations§
Source§impl<T: ?Sized + Error> Error for ThinBox<T>
impl<T: ?Sized + Error> Error for ThinBox<T>
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
impl<T: ?Sized + Send> Send for ThinBox<T>
ThinBox<T>
is Send
if T
is Send
because the data is owned.
impl<T: ?Sized + Sync> Sync for ThinBox<T>
ThinBox<T>
is Sync
if T
is Sync
because the data is owned.
Auto Trait Implementations§
impl<T> Freeze for ThinBox<T>where
│ │ │ │ + T: ?Sized,
impl<T> RefUnwindSafe for ThinBox<T>where
│ │ │ │ + T: RefUnwindSafe + ?Sized,
impl<T> Unpin for ThinBox<T>
impl<T> UnwindSafe for ThinBox<T>where
│ │ │ │ + T: UnwindSafe + ?Sized,
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
From<T> for U
chooses to do.
│ │ │ │ +pub struct BinaryHeap<T, A: Allocator = Global> { /* private fields */ }
Expand description
A priority queue implemented with a binary heap.
│ │ │ │This will be a max-heap.
│ │ │ │It is a logic error for an item to be modified in such a way that the
│ │ │ │ -item’s ordering relative to any other item, as determined by the Ord
│ │ │ │ +item’s ordering relative to any other item, as determined by the Ord
│ │ │ │ trait, changes while it is in the heap. This is normally only possible
│ │ │ │ through interior mutability, global state, I/O, or unsafe code. The
│ │ │ │ behavior resulting from such a logic error is not specified, but will
│ │ │ │ be encapsulated to the BinaryHeap
that observed the logic error and not
│ │ │ │ result in undefined behavior. This could include panics, incorrect results,
│ │ │ │ aborts, memory leaks, and non-termination.
As long as no elements change their relative order while being in the heap │ │ │ │ @@ -56,15 +56,15 @@ │ │ │ │ assert!(heap.is_empty())
A BinaryHeap
with a known list of items can be initialized from an array:
§Min-heap
│ │ │ │ -Either core::cmp::Reverse
or a custom Ord
implementation can be used to
│ │ │ │ +
Either core::cmp::Reverse
or a custom Ord
implementation can be used to
│ │ │ │ make BinaryHeap
a min-heap. This makes heap.pop()
return the smallest
│ │ │ │ value instead of the greatest one.
use std::collections::BinaryHeap;
│ │ │ │ use std::cmp::Reverse;
│ │ │ │
│ │ │ │ let mut heap = BinaryHeap::new();
│ │ │ │ @@ -81,55 +81,55 @@
│ │ │ │ assert_eq!(heap.pop(), None);
§Time complexity
│ │ │ │The value for push
is an expected cost; the method documentation gives a
│ │ │ │ more detailed analysis.
Implementations§
Source§impl<T: Ord> BinaryHeap<T>
impl<T: Ord> BinaryHeap<T>
1.0.0 (const: 1.80.0) · Sourcepub const fn new() -> BinaryHeap<T>
pub const fn new() -> BinaryHeap<T>
Creates an empty BinaryHeap
as a max-heap.
Implementations§
Source§impl<T: Ord> BinaryHeap<T>
impl<T: Ord> BinaryHeap<T>
1.0.0 (const: 1.80.0) · Sourcepub const fn new() -> BinaryHeap<T>
pub const fn new() -> BinaryHeap<T>
Creates an empty BinaryHeap
as a max-heap.
§Examples
│ │ │ │Basic usage:
│ │ │ │ │ │ │ │ │ │ │ │ -1.0.0 · Sourcepub fn with_capacity(capacity: usize) -> BinaryHeap<T>
pub fn with_capacity(capacity: usize) -> BinaryHeap<T>
Creates an empty BinaryHeap
with at least the specified capacity.
1.0.0 · Sourcepub fn with_capacity(capacity: usize) -> BinaryHeap<T>
pub fn with_capacity(capacity: usize) -> BinaryHeap<T>
Creates an empty BinaryHeap
with at least the specified capacity.
The binary heap will be able to hold at least capacity
elements without
│ │ │ │ reallocating. This method is allowed to allocate for more elements than
│ │ │ │ capacity
. If capacity
is zero, the binary heap will not allocate.
§Examples
│ │ │ │Basic usage:
│ │ │ │ │ │ │ │ │ │ │ │ -Source§impl<T: Ord, A: Allocator> BinaryHeap<T, A>
impl<T: Ord, A: Allocator> BinaryHeap<T, A>
Sourcepub const fn new_in(alloc: A) -> BinaryHeap<T, A>
🔬This is a nightly-only experimental API. (allocator_api
#32838)
pub const fn new_in(alloc: A) -> BinaryHeap<T, A>
allocator_api
#32838)Creates an empty BinaryHeap
as a max-heap, using A
as allocator.
Source§impl<T: Ord, A: Allocator> BinaryHeap<T, A>
impl<T: Ord, A: Allocator> BinaryHeap<T, A>
Sourcepub const fn new_in(alloc: A) -> BinaryHeap<T, A>
🔬This is a nightly-only experimental API. (allocator_api
#32838)
pub const fn new_in(alloc: A) -> BinaryHeap<T, A>
allocator_api
#32838)Creates an empty BinaryHeap
as a max-heap, using A
as allocator.
§Examples
│ │ │ │Basic usage:
│ │ │ │ │ │ │ │ │ │ │ │ -Sourcepub fn with_capacity_in(capacity: usize, alloc: A) -> BinaryHeap<T, A>
🔬This is a nightly-only experimental API. (allocator_api
#32838)
pub fn with_capacity_in(capacity: usize, alloc: A) -> BinaryHeap<T, A>
allocator_api
#32838)Creates an empty BinaryHeap
with at least the specified capacity, using A
as allocator.
Sourcepub fn with_capacity_in(capacity: usize, alloc: A) -> BinaryHeap<T, A>
🔬This is a nightly-only experimental API. (allocator_api
#32838)
pub fn with_capacity_in(capacity: usize, alloc: A) -> BinaryHeap<T, A>
allocator_api
#32838)Creates an empty BinaryHeap
with at least the specified capacity, using A
as allocator.
The binary heap will be able to hold at least capacity
elements without
│ │ │ │ reallocating. This method is allowed to allocate for more elements than
│ │ │ │ capacity
. If capacity
is zero, the binary heap will not allocate.
§Examples
│ │ │ │Basic usage:
│ │ │ │ │ │ │ │ │ │ │ │ -1.12.0 · Sourcepub fn peek_mut(&mut self) -> Option<PeekMut<'_, T, A>>
pub fn peek_mut(&mut self) -> Option<PeekMut<'_, T, A>>
Returns a mutable reference to the greatest item in the binary heap, or │ │ │ │ +
1.12.0 · Sourcepub fn peek_mut(&mut self) -> Option<PeekMut<'_, T, A>>
pub fn peek_mut(&mut self) -> Option<PeekMut<'_, T, A>>
Returns a mutable reference to the greatest item in the binary heap, or
│ │ │ │ None
if it is empty.
Note: If the PeekMut
value is leaked, some heap elements might get
│ │ │ │ leaked along with it, but the remaining elements will remain a valid
│ │ │ │ heap.
§Examples
│ │ │ │Basic usage:
│ │ │ │ │ │ │ │ @@ -143,15 +143,15 @@ │ │ │ │ if let Some(mut val) = heap.peek_mut() { │ │ │ │ *val = 0; │ │ │ │ } │ │ │ │ assert_eq!(heap.peek(), Some(&2));§Time complexity
│ │ │ │If the item is modified then the worst case time complexity is O(log(n)), │ │ │ │ otherwise it’s O(1).
│ │ │ │ -1.0.0 · Sourcepub fn pop(&mut self) -> Option<T>
pub fn pop(&mut self) -> Option<T>
Removes the greatest item from the binary heap and returns it, or None
if it
│ │ │ │ +
1.0.0 · Sourcepub fn pop(&mut self) -> Option<T>
pub fn pop(&mut self) -> Option<T>
Removes the greatest item from the binary heap and returns it, or None
if it
│ │ │ │ is empty.
§Examples
│ │ │ │Basic usage:
│ │ │ │ │ │ │ │use std::collections::BinaryHeap;
│ │ │ │ let mut heap = BinaryHeap::from([1, 3]);
│ │ │ │
│ │ │ │ @@ -228,15 +228,15 @@
│ │ │ │
│ │ │ │ let mut heap = BinaryHeap::from([1, 2, 3, 4, 5]);
│ │ │ │ assert_eq!(heap.len(), 5);
│ │ │ │
│ │ │ │ drop(heap.drain_sorted()); // removes all elements in heap order
│ │ │ │ assert_eq!(heap.len(), 0);
1.70.0 · Sourcepub fn retain<F>(&mut self, f: F)
pub fn retain<F>(&mut self, f: F)
Retains only the elements specified by the predicate.
│ │ │ │In other words, remove all elements e
for which f(&e)
returns
│ │ │ │ false
. The elements are visited in unsorted (and unspecified) order.
§Examples
│ │ │ │Basic usage:
│ │ │ │ │ │ │ │use std::collections::BinaryHeap;
│ │ │ │
│ │ │ │ @@ -263,72 +263,72 @@
│ │ │ │ Basic usage:
│ │ │ │
│ │ │ │
│ │ │ │ -
1.0.0 · Sourcepub fn peek(&self) -> Option<&T>
pub fn peek(&self) -> Option<&T>
Returns the greatest item in the binary heap, or None
if it is empty.
1.0.0 · Sourcepub fn peek(&self) -> Option<&T>
pub fn peek(&self) -> Option<&T>
Returns the greatest item in the binary heap, or None
if it is empty.
§Examples
│ │ │ │Basic usage:
│ │ │ │ │ │ │ │use std::collections::BinaryHeap;
│ │ │ │ let mut heap = BinaryHeap::new();
│ │ │ │ assert_eq!(heap.peek(), None);
│ │ │ │
│ │ │ │ heap.push(1);
│ │ │ │ heap.push(5);
│ │ │ │ heap.push(2);
│ │ │ │ assert_eq!(heap.peek(), Some(&5));
│ │ │ │
§Time complexity
│ │ │ │Cost is O(1) in the worst case.
│ │ │ │ -1.0.0 · Sourcepub fn capacity(&self) -> usize
pub fn capacity(&self) -> usize
Returns the number of elements the binary heap can hold without reallocating.
│ │ │ │ +1.0.0 · Sourcepub fn capacity(&self) -> usize
pub fn capacity(&self) -> usize
Returns the number of elements the binary heap can hold without reallocating.
│ │ │ │§Examples
│ │ │ │Basic usage:
│ │ │ │ │ │ │ │ │ │ │ │ -1.0.0 · Sourcepub fn reserve_exact(&mut self, additional: usize)
pub fn reserve_exact(&mut self, additional: usize)
Reserves the minimum capacity for at least additional
elements more than
│ │ │ │ +
1.0.0 · Sourcepub fn reserve_exact(&mut self, additional: usize)
pub fn reserve_exact(&mut self, additional: usize)
Reserves the minimum capacity for at least additional
elements more than
│ │ │ │ the current length. Unlike reserve
, this will not
│ │ │ │ deliberately over-allocate to speculatively avoid frequent allocations.
│ │ │ │ After calling reserve_exact
, capacity will be greater than or equal to
│ │ │ │ self.len() + additional
. Does nothing if the capacity is already
│ │ │ │ sufficient.
§Panics
│ │ │ │ -Panics if the new capacity overflows usize
.
Panics if the new capacity overflows usize
.
§Examples
│ │ │ │Basic usage:
│ │ │ │ │ │ │ │ │ │ │ │ -1.0.0 · Sourcepub fn reserve(&mut self, additional: usize)
pub fn reserve(&mut self, additional: usize)
Reserves capacity for at least additional
elements more than the
│ │ │ │ +
1.0.0 · Sourcepub fn reserve(&mut self, additional: usize)
pub fn reserve(&mut self, additional: usize)
Reserves capacity for at least additional
elements more than the
│ │ │ │ current length. The allocator may reserve more space to speculatively
│ │ │ │ avoid frequent allocations. After calling reserve
,
│ │ │ │ capacity will be greater than or equal to self.len() + additional
.
│ │ │ │ Does nothing if capacity is already sufficient.
§Panics
│ │ │ │ -Panics if the new capacity overflows usize
.
Panics if the new capacity overflows usize
.
§Examples
│ │ │ │Basic usage:
│ │ │ │ │ │ │ │ │ │ │ │1.63.0 · Sourcepub fn try_reserve_exact(
│ │ │ │ &mut self,
│ │ │ │ - additional: usize,
│ │ │ │ -) -> Result<(), TryReserveError>
pub fn try_reserve_exact( │ │ │ │ &mut self, │ │ │ │ - additional: usize, │ │ │ │ -) -> Result<(), TryReserveError>
Tries to reserve the minimum capacity for at least additional
elements
│ │ │ │ + additional: usize,
│ │ │ │ +) -> Result<(), TryReserveError>
Tries to reserve the minimum capacity for at least additional
elements
│ │ │ │ more than the current length. Unlike try_reserve
, this will not
│ │ │ │ deliberately over-allocate to speculatively avoid frequent allocations.
│ │ │ │ After calling try_reserve_exact
, capacity will be greater than or
│ │ │ │ equal to self.len() + additional
if it returns Ok(())
.
│ │ │ │ Does nothing if the capacity is already sufficient.
Note that the allocator may give the collection more space than it │ │ │ │ requests. Therefore, capacity can not be relied upon to be precisely │ │ │ │ @@ -347,15 +347,15 @@ │ │ │ │ heap.try_reserve_exact(data.len())?; │ │ │ │ │ │ │ │ // Now we know this can't OOM in the middle of our complex work │ │ │ │ heap.extend(data.iter()); │ │ │ │ │ │ │ │ Ok(heap.pop()) │ │ │ │ }
1.63.0 · Sourcepub fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError>
pub fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError>
Tries to reserve capacity for at least additional
elements more than the
│ │ │ │ +
1.63.0 · Sourcepub fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError>
pub fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError>
Tries to reserve capacity for at least additional
elements more than the
│ │ │ │ current length. The allocator may reserve more space to speculatively
│ │ │ │ avoid frequent allocations. After calling try_reserve
, capacity will be
│ │ │ │ greater than or equal to self.len() + additional
if it returns
│ │ │ │ Ok(())
. Does nothing if capacity is already sufficient. This method
│ │ │ │ preserves the contents even if an error occurs.
§Errors
│ │ │ │If the capacity overflows, or the allocator reports a failure, then an error │ │ │ │ @@ -381,26 +381,26 @@ │ │ │ │ │ │ │ │
│ │ │ │ -1.56.0 · Sourcepub fn shrink_to(&mut self, min_capacity: usize)
pub fn shrink_to(&mut self, min_capacity: usize)
Discards capacity with a lower bound.
│ │ │ │ +1.56.0 · Sourcepub fn shrink_to(&mut self, min_capacity: usize)
pub fn shrink_to(&mut self, min_capacity: usize)
Discards capacity with a lower bound.
│ │ │ │The capacity will remain at least as large as both the length │ │ │ │ and the supplied value.
│ │ │ │If the current capacity is less than the lower limit, this is a no-op.
│ │ │ │§Examples
│ │ │ │ │ │ │ │ -1.80.0 · Sourcepub fn as_slice(&self) -> &[T]
pub fn as_slice(&self) -> &[T]
Returns a slice of all values in the underlying vector, in arbitrary │ │ │ │ +
1.80.0 · Sourcepub fn as_slice(&self) -> &[T]
pub fn as_slice(&self) -> &[T]
Returns a slice of all values in the underlying vector, in arbitrary │ │ │ │ order.
│ │ │ │§Examples
│ │ │ │Basic usage:
│ │ │ │ │ │ │ │use std::collections::BinaryHeap;
│ │ │ │ use std::io::{self, Write};
│ │ │ │
│ │ │ │ @@ -416,24 +416,24 @@
│ │ │ │ let heap = BinaryHeap::from([1, 2, 3, 4, 5, 6, 7]);
│ │ │ │ let vec = heap.into_vec();
│ │ │ │
│ │ │ │ // Will print in some order
│ │ │ │ for x in vec {
│ │ │ │ println!("{x}");
│ │ │ │ }
Sourcepub fn allocator(&self) -> &A
🔬This is a nightly-only experimental API. (allocator_api
#32838)
pub fn allocator(&self) -> &A
allocator_api
#32838)Returns a reference to the underlying allocator.
│ │ │ │ -Sourcepub fn allocator(&self) -> &A
🔬This is a nightly-only experimental API. (allocator_api
#32838)
pub fn allocator(&self) -> &A
allocator_api
#32838)Returns a reference to the underlying allocator.
│ │ │ │ +1.0.0 · Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Returns the length of the binary heap.
│ │ │ │§Examples
│ │ │ │Basic usage:
│ │ │ │ │ │ │ │ │ │ │ │ -1.0.0 · Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Checks if the binary heap is empty.
│ │ │ │§Examples
│ │ │ │Basic usage:
│ │ │ │ │ │ │ │use std::collections::BinaryHeap;
│ │ │ │ let mut heap = BinaryHeap::new();
│ │ │ │
│ │ │ │ assert!(heap.is_empty());
│ │ │ │ @@ -469,63 +469,63 @@
│ │ │ │ let mut heap = BinaryHeap::from([1, 3]);
│ │ │ │
│ │ │ │ assert!(!heap.is_empty());
│ │ │ │
│ │ │ │ heap.clear();
│ │ │ │
│ │ │ │ assert!(heap.is_empty());
Trait Implementations§
1.0.0 · Source§impl<T: Clone, A: Allocator + Clone> Clone for BinaryHeap<T, A>
impl<T: Clone, A: Allocator + Clone> Clone for BinaryHeap<T, A>
Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Overwrites the contents of self
with a clone of the contents of source
.
Trait Implementations§
1.0.0 · Source§impl<T: Clone, A: Allocator + Clone> Clone for BinaryHeap<T, A>
impl<T: Clone, A: Allocator + Clone> Clone for BinaryHeap<T, A>
Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Overwrites the contents of self
with a clone of the contents of source
.
This method is preferred over simply assigning source.clone()
to self
,
│ │ │ │ as it avoids reallocation if possible.
See Vec::clone_from()
for more details.
1.0.0 · Source§impl<T: Ord> Default for BinaryHeap<T>
impl<T: Ord> Default for BinaryHeap<T>
Source§fn default() -> BinaryHeap<T>
fn default() -> BinaryHeap<T>
Creates an empty BinaryHeap<T>
.
1.2.0 · Source§impl<'a, T: 'a + Ord + Copy, A: Allocator> Extend<&'a T> for BinaryHeap<T, A>
impl<'a, T: 'a + Ord + Copy, A: Allocator> Extend<&'a T> for BinaryHeap<T, A>
1.0.0 · Source§impl<T: Ord, A: Allocator> Extend<T> for BinaryHeap<T, A>
impl<T: Ord, A: Allocator> Extend<T> for BinaryHeap<T, A>
Source§fn extend<I: IntoIterator<Item = T>>(&mut self, iter: I)
fn extend<I: IntoIterator<Item = T>>(&mut self, iter: I)
Source§fn extend_one(&mut self, item: T)
fn extend_one(&mut self, item: T)
extend_one
#72631)1.0.0 · Source§impl<T: Ord> Default for BinaryHeap<T>
impl<T: Ord> Default for BinaryHeap<T>
Source§fn default() -> BinaryHeap<T>
fn default() -> BinaryHeap<T>
Creates an empty BinaryHeap<T>
.
1.2.0 · Source§impl<'a, T: 'a + Ord + Copy, A: Allocator> Extend<&'a T> for BinaryHeap<T, A>
impl<'a, T: 'a + Ord + Copy, A: Allocator> Extend<&'a T> for BinaryHeap<T, A>
1.0.0 · Source§impl<T: Ord, A: Allocator> Extend<T> for BinaryHeap<T, A>
impl<T: Ord, A: Allocator> Extend<T> for BinaryHeap<T, A>
Source§fn extend<I: IntoIterator<Item = T>>(&mut self, iter: I)
fn extend<I: IntoIterator<Item = T>>(&mut self, iter: I)
Source§fn extend_one(&mut self, item: T)
fn extend_one(&mut self, item: T)
extend_one
#72631)1.5.0 · Source§impl<T, A: Allocator> From<BinaryHeap<T, A>> for Vec<T, A>
impl<T, A: Allocator> From<BinaryHeap<T, A>> for Vec<T, A>
Source§fn from(heap: BinaryHeap<T, A>) -> Vec<T, A>
fn from(heap: BinaryHeap<T, A>) -> Vec<T, A>
Converts a BinaryHeap<T>
into a Vec<T>
.
1.5.0 · Source§impl<T, A: Allocator> From<BinaryHeap<T, A>> for Vec<T, A>
impl<T, A: Allocator> From<BinaryHeap<T, A>> for Vec<T, A>
Source§fn from(heap: BinaryHeap<T, A>) -> Vec<T, A>
fn from(heap: BinaryHeap<T, A>) -> Vec<T, A>
Converts a BinaryHeap<T>
into a Vec<T>
.
This conversion requires no data movement or allocation, and has │ │ │ │ constant time complexity.
│ │ │ │ -1.5.0 · Source§impl<T: Ord, A: Allocator> From<Vec<T, A>> for BinaryHeap<T, A>
impl<T: Ord, A: Allocator> From<Vec<T, A>> for BinaryHeap<T, A>
Source§fn from(vec: Vec<T, A>) -> BinaryHeap<T, A>
fn from(vec: Vec<T, A>) -> BinaryHeap<T, A>
Converts a Vec<T>
into a BinaryHeap<T>
.
1.5.0 · Source§impl<T: Ord, A: Allocator> From<Vec<T, A>> for BinaryHeap<T, A>
impl<T: Ord, A: Allocator> From<Vec<T, A>> for BinaryHeap<T, A>
Source§fn from(vec: Vec<T, A>) -> BinaryHeap<T, A>
fn from(vec: Vec<T, A>) -> BinaryHeap<T, A>
Converts a Vec<T>
into a BinaryHeap<T>
.
This conversion happens in-place, and has O(n) time complexity.
│ │ │ │ -1.0.0 · Source§impl<T: Ord> FromIterator<T> for BinaryHeap<T>
impl<T: Ord> FromIterator<T> for BinaryHeap<T>
Source§fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> BinaryHeap<T>
fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> BinaryHeap<T>
1.0.0 · Source§impl<'a, T, A: Allocator> IntoIterator for &'a BinaryHeap<T, A>
impl<'a, T, A: Allocator> IntoIterator for &'a BinaryHeap<T, A>
1.0.0 · Source§impl<T, A: Allocator> IntoIterator for BinaryHeap<T, A>
impl<T, A: Allocator> IntoIterator for BinaryHeap<T, A>
1.0.0 · Source§impl<T: Ord> FromIterator<T> for BinaryHeap<T>
impl<T: Ord> FromIterator<T> for BinaryHeap<T>
Source§fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> BinaryHeap<T>
fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> BinaryHeap<T>
1.0.0 · Source§impl<'a, T, A: Allocator> IntoIterator for &'a BinaryHeap<T, A>
impl<'a, T, A: Allocator> IntoIterator for &'a BinaryHeap<T, A>
1.0.0 · Source§impl<T, A: Allocator> IntoIterator for BinaryHeap<T, A>
impl<T, A: Allocator> IntoIterator for BinaryHeap<T, A>
Auto Trait Implementations§
impl<T, A> Freeze for BinaryHeap<T, A>where
│ │ │ │ - A: Freeze,
impl<T, A> RefUnwindSafe for BinaryHeap<T, A>where
│ │ │ │ - A: RefUnwindSafe,
│ │ │ │ - T: RefUnwindSafe,
impl<T, A> Send for BinaryHeap<T, A>
impl<T, A> Sync for BinaryHeap<T, A>
impl<T, A> Unpin for BinaryHeap<T, A>
impl<T, A> UnwindSafe for BinaryHeap<T, A>where
│ │ │ │ - A: UnwindSafe,
│ │ │ │ - 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
Source§impl<T> CloneToUninit for Twhere
│ │ │ │ - T: Clone,
impl<T> CloneToUninit for Twhere
│ │ │ │ - T: Clone,
Auto Trait Implementations§
impl<T, A> Freeze for BinaryHeap<T, A>where
│ │ │ │ + A: Freeze,
impl<T, A> RefUnwindSafe for BinaryHeap<T, A>where
│ │ │ │ + A: RefUnwindSafe,
│ │ │ │ + T: RefUnwindSafe,
impl<T, A> Send for BinaryHeap<T, A>
impl<T, A> Sync for BinaryHeap<T, A>
impl<T, A> Unpin for BinaryHeap<T, A>
impl<T, A> UnwindSafe for BinaryHeap<T, A>where
│ │ │ │ + A: UnwindSafe,
│ │ │ │ + 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
Source§impl<T> CloneToUninit for Twhere
│ │ │ │ + T: Clone,
impl<T> CloneToUninit for Twhere
│ │ │ │ + T: Clone,
Source§fn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
pub struct Drain<'a, T: 'a, A: Allocator = Global> { /* private fields */ }
Expand description
A draining iterator over the elements of a BinaryHeap
.
This struct
is created by BinaryHeap::drain()
. See its
│ │ │ │ documentation for more.
Implementations§
Trait Implementations§
1.6.0 · Source§impl<T, A: Allocator> DoubleEndedIterator for Drain<'_, T, A>
impl<T, A: Allocator> DoubleEndedIterator for Drain<'_, T, A>
Source§fn next_back(&mut self) -> Option<T>
fn next_back(&mut self) -> Option<T>
Source§fn advance_back_by(&mut self, n: usize) -> Result<(), NonZero<usize>>
fn advance_back_by(&mut self, n: usize) -> Result<(), NonZero<usize>>
iter_advance_by
#77404)n
elements. Read more1.37.0 · Source§fn nth_back(&mut self, n: usize) -> Option<Self::Item>
fn nth_back(&mut self, n: usize) -> Option<Self::Item>
n
th element from the end of the iterator. Read more1.27.0 · Source§fn try_rfold<B, F, R>(&mut self, init: B, f: F) -> R
fn try_rfold<B, F, R>(&mut self, init: B, f: F) -> R
Iterator::try_fold()
: it takes
│ │ │ │ -elements starting from the back of the iterator. Read more1.6.0 · Source§impl<T, A: Allocator> ExactSizeIterator for Drain<'_, T, A>
impl<T, A: Allocator> ExactSizeIterator for Drain<'_, T, A>
1.6.0 · Source§impl<T, A: Allocator> Iterator for Drain<'_, T, A>
impl<T, A: Allocator> Iterator for Drain<'_, T, A>
Implementations§
Trait Implementations§
1.6.0 · Source§impl<T, A: Allocator> DoubleEndedIterator for Drain<'_, T, A>
impl<T, A: Allocator> DoubleEndedIterator for Drain<'_, T, A>
Source§fn next_back(&mut self) -> Option<T>
fn next_back(&mut self) -> Option<T>
Source§fn advance_back_by(&mut self, n: usize) -> Result<(), NonZero<usize>>
fn advance_back_by(&mut self, n: usize) -> Result<(), NonZero<usize>>
iter_advance_by
#77404)n
elements. Read more1.37.0 · Source§fn nth_back(&mut self, n: usize) -> Option<Self::Item>
fn nth_back(&mut self, n: usize) -> Option<Self::Item>
n
th element from the end of the iterator. Read more1.27.0 · Source§fn try_rfold<B, F, R>(&mut self, init: B, f: F) -> R
fn try_rfold<B, F, R>(&mut self, init: B, f: F) -> R
Iterator::try_fold()
: it takes
│ │ │ │ +elements starting from the back of the iterator. Read more1.6.0 · Source§impl<T, A: Allocator> ExactSizeIterator for Drain<'_, T, A>
impl<T, A: Allocator> ExactSizeIterator for Drain<'_, T, A>
1.6.0 · Source§impl<T, A: Allocator> Iterator for Drain<'_, T, A>
impl<T, A: Allocator> Iterator for Drain<'_, T, A>
Source§fn size_hint(&self) -> (usize, Option<usize>)
fn size_hint(&self) -> (usize, Option<usize>)
Source§fn next_chunk<const N: usize>(
│ │ │ │ &mut self,
│ │ │ │ -) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>where
│ │ │ │ - Self: Sized,
fn next_chunk<const N: usize>(
│ │ │ │ &mut self,
│ │ │ │ -) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>where
│ │ │ │ - Self: Sized,
iter_next_chunk
#98326)N
values. Read more1.0.0 · Source§fn count(self) -> usizewhere
│ │ │ │ - Self: Sized,
fn count(self) -> usizewhere
│ │ │ │ - Self: Sized,
1.0.0 · Source§fn last(self) -> Option<Self::Item>where
│ │ │ │ - Self: Sized,
fn last(self) -> Option<Self::Item>where
│ │ │ │ - Self: Sized,
Source§fn advance_by(&mut self, n: usize) -> Result<(), NonZero<usize>>
fn advance_by(&mut self, n: usize) -> Result<(), NonZero<usize>>
iter_advance_by
#77404)n
elements. Read more1.0.0 · Source§fn nth(&mut self, n: usize) -> Option<Self::Item>
fn nth(&mut self, n: usize) -> Option<Self::Item>
n
th element of the iterator. Read more1.28.0 · Source§fn step_by(self, step: usize) -> StepBy<Self>where
│ │ │ │ - Self: Sized,
fn step_by(self, step: usize) -> StepBy<Self>where
│ │ │ │ - Self: Sized,
1.0.0 · Source§fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>
fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>
1.0.0 · Source§fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>where
│ │ │ │ - Self: Sized,
│ │ │ │ - U: IntoIterator,
fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>where
│ │ │ │ - Self: Sized,
│ │ │ │ - U: IntoIterator,
Source§fn intersperse(self, separator: Self::Item) -> Intersperse<Self>
fn intersperse(self, separator: Self::Item) -> Intersperse<Self>
iter_intersperse
#79524)separator
between adjacent
│ │ │ │ -items of the original iterator. Read moreSource§fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G>
fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G>
iter_intersperse
#79524)separator
│ │ │ │ -between adjacent items of the original iterator. Read more1.0.0 · Source§fn map<B, F>(self, f: F) -> Map<Self, F>
fn map<B, F>(self, f: F) -> Map<Self, F>
1.0.0 · Source§fn filter<P>(self, predicate: P) -> Filter<Self, P>
fn filter<P>(self, predicate: P) -> Filter<Self, P>
1.0.0 · Source§fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>
fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>
1.0.0 · Source§fn enumerate(self) -> Enumerate<Self>where
│ │ │ │ - Self: Sized,
fn enumerate(self) -> Enumerate<Self>where
│ │ │ │ - Self: Sized,
1.0.0 · Source§fn peekable(self) -> Peekable<Self>where
│ │ │ │ - Self: Sized,
fn peekable(self) -> Peekable<Self>where
│ │ │ │ - Self: Sized,
peek
and peek_mut
methods
│ │ │ │ +) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>iter_next_chunk
#98326)N
values. Read more1.0.0 · Source§fn count(self) -> usizewhere
│ │ │ │ + Self: Sized,
fn count(self) -> usizewhere
│ │ │ │ + Self: Sized,
1.0.0 · Source§fn last(self) -> Option<Self::Item>where
│ │ │ │ + Self: Sized,
fn last(self) -> Option<Self::Item>where
│ │ │ │ + Self: Sized,
Source§fn advance_by(&mut self, n: usize) -> Result<(), NonZero<usize>>
fn advance_by(&mut self, n: usize) -> Result<(), NonZero<usize>>
iter_advance_by
#77404)n
elements. Read more1.0.0 · Source§fn nth(&mut self, n: usize) -> Option<Self::Item>
fn nth(&mut self, n: usize) -> Option<Self::Item>
n
th element of the iterator. Read more1.28.0 · Source§fn step_by(self, step: usize) -> StepBy<Self>where
│ │ │ │ + Self: Sized,
fn step_by(self, step: usize) -> StepBy<Self>where
│ │ │ │ + Self: Sized,
1.0.0 · Source§fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>
fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>
1.0.0 · Source§fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>where
│ │ │ │ + Self: Sized,
│ │ │ │ + U: IntoIterator,
fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>where
│ │ │ │ + Self: Sized,
│ │ │ │ + U: IntoIterator,
Source§fn intersperse(self, separator: Self::Item) -> Intersperse<Self>
fn intersperse(self, separator: Self::Item) -> Intersperse<Self>
iter_intersperse
#79524)separator
between adjacent
│ │ │ │ +items of the original iterator. Read moreSource§fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G>
fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G>
iter_intersperse
#79524)separator
│ │ │ │ +between adjacent items of the original iterator. Read more1.0.0 · Source§fn map<B, F>(self, f: F) -> Map<Self, F>
fn map<B, F>(self, f: F) -> Map<Self, F>
1.0.0 · Source§fn filter<P>(self, predicate: P) -> Filter<Self, P>
fn filter<P>(self, predicate: P) -> Filter<Self, P>
1.0.0 · Source§fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>
fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>
1.0.0 · Source§fn enumerate(self) -> Enumerate<Self>where
│ │ │ │ + Self: Sized,
fn enumerate(self) -> Enumerate<Self>where
│ │ │ │ + Self: Sized,
1.0.0 · Source§fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>
fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>
1.0.0 · Source§fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>
fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>
1.57.0 · Source§fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P>
fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P>
1.0.0 · Source§fn skip(self, n: usize) -> Skip<Self>where
│ │ │ │ - Self: Sized,
fn skip(self, n: usize) -> Skip<Self>where
│ │ │ │ - Self: Sized,
n
elements. Read more1.0.0 · Source§fn take(self, n: usize) -> Take<Self>where
│ │ │ │ - Self: Sized,
fn take(self, n: usize) -> Take<Self>where
│ │ │ │ - Self: Sized,
n
elements, or fewer
│ │ │ │ -if the underlying iterator ends sooner. Read more1.0.0 · Source§fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>
fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>
1.29.0 · Source§fn flatten(self) -> Flatten<Self>
fn flatten(self) -> Flatten<Self>
Source§fn map_windows<F, R, const N: usize>(self, f: F) -> MapWindows<Self, F, N>
fn map_windows<F, R, const N: usize>(self, f: F) -> MapWindows<Self, F, N>
iter_map_windows
#87155)f
for each contiguous window of size N
over
│ │ │ │ -self
and returns an iterator over the outputs of f
. Like slice::windows()
,
│ │ │ │ -the windows during mapping overlap as well. Read more1.0.0 · Source§fn inspect<F>(self, f: F) -> Inspect<Self, F>
fn inspect<F>(self, f: F) -> Inspect<Self, F>
1.0.0 · Source§fn by_ref(&mut self) -> &mut Selfwhere
│ │ │ │ - Self: Sized,
fn by_ref(&mut self) -> &mut Selfwhere
│ │ │ │ - Self: Sized,
Source§fn try_collect<B>(
│ │ │ │ +their documentation for more information. Read more
fn try_collect<B>( │ │ │ │ +their documentation for more information. Read more
1.0.0 · Source§fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>
fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>
1.0.0 · Source§fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>
fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>
1.57.0 · Source§fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P>
fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P>
1.0.0 · Source§fn skip(self, n: usize) -> Skip<Self>where
│ │ │ │ + Self: Sized,
fn skip(self, n: usize) -> Skip<Self>where
│ │ │ │ + Self: Sized,
n
elements. Read more1.0.0 · Source§fn take(self, n: usize) -> Take<Self>where
│ │ │ │ + Self: Sized,
fn take(self, n: usize) -> Take<Self>where
│ │ │ │ + Self: Sized,
n
elements, or fewer
│ │ │ │ +if the underlying iterator ends sooner. Read more1.0.0 · Source§fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>
fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>
1.29.0 · Source§fn flatten(self) -> Flatten<Self>
fn flatten(self) -> Flatten<Self>
Source§fn map_windows<F, R, const N: usize>(self, f: F) -> MapWindows<Self, F, N>
fn map_windows<F, R, const N: usize>(self, f: F) -> MapWindows<Self, F, N>
iter_map_windows
#87155)f
for each contiguous window of size N
over
│ │ │ │ +self
and returns an iterator over the outputs of f
. Like slice::windows()
,
│ │ │ │ +the windows during mapping overlap as well. Read more1.0.0 · Source§fn inspect<F>(self, f: F) -> Inspect<Self, F>
fn inspect<F>(self, f: F) -> Inspect<Self, F>
1.0.0 · Source§fn by_ref(&mut self) -> &mut Selfwhere
│ │ │ │ + Self: Sized,
fn by_ref(&mut self) -> &mut Selfwhere
│ │ │ │ + Self: Sized,
Source§fn try_collect<B>(
│ │ │ │ &mut self,
│ │ │ │ -) -> <<Self::Item as Try>::Residual as Residual<B>>::TryType
fn try_collect<B>( │ │ │ │ &mut self, │ │ │ │ -) -> <<Self::Item as Try>::Residual as Residual<B>>::TryType
iterator_try_collect
#94047)Source§fn collect_into<E>(self, collection: &mut E) -> &mut E
fn collect_into<E>(self, collection: &mut E) -> &mut E
iter_collect_into
#94780)1.0.0 · Source§fn partition<B, F>(self, f: F) -> (B, B)
fn partition<B, F>(self, f: F) -> (B, B)
Source§fn partition_in_place<'a, T, P>(self, predicate: P) -> usizewhere
│ │ │ │ +) -> <<Self::Item as Try>::Residual as Residual<B>>::TryTypewhere
│ │ │ │ + Self: Sized,
│ │ │ │ + Self::Item: Try,
│ │ │ │ + <Self::Item as Try>::Residual: Residual<B>,
│ │ │ │ + B: FromIterator<<Self::Item as Try>::Output>,🔬This is a nightly-only experimental API. (iterator_try_collect
#94047)Fallibly transforms an iterator into a collection, short circuiting if
│ │ │ │ +a failure is encountered. Read moreSource§fn collect_into<E>(self, collection: &mut E) -> &mut E
🔬This is a nightly-only experimental API. (iter_collect_into
#94780)Collects all the items from an iterator into a collection. Read more1.0.0 · Source§fn partition<B, F>(self, f: F) -> (B, B)
Consumes an iterator, creating two collections from it. Read moreSource§fn partition_in_place<'a, T, P>(self, predicate: P) -> usize
🔬This is a nightly-only experimental API. (iter_partition_in_place
#62543)Reorders the elements of this iterator in-place according to the given predicate,
│ │ │ │ + Self: Sized + DoubleEndedIterator<Item = &'a mut T>,
│ │ │ │ + P: FnMut(&T) -> bool,🔬This is a nightly-only experimental API. (iter_partition_in_place
#62543)Reorders the elements of this iterator in-place according to the given predicate,
│ │ │ │ such that all those that return true
precede all those that return false
.
│ │ │ │ -Returns the number of true
elements found. Read moreSource§fn is_partitioned<P>(self, predicate: P) -> bool
🔬This is a nightly-only experimental API. (iter_is_partitioned
#62544)Checks if the elements of this iterator are partitioned according to the given predicate,
│ │ │ │ -such that all those that return true
precede all those that return false
. Read more1.27.0 · Source§fn try_fold<B, F, R>(&mut self, init: B, f: F) -> R
An iterator method that applies a function as long as it returns
│ │ │ │ -successfully, producing a single, final value. Read more1.27.0 · Source§fn try_for_each<F, R>(&mut self, f: F) -> R
An iterator method that applies a fallible function to each item in the
│ │ │ │ -iterator, stopping at the first error and returning that error. Read more1.0.0 · Source§fn fold<B, F>(self, init: B, f: F) -> B
Folds every element into an accumulator by applying an operation,
│ │ │ │ -returning the final result. Read more1.51.0 · Source§fn reduce<F>(self, f: F) -> Option<Self::Item>
Reduces the elements to a single one, by repeatedly applying a reducing
│ │ │ │ -operation. Read moreSource§fn try_reduce<R>(
│ │ │ │ +Returns the number of true
elements found. Read more
fn partition_in_place<'a, T, P>(self, predicate: P) -> usizewhere
│ │ │ │ +) -> <<Self::Item as Try>::Residual as Residual<B>>::TryTypewhere
│ │ │ │ + Self: Sized,
│ │ │ │ + Self::Item: Try,
│ │ │ │ + <Self::Item as Try>::Residual: Residual<B>,
│ │ │ │ + B: FromIterator<<Self::Item as Try>::Output>,🔬This is a nightly-only experimental API. (iterator_try_collect
#94047)Fallibly transforms an iterator into a collection, short circuiting if
│ │ │ │ +a failure is encountered. Read moreSource§fn collect_into<E>(self, collection: &mut E) -> &mut E
🔬This is a nightly-only experimental API. (iter_collect_into
#94780)Collects all the items from an iterator into a collection. Read more1.0.0 · Source§fn partition<B, F>(self, f: F) -> (B, B)
Consumes an iterator, creating two collections from it. Read moreSource§fn partition_in_place<'a, T, P>(self, predicate: P) -> usize
🔬This is a nightly-only experimental API. (iter_partition_in_place
#62543)Reorders the elements of this iterator in-place according to the given predicate,
│ │ │ │ + Self: Sized + DoubleEndedIterator<Item = &'a mut T>,
│ │ │ │ + P: FnMut(&T) -> bool,🔬This is a nightly-only experimental API. (iter_partition_in_place
#62543)Reorders the elements of this iterator in-place according to the given predicate,
│ │ │ │ such that all those that return true
precede all those that return false
.
│ │ │ │ -Returns the number of true
elements found. Read moreSource§fn is_partitioned<P>(self, predicate: P) -> bool
🔬This is a nightly-only experimental API. (iter_is_partitioned
#62544)Checks if the elements of this iterator are partitioned according to the given predicate,
│ │ │ │ -such that all those that return true
precede all those that return false
. Read more1.27.0 · Source§fn try_fold<B, F, R>(&mut self, init: B, f: F) -> R
An iterator method that applies a function as long as it returns
│ │ │ │ -successfully, producing a single, final value. Read more1.27.0 · Source§fn try_for_each<F, R>(&mut self, f: F) -> R
An iterator method that applies a fallible function to each item in the
│ │ │ │ -iterator, stopping at the first error and returning that error. Read more1.0.0 · Source§fn fold<B, F>(self, init: B, f: F) -> B
Folds every element into an accumulator by applying an operation,
│ │ │ │ -returning the final result. Read more1.51.0 · Source§fn reduce<F>(self, f: F) -> Option<Self::Item>
Reduces the elements to a single one, by repeatedly applying a reducing
│ │ │ │ -operation. Read moreSource§fn try_reduce<R>(
│ │ │ │ +Returns the number of true
elements found. Read more
iterator_try_collect
#94047)Source§fn collect_into<E>(self, collection: &mut E) -> &mut E
fn collect_into<E>(self, collection: &mut E) -> &mut E
iter_collect_into
#94780)1.0.0 · Source§fn partition<B, F>(self, f: F) -> (B, B)
fn partition<B, F>(self, f: F) -> (B, B)
Source§fn partition_in_place<'a, T, P>(self, predicate: P) -> usize
fn partition_in_place<'a, T, P>(self, predicate: P) -> usize
iter_partition_in_place
#62543)iter_partition_in_place
#62543)true
precede all those that return false
.
│ │ │ │ -Returns the number of true
elements found. Read moreSource§fn is_partitioned<P>(self, predicate: P) -> bool
fn is_partitioned<P>(self, predicate: P) -> bool
iter_is_partitioned
#62544)true
precede all those that return false
. Read more1.27.0 · Source§fn try_fold<B, F, R>(&mut self, init: B, f: F) -> R
fn try_fold<B, F, R>(&mut self, init: B, f: F) -> R
1.27.0 · Source§fn try_for_each<F, R>(&mut self, f: F) -> R
fn try_for_each<F, R>(&mut self, f: F) -> R
1.0.0 · Source§fn fold<B, F>(self, init: B, f: F) -> B
fn fold<B, F>(self, init: B, f: F) -> B
1.51.0 · Source§fn reduce<F>(self, f: F) -> Option<Self::Item>
fn reduce<F>(self, f: F) -> Option<Self::Item>
Source§fn try_reduce<R>(
│ │ │ │ +Returns the number of true
elements found. Read more
fn try_reduce<R>(
│ │ │ │ +Returns the number of true
elements found. Read more
Source§fn is_partitioned<P>(self, predicate: P) -> bool
fn is_partitioned<P>(self, predicate: P) -> bool
iter_is_partitioned
#62544)true
precede all those that return false
. Read more1.27.0 · Source§fn try_fold<B, F, R>(&mut self, init: B, f: F) -> R
fn try_fold<B, F, R>(&mut self, init: B, f: F) -> R
1.27.0 · Source§fn try_for_each<F, R>(&mut self, f: F) -> R
fn try_for_each<F, R>(&mut self, f: F) -> R
1.0.0 · Source§fn fold<B, F>(self, init: B, f: F) -> B
fn fold<B, F>(self, init: B, f: F) -> B
1.51.0 · Source§fn reduce<F>(self, f: F) -> Option<Self::Item>
fn reduce<F>(self, f: F) -> Option<Self::Item>
Source§fn try_reduce<R>(
│ │ │ │ &mut self,
│ │ │ │ - f: impl FnMut(Self::Item, Self::Item) -> R,
│ │ │ │ -) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryType
fn try_reduce<R>( │ │ │ │ &mut self, │ │ │ │ - f: impl FnMut(Self::Item, Self::Item) -> R, │ │ │ │ -) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryType
iterator_try_reduce
#87053)1.0.0 · Source§fn all<F>(&mut self, f: F) -> bool
fn all<F>(&mut self, f: F) -> bool
1.0.0 · Source§fn any<F>(&mut self, f: F) -> bool
fn any<F>(&mut self, f: F) -> bool
1.0.0 · Source§fn find<P>(&mut self, predicate: P) -> Option<Self::Item>
fn find<P>(&mut self, predicate: P) -> Option<Self::Item>
1.30.0 · Source§fn find_map<B, F>(&mut self, f: F) -> Option<B>
fn find_map<B, F>(&mut self, f: F) -> Option<B>
Source§fn try_find<R>(
│ │ │ │ + f: impl FnMut(Self::Item, Self::Item) -> R,
│ │ │ │ +) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryType
fn try_find<R>( │ │ │ │ + f: impl FnMut(Self::Item, Self::Item) -> R, │ │ │ │ +) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryType
iterator_try_reduce
#87053)1.0.0 · Source§fn all<F>(&mut self, f: F) -> bool
fn all<F>(&mut self, f: F) -> bool
1.0.0 · Source§fn any<F>(&mut self, f: F) -> bool
fn any<F>(&mut self, f: F) -> bool
1.0.0 · Source§fn find<P>(&mut self, predicate: P) -> Option<Self::Item>
fn find<P>(&mut self, predicate: P) -> Option<Self::Item>
1.30.0 · Source§fn find_map<B, F>(&mut self, f: F) -> Option<B>
fn find_map<B, F>(&mut self, f: F) -> Option<B>
Source§fn try_find<R>(
│ │ │ │ &mut self,
│ │ │ │ - f: impl FnMut(&Self::Item) -> R,
│ │ │ │ -) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryType
fn try_find<R>( │ │ │ │ &mut self, │ │ │ │ - f: impl FnMut(&Self::Item) -> R, │ │ │ │ -) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryType
try_find
#63178)1.0.0 · Source§fn position<P>(&mut self, predicate: P) -> Option<usize>
fn position<P>(&mut self, predicate: P) -> Option<usize>
1.0.0 · Source§fn rposition<P>(&mut self, predicate: P) -> Option<usize>where
│ │ │ │ - P: FnMut(Self::Item) -> bool,
│ │ │ │ - Self: Sized + ExactSizeIterator + DoubleEndedIterator,
fn rposition<P>(&mut self, predicate: P) -> Option<usize>where
│ │ │ │ - P: FnMut(Self::Item) -> bool,
│ │ │ │ - Self: Sized + ExactSizeIterator + DoubleEndedIterator,
1.0.0 · Source§fn max(self) -> Option<Self::Item>
fn max(self) -> Option<Self::Item>
1.0.0 · Source§fn min(self) -> Option<Self::Item>
fn min(self) -> Option<Self::Item>
1.6.0 · Source§fn max_by_key<B, F>(self, f: F) -> Option<Self::Item>
fn max_by_key<B, F>(self, f: F) -> Option<Self::Item>
1.15.0 · Source§fn max_by<F>(self, compare: F) -> Option<Self::Item>
fn max_by<F>(self, compare: F) -> Option<Self::Item>
1.6.0 · Source§fn min_by_key<B, F>(self, f: F) -> Option<Self::Item>
fn min_by_key<B, F>(self, f: F) -> Option<Self::Item>
1.15.0 · Source§fn min_by<F>(self, compare: F) -> Option<Self::Item>
fn min_by<F>(self, compare: F) -> Option<Self::Item>
1.0.0 · Source§fn rev(self) -> Rev<Self>where
│ │ │ │ - Self: Sized + DoubleEndedIterator,
fn rev(self) -> Rev<Self>where
│ │ │ │ - Self: Sized + DoubleEndedIterator,
1.0.0 · Source§fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)
fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)
1.36.0 · Source§fn copied<'a, T>(self) -> Copied<Self>
fn copied<'a, T>(self) -> Copied<Self>
Source§fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N>where
│ │ │ │ - Self: Sized,
fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N>where
│ │ │ │ - Self: Sized,
iter_array_chunks
#100450)N
elements of the iterator at a time. Read more1.11.0 · Source§fn product<P>(self) -> P
fn product<P>(self) -> P
1.5.0 · Source§fn cmp<I>(self, other: I) -> Orderingwhere
│ │ │ │ - I: IntoIterator<Item = Self::Item>,
│ │ │ │ - Self::Item: Ord,
│ │ │ │ - Self: Sized,
fn cmp<I>(self, other: I) -> Orderingwhere
│ │ │ │ - I: IntoIterator<Item = Self::Item>,
│ │ │ │ - Self::Item: Ord,
│ │ │ │ - Self: Sized,
Source§fn cmp_by<I, F>(self, other: I, cmp: F) -> Orderingwhere
│ │ │ │ - Self: Sized,
│ │ │ │ - I: IntoIterator,
│ │ │ │ - F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Ordering,
fn cmp_by<I, F>(self, other: I, cmp: F) -> Orderingwhere
│ │ │ │ - Self: Sized,
│ │ │ │ - I: IntoIterator,
│ │ │ │ - F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Ordering,
iter_order_by
#64295)Iterator
with those
│ │ │ │ -of another with respect to the specified comparison function. Read more1.5.0 · Source§fn partial_cmp<I>(self, other: I) -> Option<Ordering>where
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
fn partial_cmp<I>(self, other: I) -> Option<Ordering>where
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
PartialOrd
elements of
│ │ │ │ -this Iterator
with those of another. The comparison works like short-circuit
│ │ │ │ + f: impl FnMut(&Self::Item) -> R,
│ │ │ │ +) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryTypetry_find
#63178)1.0.0 · Source§fn position<P>(&mut self, predicate: P) -> Option<usize>
fn position<P>(&mut self, predicate: P) -> Option<usize>
1.0.0 · Source§fn rposition<P>(&mut self, predicate: P) -> Option<usize>where
│ │ │ │ + P: FnMut(Self::Item) -> bool,
│ │ │ │ + Self: Sized + ExactSizeIterator + DoubleEndedIterator,
fn rposition<P>(&mut self, predicate: P) -> Option<usize>where
│ │ │ │ + P: FnMut(Self::Item) -> bool,
│ │ │ │ + Self: Sized + ExactSizeIterator + DoubleEndedIterator,
1.0.0 · Source§fn max(self) -> Option<Self::Item>
fn max(self) -> Option<Self::Item>
1.0.0 · Source§fn min(self) -> Option<Self::Item>
fn min(self) -> Option<Self::Item>
1.6.0 · Source§fn max_by_key<B, F>(self, f: F) -> Option<Self::Item>
fn max_by_key<B, F>(self, f: F) -> Option<Self::Item>
1.15.0 · Source§fn max_by<F>(self, compare: F) -> Option<Self::Item>
fn max_by<F>(self, compare: F) -> Option<Self::Item>
1.6.0 · Source§fn min_by_key<B, F>(self, f: F) -> Option<Self::Item>
fn min_by_key<B, F>(self, f: F) -> Option<Self::Item>
1.15.0 · Source§fn min_by<F>(self, compare: F) -> Option<Self::Item>
fn min_by<F>(self, compare: F) -> Option<Self::Item>
1.0.0 · Source§fn rev(self) -> Rev<Self>where
│ │ │ │ + Self: Sized + DoubleEndedIterator,
fn rev(self) -> Rev<Self>where
│ │ │ │ + Self: Sized + DoubleEndedIterator,
1.0.0 · Source§fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)
fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)
1.36.0 · Source§fn copied<'a, T>(self) -> Copied<Self>
fn copied<'a, T>(self) -> Copied<Self>
Source§fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N>where
│ │ │ │ + Self: Sized,
fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N>where
│ │ │ │ + Self: Sized,
iter_array_chunks
#100450)N
elements of the iterator at a time. Read more1.11.0 · Source§fn product<P>(self) -> P
fn product<P>(self) -> P
1.5.0 · Source§fn cmp<I>(self, other: I) -> Orderingwhere
│ │ │ │ + I: IntoIterator<Item = Self::Item>,
│ │ │ │ + Self::Item: Ord,
│ │ │ │ + Self: Sized,
fn cmp<I>(self, other: I) -> Orderingwhere
│ │ │ │ + I: IntoIterator<Item = Self::Item>,
│ │ │ │ + Self::Item: Ord,
│ │ │ │ + Self: Sized,
Source§fn cmp_by<I, F>(self, other: I, cmp: F) -> Orderingwhere
│ │ │ │ + Self: Sized,
│ │ │ │ + I: IntoIterator,
│ │ │ │ + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Ordering,
fn cmp_by<I, F>(self, other: I, cmp: F) -> Orderingwhere
│ │ │ │ + Self: Sized,
│ │ │ │ + I: IntoIterator,
│ │ │ │ + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Ordering,
iter_order_by
#64295)Iterator
with those
│ │ │ │ +of another with respect to the specified comparison function. Read more1.5.0 · Source§fn partial_cmp<I>(self, other: I) -> Option<Ordering>where
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
fn partial_cmp<I>(self, other: I) -> Option<Ordering>where
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
PartialOrd
elements of
│ │ │ │ +this Iterator
with those of another. The comparison works like short-circuit
│ │ │ │ evaluation, returning a result without comparing the remaining elements.
│ │ │ │ -As soon as an order can be determined, the evaluation stops and a result is returned. Read moreSource§fn partial_cmp_by<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering>where
│ │ │ │ - Self: Sized,
│ │ │ │ - I: IntoIterator,
│ │ │ │ - F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Option<Ordering>,
fn partial_cmp_by<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering>where
│ │ │ │ - Self: Sized,
│ │ │ │ - I: IntoIterator,
│ │ │ │ - F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Option<Ordering>,
iter_order_by
#64295)Iterator
with those
│ │ │ │ -of another with respect to the specified comparison function. Read more1.5.0 · Source§fn eq<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialEq<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
fn eq<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialEq<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
Source§fn eq_by<I, F>(self, other: I, eq: F) -> boolwhere
│ │ │ │ - Self: Sized,
│ │ │ │ - I: IntoIterator,
│ │ │ │ - F: FnMut(Self::Item, <I as IntoIterator>::Item) -> bool,
fn eq_by<I, F>(self, other: I, eq: F) -> boolwhere
│ │ │ │ - Self: Sized,
│ │ │ │ - I: IntoIterator,
│ │ │ │ - F: FnMut(Self::Item, <I as IntoIterator>::Item) -> bool,
iter_order_by
#64295)1.5.0 · Source§fn ne<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialEq<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
fn ne<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialEq<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
1.5.0 · Source§fn lt<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
fn lt<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
Iterator
are lexicographically
│ │ │ │ -less than those of another. Read more1.5.0 · Source§fn le<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
fn le<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
Iterator
are lexicographically
│ │ │ │ -less or equal to those of another. Read more1.5.0 · Source§fn gt<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
fn gt<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
Iterator
are lexicographically
│ │ │ │ -greater than those of another. Read more1.5.0 · Source§fn ge<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
fn ge<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
Iterator
are lexicographically
│ │ │ │ -greater than or equal to those of another. Read more1.82.0 · Source§fn is_sorted(self) -> bool
fn is_sorted(self) -> bool
1.82.0 · Source§fn is_sorted_by<F>(self, compare: F) -> bool
fn is_sorted_by<F>(self, compare: F) -> bool
1.82.0 · Source§fn is_sorted_by_key<F, K>(self, f: F) -> bool
fn is_sorted_by_key<F, K>(self, f: F) -> bool
impl<T, A: Allocator> FusedIterator for Drain<'_, T, A>
Auto Trait Implementations§
impl<'a, T, A> Freeze for Drain<'a, T, A>
impl<'a, T, A> RefUnwindSafe for Drain<'a, T, A>where
│ │ │ │ - T: RefUnwindSafe,
│ │ │ │ - A: RefUnwindSafe,
impl<'a, T, A> Send for Drain<'a, T, A>
impl<'a, T, A> Sync for Drain<'a, T, A>
impl<'a, T, A> Unpin for Drain<'a, T, A>
impl<'a, T, A> UnwindSafe for Drain<'a, T, A>where
│ │ │ │ - T: RefUnwindSafe,
│ │ │ │ - A: RefUnwindSafe,
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
Source§impl<T, U> Into<U> for Twhere
│ │ │ │ - U: From<T>,
impl<T, U> Into<U> for Twhere
│ │ │ │ - U: From<T>,
Source§fn into(self) -> U
fn into(self) -> U
Calls U::from(self)
.
Source§fn partial_cmp_by<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering>where
│ │ │ │ + Self: Sized,
│ │ │ │ + I: IntoIterator,
│ │ │ │ + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Option<Ordering>,
fn partial_cmp_by<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering>where
│ │ │ │ + Self: Sized,
│ │ │ │ + I: IntoIterator,
│ │ │ │ + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Option<Ordering>,
iter_order_by
#64295)Iterator
with those
│ │ │ │ +of another with respect to the specified comparison function. Read more1.5.0 · Source§fn eq<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialEq<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
fn eq<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialEq<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
Source§fn eq_by<I, F>(self, other: I, eq: F) -> boolwhere
│ │ │ │ + Self: Sized,
│ │ │ │ + I: IntoIterator,
│ │ │ │ + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> bool,
fn eq_by<I, F>(self, other: I, eq: F) -> boolwhere
│ │ │ │ + Self: Sized,
│ │ │ │ + I: IntoIterator,
│ │ │ │ + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> bool,
iter_order_by
#64295)1.5.0 · Source§fn ne<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialEq<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
fn ne<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialEq<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
1.5.0 · Source§fn lt<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
fn lt<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
Iterator
are lexicographically
│ │ │ │ +less than those of another. Read more1.5.0 · Source§fn le<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
fn le<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
Iterator
are lexicographically
│ │ │ │ +less or equal to those of another. Read more1.5.0 · Source§fn gt<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
fn gt<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
Iterator
are lexicographically
│ │ │ │ +greater than those of another. Read more1.5.0 · Source§fn ge<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
fn ge<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
Iterator
are lexicographically
│ │ │ │ +greater than or equal to those of another. Read more1.82.0 · Source§fn is_sorted(self) -> bool
fn is_sorted(self) -> bool
1.82.0 · Source§fn is_sorted_by<F>(self, compare: F) -> bool
fn is_sorted_by<F>(self, compare: F) -> bool
1.82.0 · Source§fn is_sorted_by_key<F, K>(self, f: F) -> bool
fn is_sorted_by_key<F, K>(self, f: F) -> bool
impl<T, A: Allocator> FusedIterator for Drain<'_, T, A>
Auto Trait Implementations§
impl<'a, T, A> Freeze for Drain<'a, T, A>
impl<'a, T, A> RefUnwindSafe for Drain<'a, T, A>where
│ │ │ │ + T: RefUnwindSafe,
│ │ │ │ + A: RefUnwindSafe,
impl<'a, T, A> Send for Drain<'a, T, A>
impl<'a, T, A> Sync for Drain<'a, T, A>
impl<'a, T, A> Unpin for Drain<'a, T, A>
impl<'a, T, A> UnwindSafe for Drain<'a, T, A>where
│ │ │ │ + T: RefUnwindSafe,
│ │ │ │ + A: RefUnwindSafe,
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
Source§impl<I> IntoIterator for Iwhere
│ │ │ │ - I: Iterator,
impl<I> IntoIterator for Iwhere
│ │ │ │ - I: Iterator,
From<T> for U
chooses to do.
│ │ │ │ +Source§impl<I> IntoIterator for Iwhere
│ │ │ │ + I: Iterator,
impl<I> IntoIterator for Iwhere
│ │ │ │ + I: Iterator,
pub struct DrainSorted<'a, T: Ord, A: Allocator = Global> { /* private fields */ }
binary_heap_drain_sorted
#59278)Expand description
A draining iterator over the elements of a BinaryHeap
.
pub struct DrainSorted<'a, T: Ord, A: Allocator = Global> { /* private fields */ }
binary_heap_drain_sorted
#59278)Expand description
A draining iterator over the elements of a BinaryHeap
.
This struct
is created by BinaryHeap::drain_sorted()
. See its
│ │ │ │ documentation for more.
Implementations§
Trait Implementations§
Source§impl<T: Ord, A: Allocator> ExactSizeIterator for DrainSorted<'_, T, A>
impl<T: Ord, A: Allocator> ExactSizeIterator for DrainSorted<'_, T, A>
Source§impl<T: Ord, A: Allocator> Iterator for DrainSorted<'_, T, A>
impl<T: Ord, A: Allocator> Iterator for DrainSorted<'_, T, A>
Implementations§
Trait Implementations§
Source§impl<T: Ord, A: Allocator> ExactSizeIterator for DrainSorted<'_, T, A>
impl<T: Ord, A: Allocator> ExactSizeIterator for DrainSorted<'_, T, A>
Source§impl<T: Ord, A: Allocator> Iterator for DrainSorted<'_, T, A>
impl<T: Ord, A: Allocator> Iterator for DrainSorted<'_, T, A>
Source§fn size_hint(&self) -> (usize, Option<usize>)
fn size_hint(&self) -> (usize, Option<usize>)
Source§fn next_chunk<const N: usize>(
│ │ │ │ &mut self,
│ │ │ │ -) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>where
│ │ │ │ - Self: Sized,
fn next_chunk<const N: usize>(
│ │ │ │ &mut self,
│ │ │ │ -) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>where
│ │ │ │ - Self: Sized,
iter_next_chunk
#98326)N
values. Read more1.0.0 · Source§fn count(self) -> usizewhere
│ │ │ │ - Self: Sized,
fn count(self) -> usizewhere
│ │ │ │ - Self: Sized,
1.0.0 · Source§fn last(self) -> Option<Self::Item>where
│ │ │ │ - Self: Sized,
fn last(self) -> Option<Self::Item>where
│ │ │ │ - Self: Sized,
Source§fn advance_by(&mut self, n: usize) -> Result<(), NonZero<usize>>
fn advance_by(&mut self, n: usize) -> Result<(), NonZero<usize>>
iter_advance_by
#77404)n
elements. Read more1.0.0 · Source§fn nth(&mut self, n: usize) -> Option<Self::Item>
fn nth(&mut self, n: usize) -> Option<Self::Item>
n
th element of the iterator. Read more1.28.0 · Source§fn step_by(self, step: usize) -> StepBy<Self>where
│ │ │ │ - Self: Sized,
fn step_by(self, step: usize) -> StepBy<Self>where
│ │ │ │ - Self: Sized,
1.0.0 · Source§fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>
fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>
1.0.0 · Source§fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>where
│ │ │ │ - Self: Sized,
│ │ │ │ - U: IntoIterator,
fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>where
│ │ │ │ - Self: Sized,
│ │ │ │ - U: IntoIterator,
Source§fn intersperse(self, separator: Self::Item) -> Intersperse<Self>
fn intersperse(self, separator: Self::Item) -> Intersperse<Self>
iter_intersperse
#79524)separator
between adjacent
│ │ │ │ -items of the original iterator. Read moreSource§fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G>
fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G>
iter_intersperse
#79524)separator
│ │ │ │ -between adjacent items of the original iterator. Read more1.0.0 · Source§fn map<B, F>(self, f: F) -> Map<Self, F>
fn map<B, F>(self, f: F) -> Map<Self, F>
1.0.0 · Source§fn filter<P>(self, predicate: P) -> Filter<Self, P>
fn filter<P>(self, predicate: P) -> Filter<Self, P>
1.0.0 · Source§fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>
fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>
1.0.0 · Source§fn enumerate(self) -> Enumerate<Self>where
│ │ │ │ - Self: Sized,
fn enumerate(self) -> Enumerate<Self>where
│ │ │ │ - Self: Sized,
1.0.0 · Source§fn peekable(self) -> Peekable<Self>where
│ │ │ │ - Self: Sized,
fn peekable(self) -> Peekable<Self>where
│ │ │ │ - Self: Sized,
peek
and peek_mut
methods
│ │ │ │ +) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>iter_next_chunk
#98326)N
values. Read more1.0.0 · Source§fn count(self) -> usizewhere
│ │ │ │ + Self: Sized,
fn count(self) -> usizewhere
│ │ │ │ + Self: Sized,
1.0.0 · Source§fn last(self) -> Option<Self::Item>where
│ │ │ │ + Self: Sized,
fn last(self) -> Option<Self::Item>where
│ │ │ │ + Self: Sized,
Source§fn advance_by(&mut self, n: usize) -> Result<(), NonZero<usize>>
fn advance_by(&mut self, n: usize) -> Result<(), NonZero<usize>>
iter_advance_by
#77404)n
elements. Read more1.0.0 · Source§fn nth(&mut self, n: usize) -> Option<Self::Item>
fn nth(&mut self, n: usize) -> Option<Self::Item>
n
th element of the iterator. Read more1.28.0 · Source§fn step_by(self, step: usize) -> StepBy<Self>where
│ │ │ │ + Self: Sized,
fn step_by(self, step: usize) -> StepBy<Self>where
│ │ │ │ + Self: Sized,
1.0.0 · Source§fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>
fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>
1.0.0 · Source§fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>where
│ │ │ │ + Self: Sized,
│ │ │ │ + U: IntoIterator,
fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>where
│ │ │ │ + Self: Sized,
│ │ │ │ + U: IntoIterator,
Source§fn intersperse(self, separator: Self::Item) -> Intersperse<Self>
fn intersperse(self, separator: Self::Item) -> Intersperse<Self>
iter_intersperse
#79524)separator
between adjacent
│ │ │ │ +items of the original iterator. Read moreSource§fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G>
fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G>
iter_intersperse
#79524)separator
│ │ │ │ +between adjacent items of the original iterator. Read more1.0.0 · Source§fn map<B, F>(self, f: F) -> Map<Self, F>
fn map<B, F>(self, f: F) -> Map<Self, F>
1.0.0 · Source§fn filter<P>(self, predicate: P) -> Filter<Self, P>
fn filter<P>(self, predicate: P) -> Filter<Self, P>
1.0.0 · Source§fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>
fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>
1.0.0 · Source§fn enumerate(self) -> Enumerate<Self>where
│ │ │ │ + Self: Sized,
fn enumerate(self) -> Enumerate<Self>where
│ │ │ │ + Self: Sized,
1.0.0 · Source§fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>
fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>
1.0.0 · Source§fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>
fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>
1.57.0 · Source§fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P>
fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P>
1.0.0 · Source§fn skip(self, n: usize) -> Skip<Self>where
│ │ │ │ - Self: Sized,
fn skip(self, n: usize) -> Skip<Self>where
│ │ │ │ - Self: Sized,
n
elements. Read more1.0.0 · Source§fn take(self, n: usize) -> Take<Self>where
│ │ │ │ - Self: Sized,
fn take(self, n: usize) -> Take<Self>where
│ │ │ │ - Self: Sized,
n
elements, or fewer
│ │ │ │ -if the underlying iterator ends sooner. Read more1.0.0 · Source§fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>
fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>
1.29.0 · Source§fn flatten(self) -> Flatten<Self>
fn flatten(self) -> Flatten<Self>
Source§fn map_windows<F, R, const N: usize>(self, f: F) -> MapWindows<Self, F, N>
fn map_windows<F, R, const N: usize>(self, f: F) -> MapWindows<Self, F, N>
iter_map_windows
#87155)f
for each contiguous window of size N
over
│ │ │ │ -self
and returns an iterator over the outputs of f
. Like slice::windows()
,
│ │ │ │ -the windows during mapping overlap as well. Read more1.0.0 · Source§fn inspect<F>(self, f: F) -> Inspect<Self, F>
fn inspect<F>(self, f: F) -> Inspect<Self, F>
1.0.0 · Source§fn by_ref(&mut self) -> &mut Selfwhere
│ │ │ │ - Self: Sized,
fn by_ref(&mut self) -> &mut Selfwhere
│ │ │ │ - Self: Sized,
Source§fn try_collect<B>(
│ │ │ │ +their documentation for more information. Read more
fn try_collect<B>( │ │ │ │ +their documentation for more information. Read more
1.0.0 · Source§fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>
fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>
1.0.0 · Source§fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>
fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>
1.57.0 · Source§fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P>
fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P>
1.0.0 · Source§fn skip(self, n: usize) -> Skip<Self>where
│ │ │ │ + Self: Sized,
fn skip(self, n: usize) -> Skip<Self>where
│ │ │ │ + Self: Sized,
n
elements. Read more1.0.0 · Source§fn take(self, n: usize) -> Take<Self>where
│ │ │ │ + Self: Sized,
fn take(self, n: usize) -> Take<Self>where
│ │ │ │ + Self: Sized,
n
elements, or fewer
│ │ │ │ +if the underlying iterator ends sooner. Read more1.0.0 · Source§fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>
fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>
1.29.0 · Source§fn flatten(self) -> Flatten<Self>
fn flatten(self) -> Flatten<Self>
Source§fn map_windows<F, R, const N: usize>(self, f: F) -> MapWindows<Self, F, N>
fn map_windows<F, R, const N: usize>(self, f: F) -> MapWindows<Self, F, N>
iter_map_windows
#87155)f
for each contiguous window of size N
over
│ │ │ │ +self
and returns an iterator over the outputs of f
. Like slice::windows()
,
│ │ │ │ +the windows during mapping overlap as well. Read more1.0.0 · Source§fn inspect<F>(self, f: F) -> Inspect<Self, F>
fn inspect<F>(self, f: F) -> Inspect<Self, F>
1.0.0 · Source§fn by_ref(&mut self) -> &mut Selfwhere
│ │ │ │ + Self: Sized,
fn by_ref(&mut self) -> &mut Selfwhere
│ │ │ │ + Self: Sized,
Source§fn try_collect<B>(
│ │ │ │ &mut self,
│ │ │ │ -) -> <<Self::Item as Try>::Residual as Residual<B>>::TryType
fn try_collect<B>( │ │ │ │ &mut self, │ │ │ │ -) -> <<Self::Item as Try>::Residual as Residual<B>>::TryType
iterator_try_collect
#94047)Source§fn collect_into<E>(self, collection: &mut E) -> &mut E
fn collect_into<E>(self, collection: &mut E) -> &mut E
iter_collect_into
#94780)1.0.0 · Source§fn partition<B, F>(self, f: F) -> (B, B)
fn partition<B, F>(self, f: F) -> (B, B)
Source§fn is_partitioned<P>(self, predicate: P) -> bool
fn is_partitioned<P>(self, predicate: P) -> bool
iter_is_partitioned
#62544)true
precede all those that return false
. Read more1.27.0 · Source§fn try_fold<B, F, R>(&mut self, init: B, f: F) -> R
fn try_fold<B, F, R>(&mut self, init: B, f: F) -> R
1.27.0 · Source§fn try_for_each<F, R>(&mut self, f: F) -> R
fn try_for_each<F, R>(&mut self, f: F) -> R
1.0.0 · Source§fn fold<B, F>(self, init: B, f: F) -> B
fn fold<B, F>(self, init: B, f: F) -> B
1.51.0 · Source§fn reduce<F>(self, f: F) -> Option<Self::Item>
fn reduce<F>(self, f: F) -> Option<Self::Item>
Source§fn try_reduce<R>(
│ │ │ │ +) -> <<Self::Item as Try>::Residual as Residual<B>>::TryType
fn try_reduce<R>( │ │ │ │ +) -> <<Self::Item as Try>::Residual as Residual<B>>::TryType
iterator_try_collect
#94047)Source§fn collect_into<E>(self, collection: &mut E) -> &mut E
fn collect_into<E>(self, collection: &mut E) -> &mut E
iter_collect_into
#94780)1.0.0 · Source§fn partition<B, F>(self, f: F) -> (B, B)
fn partition<B, F>(self, f: F) -> (B, B)
Source§fn is_partitioned<P>(self, predicate: P) -> bool
fn is_partitioned<P>(self, predicate: P) -> bool
iter_is_partitioned
#62544)true
precede all those that return false
. Read more1.27.0 · Source§fn try_fold<B, F, R>(&mut self, init: B, f: F) -> R
fn try_fold<B, F, R>(&mut self, init: B, f: F) -> R
1.27.0 · Source§fn try_for_each<F, R>(&mut self, f: F) -> R
fn try_for_each<F, R>(&mut self, f: F) -> R
1.0.0 · Source§fn fold<B, F>(self, init: B, f: F) -> B
fn fold<B, F>(self, init: B, f: F) -> B
1.51.0 · Source§fn reduce<F>(self, f: F) -> Option<Self::Item>
fn reduce<F>(self, f: F) -> Option<Self::Item>
Source§fn try_reduce<R>(
│ │ │ │ &mut self,
│ │ │ │ - f: impl FnMut(Self::Item, Self::Item) -> R,
│ │ │ │ -) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryType
fn try_reduce<R>( │ │ │ │ &mut self, │ │ │ │ - f: impl FnMut(Self::Item, Self::Item) -> R, │ │ │ │ -) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryType
iterator_try_reduce
#87053)1.0.0 · Source§fn all<F>(&mut self, f: F) -> bool
fn all<F>(&mut self, f: F) -> bool
1.0.0 · Source§fn any<F>(&mut self, f: F) -> bool
fn any<F>(&mut self, f: F) -> bool
1.0.0 · Source§fn find<P>(&mut self, predicate: P) -> Option<Self::Item>
fn find<P>(&mut self, predicate: P) -> Option<Self::Item>
1.30.0 · Source§fn find_map<B, F>(&mut self, f: F) -> Option<B>
fn find_map<B, F>(&mut self, f: F) -> Option<B>
Source§fn try_find<R>(
│ │ │ │ + f: impl FnMut(Self::Item, Self::Item) -> R,
│ │ │ │ +) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryType
fn try_find<R>( │ │ │ │ + f: impl FnMut(Self::Item, Self::Item) -> R, │ │ │ │ +) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryType
iterator_try_reduce
#87053)1.0.0 · Source§fn all<F>(&mut self, f: F) -> bool
fn all<F>(&mut self, f: F) -> bool
1.0.0 · Source§fn any<F>(&mut self, f: F) -> bool
fn any<F>(&mut self, f: F) -> bool
1.0.0 · Source§fn find<P>(&mut self, predicate: P) -> Option<Self::Item>
fn find<P>(&mut self, predicate: P) -> Option<Self::Item>
1.30.0 · Source§fn find_map<B, F>(&mut self, f: F) -> Option<B>
fn find_map<B, F>(&mut self, f: F) -> Option<B>
Source§fn try_find<R>(
│ │ │ │ &mut self,
│ │ │ │ - f: impl FnMut(&Self::Item) -> R,
│ │ │ │ -) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryType
fn try_find<R>( │ │ │ │ &mut self, │ │ │ │ - f: impl FnMut(&Self::Item) -> R, │ │ │ │ -) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryType
try_find
#63178)1.0.0 · Source§fn position<P>(&mut self, predicate: P) -> Option<usize>
fn position<P>(&mut self, predicate: P) -> Option<usize>
1.0.0 · Source§fn max(self) -> Option<Self::Item>
fn max(self) -> Option<Self::Item>
1.0.0 · Source§fn min(self) -> Option<Self::Item>
fn min(self) -> Option<Self::Item>
1.6.0 · Source§fn max_by_key<B, F>(self, f: F) -> Option<Self::Item>
fn max_by_key<B, F>(self, f: F) -> Option<Self::Item>
1.15.0 · Source§fn max_by<F>(self, compare: F) -> Option<Self::Item>
fn max_by<F>(self, compare: F) -> Option<Self::Item>
1.6.0 · Source§fn min_by_key<B, F>(self, f: F) -> Option<Self::Item>
fn min_by_key<B, F>(self, f: F) -> Option<Self::Item>
1.15.0 · Source§fn min_by<F>(self, compare: F) -> Option<Self::Item>
fn min_by<F>(self, compare: F) -> Option<Self::Item>
1.0.0 · Source§fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)
fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)
1.36.0 · Source§fn copied<'a, T>(self) -> Copied<Self>
fn copied<'a, T>(self) -> Copied<Self>
Source§fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N>where
│ │ │ │ - Self: Sized,
fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N>where
│ │ │ │ - Self: Sized,
iter_array_chunks
#100450)N
elements of the iterator at a time. Read more1.11.0 · Source§fn product<P>(self) -> P
fn product<P>(self) -> P
1.5.0 · Source§fn cmp<I>(self, other: I) -> Orderingwhere
│ │ │ │ - I: IntoIterator<Item = Self::Item>,
│ │ │ │ - Self::Item: Ord,
│ │ │ │ - Self: Sized,
fn cmp<I>(self, other: I) -> Orderingwhere
│ │ │ │ - I: IntoIterator<Item = Self::Item>,
│ │ │ │ - Self::Item: Ord,
│ │ │ │ - Self: Sized,
Source§fn cmp_by<I, F>(self, other: I, cmp: F) -> Orderingwhere
│ │ │ │ - Self: Sized,
│ │ │ │ - I: IntoIterator,
│ │ │ │ - F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Ordering,
fn cmp_by<I, F>(self, other: I, cmp: F) -> Orderingwhere
│ │ │ │ - Self: Sized,
│ │ │ │ - I: IntoIterator,
│ │ │ │ - F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Ordering,
iter_order_by
#64295)Iterator
with those
│ │ │ │ -of another with respect to the specified comparison function. Read more1.5.0 · Source§fn partial_cmp<I>(self, other: I) -> Option<Ordering>where
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
fn partial_cmp<I>(self, other: I) -> Option<Ordering>where
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
PartialOrd
elements of
│ │ │ │ -this Iterator
with those of another. The comparison works like short-circuit
│ │ │ │ + f: impl FnMut(&Self::Item) -> R,
│ │ │ │ +) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryTypetry_find
#63178)1.0.0 · Source§fn position<P>(&mut self, predicate: P) -> Option<usize>
fn position<P>(&mut self, predicate: P) -> Option<usize>
1.0.0 · Source§fn max(self) -> Option<Self::Item>
fn max(self) -> Option<Self::Item>
1.0.0 · Source§fn min(self) -> Option<Self::Item>
fn min(self) -> Option<Self::Item>
1.6.0 · Source§fn max_by_key<B, F>(self, f: F) -> Option<Self::Item>
fn max_by_key<B, F>(self, f: F) -> Option<Self::Item>
1.15.0 · Source§fn max_by<F>(self, compare: F) -> Option<Self::Item>
fn max_by<F>(self, compare: F) -> Option<Self::Item>
1.6.0 · Source§fn min_by_key<B, F>(self, f: F) -> Option<Self::Item>
fn min_by_key<B, F>(self, f: F) -> Option<Self::Item>
1.15.0 · Source§fn min_by<F>(self, compare: F) -> Option<Self::Item>
fn min_by<F>(self, compare: F) -> Option<Self::Item>
1.0.0 · Source§fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)
fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)
1.36.0 · Source§fn copied<'a, T>(self) -> Copied<Self>
fn copied<'a, T>(self) -> Copied<Self>
Source§fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N>where
│ │ │ │ + Self: Sized,
fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N>where
│ │ │ │ + Self: Sized,
iter_array_chunks
#100450)N
elements of the iterator at a time. Read more1.11.0 · Source§fn product<P>(self) -> P
fn product<P>(self) -> P
1.5.0 · Source§fn cmp<I>(self, other: I) -> Orderingwhere
│ │ │ │ + I: IntoIterator<Item = Self::Item>,
│ │ │ │ + Self::Item: Ord,
│ │ │ │ + Self: Sized,
fn cmp<I>(self, other: I) -> Orderingwhere
│ │ │ │ + I: IntoIterator<Item = Self::Item>,
│ │ │ │ + Self::Item: Ord,
│ │ │ │ + Self: Sized,
Source§fn cmp_by<I, F>(self, other: I, cmp: F) -> Orderingwhere
│ │ │ │ + Self: Sized,
│ │ │ │ + I: IntoIterator,
│ │ │ │ + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Ordering,
fn cmp_by<I, F>(self, other: I, cmp: F) -> Orderingwhere
│ │ │ │ + Self: Sized,
│ │ │ │ + I: IntoIterator,
│ │ │ │ + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Ordering,
iter_order_by
#64295)Iterator
with those
│ │ │ │ +of another with respect to the specified comparison function. Read more1.5.0 · Source§fn partial_cmp<I>(self, other: I) -> Option<Ordering>where
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
fn partial_cmp<I>(self, other: I) -> Option<Ordering>where
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
PartialOrd
elements of
│ │ │ │ +this Iterator
with those of another. The comparison works like short-circuit
│ │ │ │ evaluation, returning a result without comparing the remaining elements.
│ │ │ │ -As soon as an order can be determined, the evaluation stops and a result is returned. Read moreSource§fn partial_cmp_by<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering>where
│ │ │ │ - Self: Sized,
│ │ │ │ - I: IntoIterator,
│ │ │ │ - F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Option<Ordering>,
fn partial_cmp_by<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering>where
│ │ │ │ - Self: Sized,
│ │ │ │ - I: IntoIterator,
│ │ │ │ - F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Option<Ordering>,
iter_order_by
#64295)Iterator
with those
│ │ │ │ -of another with respect to the specified comparison function. Read more1.5.0 · Source§fn eq<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialEq<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
fn eq<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialEq<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
Source§fn eq_by<I, F>(self, other: I, eq: F) -> boolwhere
│ │ │ │ - Self: Sized,
│ │ │ │ - I: IntoIterator,
│ │ │ │ - F: FnMut(Self::Item, <I as IntoIterator>::Item) -> bool,
fn eq_by<I, F>(self, other: I, eq: F) -> boolwhere
│ │ │ │ - Self: Sized,
│ │ │ │ - I: IntoIterator,
│ │ │ │ - F: FnMut(Self::Item, <I as IntoIterator>::Item) -> bool,
iter_order_by
#64295)1.5.0 · Source§fn ne<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialEq<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
fn ne<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialEq<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
1.5.0 · Source§fn lt<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
fn lt<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
Iterator
are lexicographically
│ │ │ │ -less than those of another. Read more1.5.0 · Source§fn le<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
fn le<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
Iterator
are lexicographically
│ │ │ │ -less or equal to those of another. Read more1.5.0 · Source§fn gt<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
fn gt<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
Iterator
are lexicographically
│ │ │ │ -greater than those of another. Read more1.5.0 · Source§fn ge<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
fn ge<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
Iterator
are lexicographically
│ │ │ │ -greater than or equal to those of another. Read more1.82.0 · Source§fn is_sorted(self) -> bool
fn is_sorted(self) -> bool
1.82.0 · Source§fn is_sorted_by<F>(self, compare: F) -> bool
fn is_sorted_by<F>(self, compare: F) -> bool
1.82.0 · Source§fn is_sorted_by_key<F, K>(self, f: F) -> bool
fn is_sorted_by_key<F, K>(self, f: F) -> bool
impl<T: Ord, A: Allocator> FusedIterator for DrainSorted<'_, T, A>
impl<T: Ord, A: Allocator> TrustedLen for DrainSorted<'_, T, A>
Auto Trait Implementations§
impl<'a, T, A> Freeze for DrainSorted<'a, T, A>
impl<'a, T, A> RefUnwindSafe for DrainSorted<'a, T, A>where
│ │ │ │ - A: RefUnwindSafe,
│ │ │ │ - T: RefUnwindSafe,
impl<'a, T, A> Send for DrainSorted<'a, T, A>
impl<'a, T, A> Sync for DrainSorted<'a, T, A>
impl<'a, T, A> Unpin for DrainSorted<'a, T, A>
impl<'a, T, A = Global> !UnwindSafe for DrainSorted<'a, T, A>
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
Source§impl<T, U> Into<U> for Twhere
│ │ │ │ - U: From<T>,
impl<T, U> Into<U> for Twhere
│ │ │ │ - U: From<T>,
Source§fn into(self) -> U
fn into(self) -> U
Calls U::from(self)
.
Source§fn partial_cmp_by<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering>where
│ │ │ │ + Self: Sized,
│ │ │ │ + I: IntoIterator,
│ │ │ │ + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Option<Ordering>,
fn partial_cmp_by<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering>where
│ │ │ │ + Self: Sized,
│ │ │ │ + I: IntoIterator,
│ │ │ │ + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Option<Ordering>,
iter_order_by
#64295)Iterator
with those
│ │ │ │ +of another with respect to the specified comparison function. Read more1.5.0 · Source§fn eq<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialEq<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
fn eq<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialEq<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
Source§fn eq_by<I, F>(self, other: I, eq: F) -> boolwhere
│ │ │ │ + Self: Sized,
│ │ │ │ + I: IntoIterator,
│ │ │ │ + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> bool,
fn eq_by<I, F>(self, other: I, eq: F) -> boolwhere
│ │ │ │ + Self: Sized,
│ │ │ │ + I: IntoIterator,
│ │ │ │ + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> bool,
iter_order_by
#64295)1.5.0 · Source§fn ne<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialEq<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
fn ne<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialEq<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
1.5.0 · Source§fn lt<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
fn lt<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
Iterator
are lexicographically
│ │ │ │ +less than those of another. Read more1.5.0 · Source§fn le<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
fn le<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
Iterator
are lexicographically
│ │ │ │ +less or equal to those of another. Read more1.5.0 · Source§fn gt<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
fn gt<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
Iterator
are lexicographically
│ │ │ │ +greater than those of another. Read more1.5.0 · Source§fn ge<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
fn ge<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
Iterator
are lexicographically
│ │ │ │ +greater than or equal to those of another. Read more1.82.0 · Source§fn is_sorted(self) -> bool
fn is_sorted(self) -> bool
1.82.0 · Source§fn is_sorted_by<F>(self, compare: F) -> bool
fn is_sorted_by<F>(self, compare: F) -> bool
1.82.0 · Source§fn is_sorted_by_key<F, K>(self, f: F) -> bool
fn is_sorted_by_key<F, K>(self, f: F) -> bool
impl<T: Ord, A: Allocator> FusedIterator for DrainSorted<'_, T, A>
impl<T: Ord, A: Allocator> TrustedLen for DrainSorted<'_, T, A>
Auto Trait Implementations§
impl<'a, T, A> Freeze for DrainSorted<'a, T, A>
impl<'a, T, A> RefUnwindSafe for DrainSorted<'a, T, A>where
│ │ │ │ + A: RefUnwindSafe,
│ │ │ │ + T: RefUnwindSafe,
impl<'a, T, A> Send for DrainSorted<'a, T, A>
impl<'a, T, A> Sync for DrainSorted<'a, T, A>
impl<'a, T, A> Unpin for DrainSorted<'a, T, A>
impl<'a, T, A = Global> !UnwindSafe for DrainSorted<'a, T, A>
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
Source§impl<I> IntoIterator for Iwhere
│ │ │ │ - I: Iterator,
impl<I> IntoIterator for Iwhere
│ │ │ │ - I: Iterator,
From<T> for U
chooses to do.
│ │ │ │ +Source§impl<I> IntoIterator for Iwhere
│ │ │ │ + I: Iterator,
impl<I> IntoIterator for Iwhere
│ │ │ │ + I: Iterator,
pub struct IntoIter<T, A: Allocator = Global> { /* private fields */ }
Expand description
An owning iterator over the elements of a BinaryHeap
.
This struct
is created by BinaryHeap::into_iter()
│ │ │ │ -(provided by the IntoIterator
trait). See its documentation for more.
Implementations§
Trait Implementations§
1.70.0 · Source§impl<T> Default for IntoIter<T>
impl<T> Default for IntoIter<T>
Source§fn default() -> Self
fn default() -> Self
Creates an empty binary_heap::IntoIter
.
IntoIterator
trait). See its documentation for more.
│ │ │ │ +Implementations§
Trait Implementations§
1.0.0 · Source§impl<T, A: Allocator> DoubleEndedIterator for IntoIter<T, A>
impl<T, A: Allocator> DoubleEndedIterator for IntoIter<T, A>
Source§fn next_back(&mut self) -> Option<T>
fn next_back(&mut self) -> Option<T>
Source§fn advance_back_by(&mut self, n: usize) -> Result<(), NonZero<usize>>
fn advance_back_by(&mut self, n: usize) -> Result<(), NonZero<usize>>
iter_advance_by
#77404)n
elements. Read more1.37.0 · Source§fn nth_back(&mut self, n: usize) -> Option<Self::Item>
fn nth_back(&mut self, n: usize) -> Option<Self::Item>
n
th element from the end of the iterator. Read more1.27.0 · Source§fn try_rfold<B, F, R>(&mut self, init: B, f: F) -> R
fn try_rfold<B, F, R>(&mut self, init: B, f: F) -> R
Iterator::try_fold()
: it takes
│ │ │ │ -elements starting from the back of the iterator. Read more1.0.0 · Source§impl<T, A: Allocator> ExactSizeIterator for IntoIter<T, A>
impl<T, A: Allocator> ExactSizeIterator for IntoIter<T, A>
1.0.0 · Source§impl<T, A: Allocator> DoubleEndedIterator for IntoIter<T, A>
impl<T, A: Allocator> DoubleEndedIterator for IntoIter<T, A>
Source§fn next_back(&mut self) -> Option<T>
fn next_back(&mut self) -> Option<T>
Source§fn advance_back_by(&mut self, n: usize) -> Result<(), NonZero<usize>>
fn advance_back_by(&mut self, n: usize) -> Result<(), NonZero<usize>>
iter_advance_by
#77404)n
elements. Read more1.37.0 · Source§fn nth_back(&mut self, n: usize) -> Option<Self::Item>
fn nth_back(&mut self, n: usize) -> Option<Self::Item>
n
th element from the end of the iterator. Read more1.27.0 · Source§fn try_rfold<B, F, R>(&mut self, init: B, f: F) -> R
fn try_rfold<B, F, R>(&mut self, init: B, f: F) -> R
Iterator::try_fold()
: it takes
│ │ │ │ +elements starting from the back of the iterator. Read more1.0.0 · Source§impl<T, A: Allocator> ExactSizeIterator for IntoIter<T, A>
impl<T, A: Allocator> ExactSizeIterator for IntoIter<T, A>
1.0.0 · Source§impl<T, A: Allocator> Iterator for IntoIter<T, A>
impl<T, A: Allocator> Iterator for IntoIter<T, A>
Source§fn size_hint(&self) -> (usize, Option<usize>)
fn size_hint(&self) -> (usize, Option<usize>)
Source§fn next_chunk<const N: usize>(
│ │ │ │ &mut self,
│ │ │ │ -) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>where
│ │ │ │ - Self: Sized,
fn next_chunk<const N: usize>(
│ │ │ │ &mut self,
│ │ │ │ -) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>where
│ │ │ │ - Self: Sized,
iter_next_chunk
#98326)N
values. Read more1.0.0 · Source§fn count(self) -> usizewhere
│ │ │ │ - Self: Sized,
fn count(self) -> usizewhere
│ │ │ │ - Self: Sized,
1.0.0 · Source§fn last(self) -> Option<Self::Item>where
│ │ │ │ - Self: Sized,
fn last(self) -> Option<Self::Item>where
│ │ │ │ - Self: Sized,
Source§fn advance_by(&mut self, n: usize) -> Result<(), NonZero<usize>>
fn advance_by(&mut self, n: usize) -> Result<(), NonZero<usize>>
iter_advance_by
#77404)n
elements. Read more1.0.0 · Source§fn nth(&mut self, n: usize) -> Option<Self::Item>
fn nth(&mut self, n: usize) -> Option<Self::Item>
n
th element of the iterator. Read more1.28.0 · Source§fn step_by(self, step: usize) -> StepBy<Self>where
│ │ │ │ - Self: Sized,
fn step_by(self, step: usize) -> StepBy<Self>where
│ │ │ │ - Self: Sized,
1.0.0 · Source§fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>
fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>
1.0.0 · Source§fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>where
│ │ │ │ - Self: Sized,
│ │ │ │ - U: IntoIterator,
fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>where
│ │ │ │ - Self: Sized,
│ │ │ │ - U: IntoIterator,
Source§fn intersperse(self, separator: Self::Item) -> Intersperse<Self>
fn intersperse(self, separator: Self::Item) -> Intersperse<Self>
iter_intersperse
#79524)separator
between adjacent
│ │ │ │ -items of the original iterator. Read moreSource§fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G>
fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G>
iter_intersperse
#79524)separator
│ │ │ │ -between adjacent items of the original iterator. Read more1.0.0 · Source§fn map<B, F>(self, f: F) -> Map<Self, F>
fn map<B, F>(self, f: F) -> Map<Self, F>
1.0.0 · Source§fn filter<P>(self, predicate: P) -> Filter<Self, P>
fn filter<P>(self, predicate: P) -> Filter<Self, P>
1.0.0 · Source§fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>
fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>
1.0.0 · Source§fn enumerate(self) -> Enumerate<Self>where
│ │ │ │ - Self: Sized,
fn enumerate(self) -> Enumerate<Self>where
│ │ │ │ - Self: Sized,
1.0.0 · Source§fn peekable(self) -> Peekable<Self>where
│ │ │ │ - Self: Sized,
fn peekable(self) -> Peekable<Self>where
│ │ │ │ - Self: Sized,
peek
and peek_mut
methods
│ │ │ │ +) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>iter_next_chunk
#98326)N
values. Read more1.0.0 · Source§fn count(self) -> usizewhere
│ │ │ │ + Self: Sized,
fn count(self) -> usizewhere
│ │ │ │ + Self: Sized,
1.0.0 · Source§fn last(self) -> Option<Self::Item>where
│ │ │ │ + Self: Sized,
fn last(self) -> Option<Self::Item>where
│ │ │ │ + Self: Sized,
Source§fn advance_by(&mut self, n: usize) -> Result<(), NonZero<usize>>
fn advance_by(&mut self, n: usize) -> Result<(), NonZero<usize>>
iter_advance_by
#77404)n
elements. Read more1.0.0 · Source§fn nth(&mut self, n: usize) -> Option<Self::Item>
fn nth(&mut self, n: usize) -> Option<Self::Item>
n
th element of the iterator. Read more1.28.0 · Source§fn step_by(self, step: usize) -> StepBy<Self>where
│ │ │ │ + Self: Sized,
fn step_by(self, step: usize) -> StepBy<Self>where
│ │ │ │ + Self: Sized,
1.0.0 · Source§fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>
fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>
1.0.0 · Source§fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>where
│ │ │ │ + Self: Sized,
│ │ │ │ + U: IntoIterator,
fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>where
│ │ │ │ + Self: Sized,
│ │ │ │ + U: IntoIterator,
Source§fn intersperse(self, separator: Self::Item) -> Intersperse<Self>
fn intersperse(self, separator: Self::Item) -> Intersperse<Self>
iter_intersperse
#79524)separator
between adjacent
│ │ │ │ +items of the original iterator. Read moreSource§fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G>
fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G>
iter_intersperse
#79524)separator
│ │ │ │ +between adjacent items of the original iterator. Read more1.0.0 · Source§fn map<B, F>(self, f: F) -> Map<Self, F>
fn map<B, F>(self, f: F) -> Map<Self, F>
1.0.0 · Source§fn filter<P>(self, predicate: P) -> Filter<Self, P>
fn filter<P>(self, predicate: P) -> Filter<Self, P>
1.0.0 · Source§fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>
fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>
1.0.0 · Source§fn enumerate(self) -> Enumerate<Self>where
│ │ │ │ + Self: Sized,
fn enumerate(self) -> Enumerate<Self>where
│ │ │ │ + Self: Sized,
1.0.0 · Source§fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>
fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>
1.0.0 · Source§fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>
fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>
1.57.0 · Source§fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P>
fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P>
1.0.0 · Source§fn skip(self, n: usize) -> Skip<Self>where
│ │ │ │ - Self: Sized,
fn skip(self, n: usize) -> Skip<Self>where
│ │ │ │ - Self: Sized,
n
elements. Read more1.0.0 · Source§fn take(self, n: usize) -> Take<Self>where
│ │ │ │ - Self: Sized,
fn take(self, n: usize) -> Take<Self>where
│ │ │ │ - Self: Sized,
n
elements, or fewer
│ │ │ │ -if the underlying iterator ends sooner. Read more1.0.0 · Source§fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>
fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>
1.29.0 · Source§fn flatten(self) -> Flatten<Self>
fn flatten(self) -> Flatten<Self>
Source§fn map_windows<F, R, const N: usize>(self, f: F) -> MapWindows<Self, F, N>
fn map_windows<F, R, const N: usize>(self, f: F) -> MapWindows<Self, F, N>
iter_map_windows
#87155)f
for each contiguous window of size N
over
│ │ │ │ -self
and returns an iterator over the outputs of f
. Like slice::windows()
,
│ │ │ │ -the windows during mapping overlap as well. Read more1.0.0 · Source§fn inspect<F>(self, f: F) -> Inspect<Self, F>
fn inspect<F>(self, f: F) -> Inspect<Self, F>
1.0.0 · Source§fn by_ref(&mut self) -> &mut Selfwhere
│ │ │ │ - Self: Sized,
fn by_ref(&mut self) -> &mut Selfwhere
│ │ │ │ - Self: Sized,
Source§fn try_collect<B>(
│ │ │ │ +their documentation for more information. Read more
fn try_collect<B>( │ │ │ │ +their documentation for more information. Read more
1.0.0 · Source§fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>
fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>
1.0.0 · Source§fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>
fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>
1.57.0 · Source§fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P>
fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P>
1.0.0 · Source§fn skip(self, n: usize) -> Skip<Self>where
│ │ │ │ + Self: Sized,
fn skip(self, n: usize) -> Skip<Self>where
│ │ │ │ + Self: Sized,
n
elements. Read more1.0.0 · Source§fn take(self, n: usize) -> Take<Self>where
│ │ │ │ + Self: Sized,
fn take(self, n: usize) -> Take<Self>where
│ │ │ │ + Self: Sized,
n
elements, or fewer
│ │ │ │ +if the underlying iterator ends sooner. Read more1.0.0 · Source§fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>
fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>
1.29.0 · Source§fn flatten(self) -> Flatten<Self>
fn flatten(self) -> Flatten<Self>
Source§fn map_windows<F, R, const N: usize>(self, f: F) -> MapWindows<Self, F, N>
fn map_windows<F, R, const N: usize>(self, f: F) -> MapWindows<Self, F, N>
iter_map_windows
#87155)f
for each contiguous window of size N
over
│ │ │ │ +self
and returns an iterator over the outputs of f
. Like slice::windows()
,
│ │ │ │ +the windows during mapping overlap as well. Read more1.0.0 · Source§fn inspect<F>(self, f: F) -> Inspect<Self, F>
fn inspect<F>(self, f: F) -> Inspect<Self, F>
1.0.0 · Source§fn by_ref(&mut self) -> &mut Selfwhere
│ │ │ │ + Self: Sized,
fn by_ref(&mut self) -> &mut Selfwhere
│ │ │ │ + Self: Sized,
Source§fn try_collect<B>(
│ │ │ │ &mut self,
│ │ │ │ -) -> <<Self::Item as Try>::Residual as Residual<B>>::TryType
fn try_collect<B>( │ │ │ │ &mut self, │ │ │ │ -) -> <<Self::Item as Try>::Residual as Residual<B>>::TryType
iterator_try_collect
#94047)Source§fn collect_into<E>(self, collection: &mut E) -> &mut E
fn collect_into<E>(self, collection: &mut E) -> &mut E
iter_collect_into
#94780)1.0.0 · Source§fn partition<B, F>(self, f: F) -> (B, B)
fn partition<B, F>(self, f: F) -> (B, B)
Source§fn partition_in_place<'a, T, P>(self, predicate: P) -> usizewhere
│ │ │ │ +) -> <<Self::Item as Try>::Residual as Residual<B>>::TryTypewhere
│ │ │ │ + Self: Sized,
│ │ │ │ + Self::Item: Try,
│ │ │ │ + <Self::Item as Try>::Residual: Residual<B>,
│ │ │ │ + B: FromIterator<<Self::Item as Try>::Output>,🔬This is a nightly-only experimental API. (iterator_try_collect
#94047)Fallibly transforms an iterator into a collection, short circuiting if
│ │ │ │ +a failure is encountered. Read moreSource§fn collect_into<E>(self, collection: &mut E) -> &mut E
🔬This is a nightly-only experimental API. (iter_collect_into
#94780)Collects all the items from an iterator into a collection. Read more1.0.0 · Source§fn partition<B, F>(self, f: F) -> (B, B)
Consumes an iterator, creating two collections from it. Read moreSource§fn partition_in_place<'a, T, P>(self, predicate: P) -> usize
🔬This is a nightly-only experimental API. (iter_partition_in_place
#62543)Reorders the elements of this iterator in-place according to the given predicate,
│ │ │ │ + Self: Sized + DoubleEndedIterator<Item = &'a mut T>,
│ │ │ │ + P: FnMut(&T) -> bool,🔬This is a nightly-only experimental API. (iter_partition_in_place
#62543)Reorders the elements of this iterator in-place according to the given predicate,
│ │ │ │ such that all those that return true
precede all those that return false
.
│ │ │ │ -Returns the number of true
elements found. Read moreSource§fn is_partitioned<P>(self, predicate: P) -> bool
🔬This is a nightly-only experimental API. (iter_is_partitioned
#62544)Checks if the elements of this iterator are partitioned according to the given predicate,
│ │ │ │ -such that all those that return true
precede all those that return false
. Read more1.27.0 · Source§fn try_fold<B, F, R>(&mut self, init: B, f: F) -> R
An iterator method that applies a function as long as it returns
│ │ │ │ -successfully, producing a single, final value. Read more1.27.0 · Source§fn try_for_each<F, R>(&mut self, f: F) -> R
An iterator method that applies a fallible function to each item in the
│ │ │ │ -iterator, stopping at the first error and returning that error. Read more1.0.0 · Source§fn fold<B, F>(self, init: B, f: F) -> B
Folds every element into an accumulator by applying an operation,
│ │ │ │ -returning the final result. Read more1.51.0 · Source§fn reduce<F>(self, f: F) -> Option<Self::Item>
Reduces the elements to a single one, by repeatedly applying a reducing
│ │ │ │ -operation. Read moreSource§fn try_reduce<R>(
│ │ │ │ +Returns the number of true
elements found. Read more
fn partition_in_place<'a, T, P>(self, predicate: P) -> usizewhere
│ │ │ │ +) -> <<Self::Item as Try>::Residual as Residual<B>>::TryTypewhere
│ │ │ │ + Self: Sized,
│ │ │ │ + Self::Item: Try,
│ │ │ │ + <Self::Item as Try>::Residual: Residual<B>,
│ │ │ │ + B: FromIterator<<Self::Item as Try>::Output>,🔬This is a nightly-only experimental API. (iterator_try_collect
#94047)Fallibly transforms an iterator into a collection, short circuiting if
│ │ │ │ +a failure is encountered. Read moreSource§fn collect_into<E>(self, collection: &mut E) -> &mut E
🔬This is a nightly-only experimental API. (iter_collect_into
#94780)Collects all the items from an iterator into a collection. Read more1.0.0 · Source§fn partition<B, F>(self, f: F) -> (B, B)
Consumes an iterator, creating two collections from it. Read moreSource§fn partition_in_place<'a, T, P>(self, predicate: P) -> usize
🔬This is a nightly-only experimental API. (iter_partition_in_place
#62543)Reorders the elements of this iterator in-place according to the given predicate,
│ │ │ │ + Self: Sized + DoubleEndedIterator<Item = &'a mut T>,
│ │ │ │ + P: FnMut(&T) -> bool,🔬This is a nightly-only experimental API. (iter_partition_in_place
#62543)Reorders the elements of this iterator in-place according to the given predicate,
│ │ │ │ such that all those that return true
precede all those that return false
.
│ │ │ │ -Returns the number of true
elements found. Read moreSource§fn is_partitioned<P>(self, predicate: P) -> bool
🔬This is a nightly-only experimental API. (iter_is_partitioned
#62544)Checks if the elements of this iterator are partitioned according to the given predicate,
│ │ │ │ -such that all those that return true
precede all those that return false
. Read more1.27.0 · Source§fn try_fold<B, F, R>(&mut self, init: B, f: F) -> R
An iterator method that applies a function as long as it returns
│ │ │ │ -successfully, producing a single, final value. Read more1.27.0 · Source§fn try_for_each<F, R>(&mut self, f: F) -> R
An iterator method that applies a fallible function to each item in the
│ │ │ │ -iterator, stopping at the first error and returning that error. Read more1.0.0 · Source§fn fold<B, F>(self, init: B, f: F) -> B
Folds every element into an accumulator by applying an operation,
│ │ │ │ -returning the final result. Read more1.51.0 · Source§fn reduce<F>(self, f: F) -> Option<Self::Item>
Reduces the elements to a single one, by repeatedly applying a reducing
│ │ │ │ -operation. Read moreSource§fn try_reduce<R>(
│ │ │ │ +Returns the number of true
elements found. Read more
iterator_try_collect
#94047)Source§fn collect_into<E>(self, collection: &mut E) -> &mut E
fn collect_into<E>(self, collection: &mut E) -> &mut E
iter_collect_into
#94780)1.0.0 · Source§fn partition<B, F>(self, f: F) -> (B, B)
fn partition<B, F>(self, f: F) -> (B, B)
Source§fn partition_in_place<'a, T, P>(self, predicate: P) -> usize
fn partition_in_place<'a, T, P>(self, predicate: P) -> usize
iter_partition_in_place
#62543)iter_partition_in_place
#62543)true
precede all those that return false
.
│ │ │ │ -Returns the number of true
elements found. Read moreSource§fn is_partitioned<P>(self, predicate: P) -> bool
fn is_partitioned<P>(self, predicate: P) -> bool
iter_is_partitioned
#62544)true
precede all those that return false
. Read more1.27.0 · Source§fn try_fold<B, F, R>(&mut self, init: B, f: F) -> R
fn try_fold<B, F, R>(&mut self, init: B, f: F) -> R
1.27.0 · Source§fn try_for_each<F, R>(&mut self, f: F) -> R
fn try_for_each<F, R>(&mut self, f: F) -> R
1.0.0 · Source§fn fold<B, F>(self, init: B, f: F) -> B
fn fold<B, F>(self, init: B, f: F) -> B
1.51.0 · Source§fn reduce<F>(self, f: F) -> Option<Self::Item>
fn reduce<F>(self, f: F) -> Option<Self::Item>
Source§fn try_reduce<R>(
│ │ │ │ +Returns the number of true
elements found. Read more
fn try_reduce<R>(
│ │ │ │ +Returns the number of true
elements found. Read more
Source§fn is_partitioned<P>(self, predicate: P) -> bool
fn is_partitioned<P>(self, predicate: P) -> bool
iter_is_partitioned
#62544)true
precede all those that return false
. Read more1.27.0 · Source§fn try_fold<B, F, R>(&mut self, init: B, f: F) -> R
fn try_fold<B, F, R>(&mut self, init: B, f: F) -> R
1.27.0 · Source§fn try_for_each<F, R>(&mut self, f: F) -> R
fn try_for_each<F, R>(&mut self, f: F) -> R
1.0.0 · Source§fn fold<B, F>(self, init: B, f: F) -> B
fn fold<B, F>(self, init: B, f: F) -> B
1.51.0 · Source§fn reduce<F>(self, f: F) -> Option<Self::Item>
fn reduce<F>(self, f: F) -> Option<Self::Item>
Source§fn try_reduce<R>(
│ │ │ │ &mut self,
│ │ │ │ - f: impl FnMut(Self::Item, Self::Item) -> R,
│ │ │ │ -) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryType
fn try_reduce<R>( │ │ │ │ &mut self, │ │ │ │ - f: impl FnMut(Self::Item, Self::Item) -> R, │ │ │ │ -) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryType
iterator_try_reduce
#87053)1.0.0 · Source§fn all<F>(&mut self, f: F) -> bool
fn all<F>(&mut self, f: F) -> bool
1.0.0 · Source§fn any<F>(&mut self, f: F) -> bool
fn any<F>(&mut self, f: F) -> bool
1.0.0 · Source§fn find<P>(&mut self, predicate: P) -> Option<Self::Item>
fn find<P>(&mut self, predicate: P) -> Option<Self::Item>
1.30.0 · Source§fn find_map<B, F>(&mut self, f: F) -> Option<B>
fn find_map<B, F>(&mut self, f: F) -> Option<B>
Source§fn try_find<R>(
│ │ │ │ + f: impl FnMut(Self::Item, Self::Item) -> R,
│ │ │ │ +) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryType
fn try_find<R>( │ │ │ │ + f: impl FnMut(Self::Item, Self::Item) -> R, │ │ │ │ +) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryType
iterator_try_reduce
#87053)1.0.0 · Source§fn all<F>(&mut self, f: F) -> bool
fn all<F>(&mut self, f: F) -> bool
1.0.0 · Source§fn any<F>(&mut self, f: F) -> bool
fn any<F>(&mut self, f: F) -> bool
1.0.0 · Source§fn find<P>(&mut self, predicate: P) -> Option<Self::Item>
fn find<P>(&mut self, predicate: P) -> Option<Self::Item>
1.30.0 · Source§fn find_map<B, F>(&mut self, f: F) -> Option<B>
fn find_map<B, F>(&mut self, f: F) -> Option<B>
Source§fn try_find<R>(
│ │ │ │ &mut self,
│ │ │ │ - f: impl FnMut(&Self::Item) -> R,
│ │ │ │ -) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryType
fn try_find<R>( │ │ │ │ &mut self, │ │ │ │ - f: impl FnMut(&Self::Item) -> R, │ │ │ │ -) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryType
try_find
#63178)1.0.0 · Source§fn position<P>(&mut self, predicate: P) -> Option<usize>
fn position<P>(&mut self, predicate: P) -> Option<usize>
1.0.0 · Source§fn rposition<P>(&mut self, predicate: P) -> Option<usize>where
│ │ │ │ - P: FnMut(Self::Item) -> bool,
│ │ │ │ - Self: Sized + ExactSizeIterator + DoubleEndedIterator,
fn rposition<P>(&mut self, predicate: P) -> Option<usize>where
│ │ │ │ - P: FnMut(Self::Item) -> bool,
│ │ │ │ - Self: Sized + ExactSizeIterator + DoubleEndedIterator,
1.0.0 · Source§fn max(self) -> Option<Self::Item>
fn max(self) -> Option<Self::Item>
1.0.0 · Source§fn min(self) -> Option<Self::Item>
fn min(self) -> Option<Self::Item>
1.6.0 · Source§fn max_by_key<B, F>(self, f: F) -> Option<Self::Item>
fn max_by_key<B, F>(self, f: F) -> Option<Self::Item>
1.15.0 · Source§fn max_by<F>(self, compare: F) -> Option<Self::Item>
fn max_by<F>(self, compare: F) -> Option<Self::Item>
1.6.0 · Source§fn min_by_key<B, F>(self, f: F) -> Option<Self::Item>
fn min_by_key<B, F>(self, f: F) -> Option<Self::Item>
1.15.0 · Source§fn min_by<F>(self, compare: F) -> Option<Self::Item>
fn min_by<F>(self, compare: F) -> Option<Self::Item>
1.0.0 · Source§fn rev(self) -> Rev<Self>where
│ │ │ │ - Self: Sized + DoubleEndedIterator,
fn rev(self) -> Rev<Self>where
│ │ │ │ - Self: Sized + DoubleEndedIterator,
1.0.0 · Source§fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)
fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)
1.36.0 · Source§fn copied<'a, T>(self) -> Copied<Self>
fn copied<'a, T>(self) -> Copied<Self>
Source§fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N>where
│ │ │ │ - Self: Sized,
fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N>where
│ │ │ │ - Self: Sized,
iter_array_chunks
#100450)N
elements of the iterator at a time. Read more1.11.0 · Source§fn product<P>(self) -> P
fn product<P>(self) -> P
1.5.0 · Source§fn cmp<I>(self, other: I) -> Orderingwhere
│ │ │ │ - I: IntoIterator<Item = Self::Item>,
│ │ │ │ - Self::Item: Ord,
│ │ │ │ - Self: Sized,
fn cmp<I>(self, other: I) -> Orderingwhere
│ │ │ │ - I: IntoIterator<Item = Self::Item>,
│ │ │ │ - Self::Item: Ord,
│ │ │ │ - Self: Sized,
Source§fn cmp_by<I, F>(self, other: I, cmp: F) -> Orderingwhere
│ │ │ │ - Self: Sized,
│ │ │ │ - I: IntoIterator,
│ │ │ │ - F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Ordering,
fn cmp_by<I, F>(self, other: I, cmp: F) -> Orderingwhere
│ │ │ │ - Self: Sized,
│ │ │ │ - I: IntoIterator,
│ │ │ │ - F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Ordering,
iter_order_by
#64295)Iterator
with those
│ │ │ │ -of another with respect to the specified comparison function. Read more1.5.0 · Source§fn partial_cmp<I>(self, other: I) -> Option<Ordering>where
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
fn partial_cmp<I>(self, other: I) -> Option<Ordering>where
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
PartialOrd
elements of
│ │ │ │ -this Iterator
with those of another. The comparison works like short-circuit
│ │ │ │ + f: impl FnMut(&Self::Item) -> R,
│ │ │ │ +) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryTypetry_find
#63178)1.0.0 · Source§fn position<P>(&mut self, predicate: P) -> Option<usize>
fn position<P>(&mut self, predicate: P) -> Option<usize>
1.0.0 · Source§fn rposition<P>(&mut self, predicate: P) -> Option<usize>where
│ │ │ │ + P: FnMut(Self::Item) -> bool,
│ │ │ │ + Self: Sized + ExactSizeIterator + DoubleEndedIterator,
fn rposition<P>(&mut self, predicate: P) -> Option<usize>where
│ │ │ │ + P: FnMut(Self::Item) -> bool,
│ │ │ │ + Self: Sized + ExactSizeIterator + DoubleEndedIterator,
1.0.0 · Source§fn max(self) -> Option<Self::Item>
fn max(self) -> Option<Self::Item>
1.0.0 · Source§fn min(self) -> Option<Self::Item>
fn min(self) -> Option<Self::Item>
1.6.0 · Source§fn max_by_key<B, F>(self, f: F) -> Option<Self::Item>
fn max_by_key<B, F>(self, f: F) -> Option<Self::Item>
1.15.0 · Source§fn max_by<F>(self, compare: F) -> Option<Self::Item>
fn max_by<F>(self, compare: F) -> Option<Self::Item>
1.6.0 · Source§fn min_by_key<B, F>(self, f: F) -> Option<Self::Item>
fn min_by_key<B, F>(self, f: F) -> Option<Self::Item>
1.15.0 · Source§fn min_by<F>(self, compare: F) -> Option<Self::Item>
fn min_by<F>(self, compare: F) -> Option<Self::Item>
1.0.0 · Source§fn rev(self) -> Rev<Self>where
│ │ │ │ + Self: Sized + DoubleEndedIterator,
fn rev(self) -> Rev<Self>where
│ │ │ │ + Self: Sized + DoubleEndedIterator,
1.0.0 · Source§fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)
fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)
1.36.0 · Source§fn copied<'a, T>(self) -> Copied<Self>
fn copied<'a, T>(self) -> Copied<Self>
Source§fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N>where
│ │ │ │ + Self: Sized,
fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N>where
│ │ │ │ + Self: Sized,
iter_array_chunks
#100450)N
elements of the iterator at a time. Read more1.11.0 · Source§fn product<P>(self) -> P
fn product<P>(self) -> P
1.5.0 · Source§fn cmp<I>(self, other: I) -> Orderingwhere
│ │ │ │ + I: IntoIterator<Item = Self::Item>,
│ │ │ │ + Self::Item: Ord,
│ │ │ │ + Self: Sized,
fn cmp<I>(self, other: I) -> Orderingwhere
│ │ │ │ + I: IntoIterator<Item = Self::Item>,
│ │ │ │ + Self::Item: Ord,
│ │ │ │ + Self: Sized,
Source§fn cmp_by<I, F>(self, other: I, cmp: F) -> Orderingwhere
│ │ │ │ + Self: Sized,
│ │ │ │ + I: IntoIterator,
│ │ │ │ + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Ordering,
fn cmp_by<I, F>(self, other: I, cmp: F) -> Orderingwhere
│ │ │ │ + Self: Sized,
│ │ │ │ + I: IntoIterator,
│ │ │ │ + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Ordering,
iter_order_by
#64295)Iterator
with those
│ │ │ │ +of another with respect to the specified comparison function. Read more1.5.0 · Source§fn partial_cmp<I>(self, other: I) -> Option<Ordering>where
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
fn partial_cmp<I>(self, other: I) -> Option<Ordering>where
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
PartialOrd
elements of
│ │ │ │ +this Iterator
with those of another. The comparison works like short-circuit
│ │ │ │ evaluation, returning a result without comparing the remaining elements.
│ │ │ │ -As soon as an order can be determined, the evaluation stops and a result is returned. Read moreSource§fn partial_cmp_by<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering>where
│ │ │ │ - Self: Sized,
│ │ │ │ - I: IntoIterator,
│ │ │ │ - F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Option<Ordering>,
fn partial_cmp_by<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering>where
│ │ │ │ - Self: Sized,
│ │ │ │ - I: IntoIterator,
│ │ │ │ - F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Option<Ordering>,
iter_order_by
#64295)Iterator
with those
│ │ │ │ -of another with respect to the specified comparison function. Read more1.5.0 · Source§fn eq<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialEq<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
fn eq<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialEq<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
Source§fn eq_by<I, F>(self, other: I, eq: F) -> boolwhere
│ │ │ │ - Self: Sized,
│ │ │ │ - I: IntoIterator,
│ │ │ │ - F: FnMut(Self::Item, <I as IntoIterator>::Item) -> bool,
fn eq_by<I, F>(self, other: I, eq: F) -> boolwhere
│ │ │ │ - Self: Sized,
│ │ │ │ - I: IntoIterator,
│ │ │ │ - F: FnMut(Self::Item, <I as IntoIterator>::Item) -> bool,
iter_order_by
#64295)1.5.0 · Source§fn ne<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialEq<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
fn ne<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialEq<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
1.5.0 · Source§fn lt<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
fn lt<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
Iterator
are lexicographically
│ │ │ │ -less than those of another. Read more1.5.0 · Source§fn le<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
fn le<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
Iterator
are lexicographically
│ │ │ │ -less or equal to those of another. Read more1.5.0 · Source§fn gt<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
fn gt<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
Iterator
are lexicographically
│ │ │ │ -greater than those of another. Read more1.5.0 · Source§fn ge<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
fn ge<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
Iterator
are lexicographically
│ │ │ │ -greater than or equal to those of another. Read more1.82.0 · Source§fn is_sorted(self) -> bool
fn is_sorted(self) -> bool
1.82.0 · Source§fn is_sorted_by<F>(self, compare: F) -> bool
fn is_sorted_by<F>(self, compare: F) -> bool
1.82.0 · Source§fn is_sorted_by_key<F, K>(self, f: F) -> bool
fn is_sorted_by_key<F, K>(self, f: F) -> bool
impl<T, A: Allocator> FusedIterator for IntoIter<T, A>
Auto Trait Implementations§
impl<T, A> Freeze for IntoIter<T, A>where
│ │ │ │ - A: Freeze,
impl<T, A> RefUnwindSafe for IntoIter<T, A>where
│ │ │ │ - T: RefUnwindSafe,
│ │ │ │ - A: RefUnwindSafe,
impl<T, A> Send for IntoIter<T, A>
impl<T, A> Sync for IntoIter<T, A>
impl<T, A> Unpin for IntoIter<T, A>
impl<T, A> UnwindSafe for IntoIter<T, A>
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
Source§impl<T> CloneToUninit for Twhere
│ │ │ │ - T: Clone,
impl<T> CloneToUninit for Twhere
│ │ │ │ - T: Clone,
Source§impl<T, U> Into<U> for Twhere
│ │ │ │ - U: From<T>,
impl<T, U> Into<U> for Twhere
│ │ │ │ - U: From<T>,
Source§fn into(self) -> U
fn into(self) -> U
Calls U::from(self)
.
Source§fn partial_cmp_by<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering>where
│ │ │ │ + Self: Sized,
│ │ │ │ + I: IntoIterator,
│ │ │ │ + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Option<Ordering>,
fn partial_cmp_by<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering>where
│ │ │ │ + Self: Sized,
│ │ │ │ + I: IntoIterator,
│ │ │ │ + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Option<Ordering>,
iter_order_by
#64295)Iterator
with those
│ │ │ │ +of another with respect to the specified comparison function. Read more1.5.0 · Source§fn eq<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialEq<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
fn eq<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialEq<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
Source§fn eq_by<I, F>(self, other: I, eq: F) -> boolwhere
│ │ │ │ + Self: Sized,
│ │ │ │ + I: IntoIterator,
│ │ │ │ + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> bool,
fn eq_by<I, F>(self, other: I, eq: F) -> boolwhere
│ │ │ │ + Self: Sized,
│ │ │ │ + I: IntoIterator,
│ │ │ │ + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> bool,
iter_order_by
#64295)1.5.0 · Source§fn ne<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialEq<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
fn ne<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialEq<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
1.5.0 · Source§fn lt<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
fn lt<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
Iterator
are lexicographically
│ │ │ │ +less than those of another. Read more1.5.0 · Source§fn le<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
fn le<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
Iterator
are lexicographically
│ │ │ │ +less or equal to those of another. Read more1.5.0 · Source§fn gt<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
fn gt<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
Iterator
are lexicographically
│ │ │ │ +greater than those of another. Read more1.5.0 · Source§fn ge<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
fn ge<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
Iterator
are lexicographically
│ │ │ │ +greater than or equal to those of another. Read more1.82.0 · Source§fn is_sorted(self) -> bool
fn is_sorted(self) -> bool
1.82.0 · Source§fn is_sorted_by<F>(self, compare: F) -> bool
fn is_sorted_by<F>(self, compare: F) -> bool
1.82.0 · Source§fn is_sorted_by_key<F, K>(self, f: F) -> bool
fn is_sorted_by_key<F, K>(self, f: F) -> bool
impl<T, A: Allocator> FusedIterator for IntoIter<T, A>
Auto Trait Implementations§
impl<T, A> Freeze for IntoIter<T, A>where
│ │ │ │ + A: Freeze,
impl<T, A> RefUnwindSafe for IntoIter<T, A>where
│ │ │ │ + T: RefUnwindSafe,
│ │ │ │ + A: RefUnwindSafe,
impl<T, A> Send for IntoIter<T, A>
impl<T, A> Sync for IntoIter<T, A>
impl<T, A> Unpin for IntoIter<T, A>
impl<T, A> UnwindSafe for IntoIter<T, A>
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
Source§impl<T> CloneToUninit for Twhere
│ │ │ │ + T: Clone,
impl<T> CloneToUninit for Twhere
│ │ │ │ + T: Clone,
Source§impl<I> IntoIterator for Iwhere
│ │ │ │ - I: Iterator,
impl<I> IntoIterator for Iwhere
│ │ │ │ - I: Iterator,
From<T> for U
chooses to do.
│ │ │ │ +Source§impl<I> IntoIterator for Iwhere
│ │ │ │ + I: Iterator,
impl<I> IntoIterator for Iwhere
│ │ │ │ + I: Iterator,
pub struct IntoIterSorted<T, A: Allocator = Global> { /* private fields */ }
binary_heap_into_iter_sorted
#59278)Implementations§
Trait Implementations§
Source§impl<T: Clone, A: Clone + Allocator> Clone for IntoIterSorted<T, A>
impl<T: Clone, A: Clone + Allocator> Clone for IntoIterSorted<T, A>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<T: Ord, A: Allocator> ExactSizeIterator for IntoIterSorted<T, A>
impl<T: Ord, A: Allocator> ExactSizeIterator for IntoIterSorted<T, A>
Source§impl<T: Ord, A: Allocator> Iterator for IntoIterSorted<T, A>
impl<T: Ord, A: Allocator> Iterator for IntoIterSorted<T, A>
Source§fn size_hint(&self) -> (usize, Option<usize>)
fn size_hint(&self) -> (usize, Option<usize>)
Source§fn next_chunk<const N: usize>(
│ │ │ │ +IntoIterSorted in alloc::collections::binary_heap - Rust pub struct IntoIterSorted<T, A: Allocator = Global> { /* private fields */ }
🔬This is a nightly-only experimental API. (binary_heap_into_iter_sorted
#59278)Implementations§
Trait Implementations§
Source§impl<T: Clone, A: Clone + Allocator> Clone for IntoIterSorted<T, A>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreSource§impl<T: Ord, A: Allocator> ExactSizeIterator for IntoIterSorted<T, A>
Source§impl<T: Ord, A: Allocator> Iterator for IntoIterSorted<T, A>
Source§fn size_hint(&self) -> (usize, Option<usize>)
Returns the bounds on the remaining length of the iterator. Read moreSource§fn next_chunk<const N: usize>(
│ │ │ │ &mut self,
│ │ │ │ -) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>where
│ │ │ │ - Self: Sized,
🔬This is a nightly-only experimental API. (iter_next_chunk
#98326)Advances the iterator and returns an array containing the next N
values. Read more1.0.0 · Source§fn count(self) -> usizewhere
│ │ │ │ - Self: Sized,
Consumes the iterator, counting the number of iterations and returning it. Read more1.0.0 · Source§fn last(self) -> Option<Self::Item>where
│ │ │ │ - Self: Sized,
Consumes the iterator, returning the last element. Read moreSource§fn advance_by(&mut self, n: usize) -> Result<(), NonZero<usize>>
🔬This is a nightly-only experimental API. (iter_advance_by
#77404)Advances the iterator by n
elements. Read more1.0.0 · Source§fn nth(&mut self, n: usize) -> Option<Self::Item>
Returns the n
th element of the iterator. Read more1.28.0 · Source§fn step_by(self, step: usize) -> StepBy<Self>where
│ │ │ │ - Self: Sized,
Creates an iterator starting at the same point, but stepping by
│ │ │ │ -the given amount at each iteration. Read more1.0.0 · Source§fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>
Takes two iterators and creates a new iterator over both in sequence. Read more1.0.0 · Source§fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>where
│ │ │ │ - Self: Sized,
│ │ │ │ - U: IntoIterator,
‘Zips up’ two iterators into a single iterator of pairs. Read moreSource§fn intersperse(self, separator: Self::Item) -> Intersperse<Self>
🔬This is a nightly-only experimental API. (iter_intersperse
#79524)Creates a new iterator which places a copy of separator
between adjacent
│ │ │ │ -items of the original iterator. Read moreSource§fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G>
🔬This is a nightly-only experimental API. (iter_intersperse
#79524)Creates a new iterator which places an item generated by separator
│ │ │ │ -between adjacent items of the original iterator. Read more1.0.0 · Source§fn map<B, F>(self, f: F) -> Map<Self, F>
Takes a closure and creates an iterator which calls that closure on each
│ │ │ │ -element. Read more1.0.0 · Source§fn filter<P>(self, predicate: P) -> Filter<Self, P>
Creates an iterator which uses a closure to determine if an element
│ │ │ │ -should be yielded. Read more1.0.0 · Source§fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>
Creates an iterator that both filters and maps. Read more1.0.0 · Source§fn enumerate(self) -> Enumerate<Self>where
│ │ │ │ - Self: Sized,
Creates an iterator which gives the current iteration count as well as
│ │ │ │ -the next value. Read more1.0.0 · Source§fn peekable(self) -> Peekable<Self>where
│ │ │ │ - Self: Sized,
Creates an iterator which can use the peek
and peek_mut
methods
│ │ │ │ +) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>where
│ │ │ │ + Self: Sized,🔬This is a nightly-only experimental API. (iter_next_chunk
#98326)Advances the iterator and returns an array containing the next N
values. Read more1.0.0 · Source§fn count(self) -> usizewhere
│ │ │ │ + Self: Sized,
Consumes the iterator, counting the number of iterations and returning it. Read more1.0.0 · Source§fn last(self) -> Option<Self::Item>where
│ │ │ │ + Self: Sized,
Consumes the iterator, returning the last element. Read moreSource§fn advance_by(&mut self, n: usize) -> Result<(), NonZero<usize>>
🔬This is a nightly-only experimental API. (iter_advance_by
#77404)Advances the iterator by n
elements. Read more1.0.0 · Source§fn nth(&mut self, n: usize) -> Option<Self::Item>
Returns the n
th element of the iterator. Read more1.28.0 · Source§fn step_by(self, step: usize) -> StepBy<Self>where
│ │ │ │ + Self: Sized,
Creates an iterator starting at the same point, but stepping by
│ │ │ │ +the given amount at each iteration. Read more1.0.0 · Source§fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>
Takes two iterators and creates a new iterator over both in sequence. Read more1.0.0 · Source§fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>where
│ │ │ │ + Self: Sized,
│ │ │ │ + U: IntoIterator,
‘Zips up’ two iterators into a single iterator of pairs. Read moreSource§fn intersperse(self, separator: Self::Item) -> Intersperse<Self>
🔬This is a nightly-only experimental API. (iter_intersperse
#79524)Creates a new iterator which places a copy of separator
between adjacent
│ │ │ │ +items of the original iterator. Read moreSource§fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G>
🔬This is a nightly-only experimental API. (iter_intersperse
#79524)Creates a new iterator which places an item generated by separator
│ │ │ │ +between adjacent items of the original iterator. Read more1.0.0 · Source§fn map<B, F>(self, f: F) -> Map<Self, F>
Takes a closure and creates an iterator which calls that closure on each
│ │ │ │ +element. Read more1.0.0 · Source§fn filter<P>(self, predicate: P) -> Filter<Self, P>
Creates an iterator which uses a closure to determine if an element
│ │ │ │ +should be yielded. Read more1.0.0 · Source§fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>
Creates an iterator that both filters and maps. Read more1.0.0 · Source§fn enumerate(self) -> Enumerate<Self>where
│ │ │ │ + Self: Sized,
Creates an iterator which gives the current iteration count as well as
│ │ │ │ +the next value. Read more1.0.0 · Source§fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>
1.0.0 · Source§fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>
Creates an iterator that yields elements based on a predicate. Read more1.57.0 · Source§fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P>
Creates an iterator that both yields elements based on a predicate and maps. Read more1.0.0 · Source§fn skip(self, n: usize) -> Skip<Self>where
│ │ │ │ - Self: Sized,
Creates an iterator that skips the first n
elements. Read more1.0.0 · Source§fn take(self, n: usize) -> Take<Self>where
│ │ │ │ - Self: Sized,
Creates an iterator that yields the first n
elements, or fewer
│ │ │ │ -if the underlying iterator ends sooner. Read more1.0.0 · Source§fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>
Creates an iterator that works like map, but flattens nested structure. Read more1.29.0 · Source§fn flatten(self) -> Flatten<Self>
Creates an iterator that flattens nested structure. Read moreSource§fn map_windows<F, R, const N: usize>(self, f: F) -> MapWindows<Self, F, N>
🔬This is a nightly-only experimental API. (iter_map_windows
#87155)Calls the given function f
for each contiguous window of size N
over
│ │ │ │ -self
and returns an iterator over the outputs of f
. Like slice::windows()
,
│ │ │ │ -the windows during mapping overlap as well. Read more1.0.0 · Source§fn inspect<F>(self, f: F) -> Inspect<Self, F>
Does something with each element of an iterator, passing the value on. Read more1.0.0 · Source§fn by_ref(&mut self) -> &mut Selfwhere
│ │ │ │ - Self: Sized,
Borrows an iterator, rather than consuming it. Read moreSource§fn try_collect<B>(
│ │ │ │ +their documentation for more information. Read more
1.0.0 · Source§fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>
1.0.0 · Source§fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>
Creates an iterator that yields elements based on a predicate. Read more1.57.0 · Source§fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P>
Creates an iterator that both yields elements based on a predicate and maps. Read more1.0.0 · Source§fn skip(self, n: usize) -> Skip<Self>where
│ │ │ │ + Self: Sized,
Creates an iterator that skips the first n
elements. Read more1.0.0 · Source§fn take(self, n: usize) -> Take<Self>where
│ │ │ │ + Self: Sized,
Creates an iterator that yields the first n
elements, or fewer
│ │ │ │ +if the underlying iterator ends sooner. Read more1.0.0 · Source§fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>
Creates an iterator that works like map, but flattens nested structure. Read more1.29.0 · Source§fn flatten(self) -> Flatten<Self>
Creates an iterator that flattens nested structure. Read moreSource§fn map_windows<F, R, const N: usize>(self, f: F) -> MapWindows<Self, F, N>
🔬This is a nightly-only experimental API. (iter_map_windows
#87155)Calls the given function f
for each contiguous window of size N
over
│ │ │ │ +self
and returns an iterator over the outputs of f
. Like slice::windows()
,
│ │ │ │ +the windows during mapping overlap as well. Read more1.0.0 · Source§fn inspect<F>(self, f: F) -> Inspect<Self, F>
Does something with each element of an iterator, passing the value on. Read more1.0.0 · Source§fn by_ref(&mut self) -> &mut Selfwhere
│ │ │ │ + Self: Sized,
Borrows an iterator, rather than consuming it. Read moreSource§fn try_collect<B>(
│ │ │ │ &mut self,
│ │ │ │ -) -> <<Self::Item as Try>::Residual as Residual<B>>::TryType
🔬This is a nightly-only experimental API. (iterator_try_collect
#94047)Fallibly transforms an iterator into a collection, short circuiting if
│ │ │ │ -a failure is encountered. Read moreSource§fn collect_into<E>(self, collection: &mut E) -> &mut E
🔬This is a nightly-only experimental API. (iter_collect_into
#94780)Collects all the items from an iterator into a collection. Read more1.0.0 · Source§fn partition<B, F>(self, f: F) -> (B, B)
Consumes an iterator, creating two collections from it. Read moreSource§fn is_partitioned<P>(self, predicate: P) -> bool
🔬This is a nightly-only experimental API. (iter_is_partitioned
#62544)Checks if the elements of this iterator are partitioned according to the given predicate,
│ │ │ │ -such that all those that return true
precede all those that return false
. Read more1.27.0 · Source§fn try_fold<B, F, R>(&mut self, init: B, f: F) -> R
An iterator method that applies a function as long as it returns
│ │ │ │ -successfully, producing a single, final value. Read more1.27.0 · Source§fn try_for_each<F, R>(&mut self, f: F) -> R
An iterator method that applies a fallible function to each item in the
│ │ │ │ -iterator, stopping at the first error and returning that error. Read more1.0.0 · Source§fn fold<B, F>(self, init: B, f: F) -> B
Folds every element into an accumulator by applying an operation,
│ │ │ │ -returning the final result. Read more1.51.0 · Source§fn reduce<F>(self, f: F) -> Option<Self::Item>
Reduces the elements to a single one, by repeatedly applying a reducing
│ │ │ │ -operation. Read moreSource§fn try_reduce<R>(
│ │ │ │ +) -> <<Self::Item as Try>::Residual as Residual<B>>::TryType
🔬This is a nightly-only experimental API. (iterator_try_collect
#94047)Fallibly transforms an iterator into a collection, short circuiting if
│ │ │ │ +a failure is encountered. Read moreSource§fn collect_into<E>(self, collection: &mut E) -> &mut E
🔬This is a nightly-only experimental API. (iter_collect_into
#94780)Collects all the items from an iterator into a collection. Read more1.0.0 · Source§fn partition<B, F>(self, f: F) -> (B, B)
Consumes an iterator, creating two collections from it. Read moreSource§fn is_partitioned<P>(self, predicate: P) -> bool
🔬This is a nightly-only experimental API. (iter_is_partitioned
#62544)Checks if the elements of this iterator are partitioned according to the given predicate,
│ │ │ │ +such that all those that return true
precede all those that return false
. Read more1.27.0 · Source§fn try_fold<B, F, R>(&mut self, init: B, f: F) -> R
An iterator method that applies a function as long as it returns
│ │ │ │ +successfully, producing a single, final value. Read more1.27.0 · Source§fn try_for_each<F, R>(&mut self, f: F) -> R
An iterator method that applies a fallible function to each item in the
│ │ │ │ +iterator, stopping at the first error and returning that error. Read more1.0.0 · Source§fn fold<B, F>(self, init: B, f: F) -> B
Folds every element into an accumulator by applying an operation,
│ │ │ │ +returning the final result. Read more1.51.0 · Source§fn reduce<F>(self, f: F) -> Option<Self::Item>
Reduces the elements to a single one, by repeatedly applying a reducing
│ │ │ │ +operation. Read moreSource§fn try_reduce<R>(
│ │ │ │ &mut self,
│ │ │ │ - f: impl FnMut(Self::Item, Self::Item) -> R,
│ │ │ │ -) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryType
🔬This is a nightly-only experimental API. (iterator_try_reduce
#87053)Reduces the elements to a single one by repeatedly applying a reducing operation. If the
│ │ │ │ -closure returns a failure, the failure is propagated back to the caller immediately. Read more1.0.0 · Source§fn all<F>(&mut self, f: F) -> bool
Tests if every element of the iterator matches a predicate. Read more1.0.0 · Source§fn any<F>(&mut self, f: F) -> bool
Tests if any element of the iterator matches a predicate. Read more1.0.0 · Source§fn find<P>(&mut self, predicate: P) -> Option<Self::Item>
Searches for an element of an iterator that satisfies a predicate. Read more1.30.0 · Source§fn find_map<B, F>(&mut self, f: F) -> Option<B>
Applies function to the elements of iterator and returns
│ │ │ │ -the first non-none result. Read moreSource§fn try_find<R>(
│ │ │ │ + f: impl FnMut(Self::Item, Self::Item) -> R,
│ │ │ │ +) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryType
🔬This is a nightly-only experimental API. (iterator_try_reduce
#87053)Reduces the elements to a single one by repeatedly applying a reducing operation. If the
│ │ │ │ +closure returns a failure, the failure is propagated back to the caller immediately. Read more1.0.0 · Source§fn all<F>(&mut self, f: F) -> bool
Tests if every element of the iterator matches a predicate. Read more1.0.0 · Source§fn any<F>(&mut self, f: F) -> bool
Tests if any element of the iterator matches a predicate. Read more1.0.0 · Source§fn find<P>(&mut self, predicate: P) -> Option<Self::Item>
Searches for an element of an iterator that satisfies a predicate. Read more1.30.0 · Source§fn find_map<B, F>(&mut self, f: F) -> Option<B>
Applies function to the elements of iterator and returns
│ │ │ │ +the first non-none result. Read moreSource§fn try_find<R>(
│ │ │ │ &mut self,
│ │ │ │ - f: impl FnMut(&Self::Item) -> R,
│ │ │ │ -) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryType
🔬This is a nightly-only experimental API. (try_find
#63178)Applies function to the elements of iterator and returns
│ │ │ │ -the first true result or the first error. Read more1.0.0 · Source§fn position<P>(&mut self, predicate: P) -> Option<usize>
Searches for an element in an iterator, returning its index. Read more1.0.0 · Source§fn max(self) -> Option<Self::Item>
Returns the maximum element of an iterator. Read more1.0.0 · Source§fn min(self) -> Option<Self::Item>
Returns the minimum element of an iterator. Read more1.6.0 · Source§fn max_by_key<B, F>(self, f: F) -> Option<Self::Item>
Returns the element that gives the maximum value from the
│ │ │ │ -specified function. Read more1.15.0 · Source§fn max_by<F>(self, compare: F) -> Option<Self::Item>
Returns the element that gives the maximum value with respect to the
│ │ │ │ -specified comparison function. Read more1.6.0 · Source§fn min_by_key<B, F>(self, f: F) -> Option<Self::Item>
Returns the element that gives the minimum value from the
│ │ │ │ -specified function. Read more1.15.0 · Source§fn min_by<F>(self, compare: F) -> Option<Self::Item>
Returns the element that gives the minimum value with respect to the
│ │ │ │ -specified comparison function. Read more1.0.0 · Source§fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)
Converts an iterator of pairs into a pair of containers. Read more1.36.0 · Source§fn copied<'a, T>(self) -> Copied<Self>
Creates an iterator which copies all of its elements. Read moreSource§fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N>where
│ │ │ │ - Self: Sized,
🔬This is a nightly-only experimental API. (iter_array_chunks
#100450)Returns an iterator over N
elements of the iterator at a time. Read more1.11.0 · Source§fn product<P>(self) -> P
Iterates over the entire iterator, multiplying all the elements Read more1.5.0 · Source§fn cmp<I>(self, other: I) -> Orderingwhere
│ │ │ │ - I: IntoIterator<Item = Self::Item>,
│ │ │ │ - Self::Item: Ord,
│ │ │ │ - Self: Sized,
Source§fn cmp_by<I, F>(self, other: I, cmp: F) -> Orderingwhere
│ │ │ │ - Self: Sized,
│ │ │ │ - I: IntoIterator,
│ │ │ │ - F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Ordering,
🔬This is a nightly-only experimental API. (iter_order_by
#64295)Lexicographically compares the elements of this Iterator
with those
│ │ │ │ -of another with respect to the specified comparison function. Read more1.5.0 · Source§fn partial_cmp<I>(self, other: I) -> Option<Ordering>where
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
Lexicographically compares the PartialOrd
elements of
│ │ │ │ -this Iterator
with those of another. The comparison works like short-circuit
│ │ │ │ + f: impl FnMut(&Self::Item) -> R,
│ │ │ │ +) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryTypewhere
│ │ │ │ + Self: Sized,
│ │ │ │ + R: Try<Output = bool>,
│ │ │ │ + <R as Try>::Residual: Residual<Option<Self::Item>>,🔬This is a nightly-only experimental API. (try_find
#63178)Applies function to the elements of iterator and returns
│ │ │ │ +the first true result or the first error. Read more1.0.0 · Source§fn position<P>(&mut self, predicate: P) -> Option<usize>
Searches for an element in an iterator, returning its index. Read more1.0.0 · Source§fn max(self) -> Option<Self::Item>
Returns the maximum element of an iterator. Read more1.0.0 · Source§fn min(self) -> Option<Self::Item>
Returns the minimum element of an iterator. Read more1.6.0 · Source§fn max_by_key<B, F>(self, f: F) -> Option<Self::Item>
Returns the element that gives the maximum value from the
│ │ │ │ +specified function. Read more1.15.0 · Source§fn max_by<F>(self, compare: F) -> Option<Self::Item>
Returns the element that gives the maximum value with respect to the
│ │ │ │ +specified comparison function. Read more1.6.0 · Source§fn min_by_key<B, F>(self, f: F) -> Option<Self::Item>
Returns the element that gives the minimum value from the
│ │ │ │ +specified function. Read more1.15.0 · Source§fn min_by<F>(self, compare: F) -> Option<Self::Item>
Returns the element that gives the minimum value with respect to the
│ │ │ │ +specified comparison function. Read more1.0.0 · Source§fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)
Converts an iterator of pairs into a pair of containers. Read more1.36.0 · Source§fn copied<'a, T>(self) -> Copied<Self>
Creates an iterator which copies all of its elements. Read moreSource§fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N>where
│ │ │ │ + Self: Sized,
🔬This is a nightly-only experimental API. (iter_array_chunks
#100450)Returns an iterator over N
elements of the iterator at a time. Read more1.11.0 · Source§fn product<P>(self) -> P
Iterates over the entire iterator, multiplying all the elements Read more1.5.0 · Source§fn cmp<I>(self, other: I) -> Orderingwhere
│ │ │ │ + I: IntoIterator<Item = Self::Item>,
│ │ │ │ + Self::Item: Ord,
│ │ │ │ + Self: Sized,
Source§fn cmp_by<I, F>(self, other: I, cmp: F) -> Orderingwhere
│ │ │ │ + Self: Sized,
│ │ │ │ + I: IntoIterator,
│ │ │ │ + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Ordering,
🔬This is a nightly-only experimental API. (iter_order_by
#64295)Lexicographically compares the elements of this Iterator
with those
│ │ │ │ +of another with respect to the specified comparison function. Read more1.5.0 · Source§fn partial_cmp<I>(self, other: I) -> Option<Ordering>where
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
Lexicographically compares the PartialOrd
elements of
│ │ │ │ +this Iterator
with those of another. The comparison works like short-circuit
│ │ │ │ evaluation, returning a result without comparing the remaining elements.
│ │ │ │ -As soon as an order can be determined, the evaluation stops and a result is returned. Read moreSource§fn partial_cmp_by<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering>where
│ │ │ │ - Self: Sized,
│ │ │ │ - I: IntoIterator,
│ │ │ │ - F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Option<Ordering>,
🔬This is a nightly-only experimental API. (iter_order_by
#64295)Lexicographically compares the elements of this Iterator
with those
│ │ │ │ -of another with respect to the specified comparison function. Read more1.5.0 · Source§fn eq<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialEq<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
Source§fn eq_by<I, F>(self, other: I, eq: F) -> boolwhere
│ │ │ │ - Self: Sized,
│ │ │ │ - I: IntoIterator,
│ │ │ │ - F: FnMut(Self::Item, <I as IntoIterator>::Item) -> bool,
🔬This is a nightly-only experimental API. (iter_order_by
#64295)1.5.0 · Source§fn ne<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialEq<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
1.5.0 · Source§fn lt<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
Determines if the elements of this Iterator
are lexicographically
│ │ │ │ -less than those of another. Read more1.5.0 · Source§fn le<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
Determines if the elements of this Iterator
are lexicographically
│ │ │ │ -less or equal to those of another. Read more1.5.0 · Source§fn gt<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
Determines if the elements of this Iterator
are lexicographically
│ │ │ │ -greater than those of another. Read more1.5.0 · Source§fn ge<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
Determines if the elements of this Iterator
are lexicographically
│ │ │ │ -greater than or equal to those of another. Read more1.82.0 · Source§fn is_sorted(self) -> bool
Checks if the elements of this iterator are sorted. Read more1.82.0 · Source§fn is_sorted_by<F>(self, compare: F) -> bool
Checks if the elements of this iterator are sorted using the given comparator function. Read more1.82.0 · Source§fn is_sorted_by_key<F, K>(self, f: F) -> bool
Checks if the elements of this iterator are sorted using the given key extraction
│ │ │ │ -function. Read moreSource§impl<T: Ord, A: Allocator> FusedIterator for IntoIterSorted<T, A>
Source§impl<T: Ord, A: Allocator> TrustedLen for IntoIterSorted<T, A>
Auto Trait Implementations§
§impl<T, A> Freeze for IntoIterSorted<T, A>where
│ │ │ │ - A: Freeze,
§impl<T, A> RefUnwindSafe for IntoIterSorted<T, A>where
│ │ │ │ - A: RefUnwindSafe,
│ │ │ │ - T: RefUnwindSafe,
§impl<T, A> Send for IntoIterSorted<T, A>
§impl<T, A> Sync for IntoIterSorted<T, A>
§impl<T, A> Unpin for IntoIterSorted<T, A>
§impl<T, A> UnwindSafe for IntoIterSorted<T, A>where
│ │ │ │ - A: UnwindSafe,
│ │ │ │ - T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
│ │ │ │ - T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moreSource§impl<T> CloneToUninit for Twhere
│ │ │ │ - T: Clone,
Source§impl<T, U> Into<U> for Twhere
│ │ │ │ - U: From<T>,
Source§fn into(self) -> U
Calls U::from(self)
.
│ │ │ │ +As soon as an order can be determined, the evaluation stops and a result is returned. Read moreSource§fn partial_cmp_by<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering>where
│ │ │ │ + Self: Sized,
│ │ │ │ + I: IntoIterator,
│ │ │ │ + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Option<Ordering>,
🔬This is a nightly-only experimental API. (iter_order_by
#64295)Lexicographically compares the elements of this Iterator
with those
│ │ │ │ +of another with respect to the specified comparison function. Read more1.5.0 · Source§fn eq<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialEq<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
Source§fn eq_by<I, F>(self, other: I, eq: F) -> boolwhere
│ │ │ │ + Self: Sized,
│ │ │ │ + I: IntoIterator,
│ │ │ │ + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> bool,
🔬This is a nightly-only experimental API. (iter_order_by
#64295)1.5.0 · Source§fn ne<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialEq<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
1.5.0 · Source§fn lt<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
Determines if the elements of this Iterator
are lexicographically
│ │ │ │ +less than those of another. Read more1.5.0 · Source§fn le<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
Determines if the elements of this Iterator
are lexicographically
│ │ │ │ +less or equal to those of another. Read more1.5.0 · Source§fn gt<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
Determines if the elements of this Iterator
are lexicographically
│ │ │ │ +greater than those of another. Read more1.5.0 · Source§fn ge<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
Determines if the elements of this Iterator
are lexicographically
│ │ │ │ +greater than or equal to those of another. Read more1.82.0 · Source§fn is_sorted(self) -> bool
Checks if the elements of this iterator are sorted. Read more1.82.0 · Source§fn is_sorted_by<F>(self, compare: F) -> bool
Checks if the elements of this iterator are sorted using the given comparator function. Read more1.82.0 · Source§fn is_sorted_by_key<F, K>(self, f: F) -> bool
Checks if the elements of this iterator are sorted using the given key extraction
│ │ │ │ +function. Read moreSource§impl<T: Ord, A: Allocator> FusedIterator for IntoIterSorted<T, A>
Source§impl<T: Ord, A: Allocator> TrustedLen for IntoIterSorted<T, A>
Auto Trait Implementations§
§impl<T, A> Freeze for IntoIterSorted<T, A>where
│ │ │ │ + A: Freeze,
§impl<T, A> RefUnwindSafe for IntoIterSorted<T, A>where
│ │ │ │ + A: RefUnwindSafe,
│ │ │ │ + T: RefUnwindSafe,
§impl<T, A> Send for IntoIterSorted<T, A>
§impl<T, A> Sync for IntoIterSorted<T, A>
§impl<T, A> Unpin for IntoIterSorted<T, A>
§impl<T, A> UnwindSafe for IntoIterSorted<T, A>where
│ │ │ │ + A: UnwindSafe,
│ │ │ │ + T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
│ │ │ │ + T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moreSource§impl<T> CloneToUninit for Twhere
│ │ │ │ + T: Clone,
Source§impl<I> IntoIterator for Iwhere
│ │ │ │ - I: Iterator,
│ │ │ │ +From<T> for U
chooses to do.
│ │ │ │ +
fn next_chunk<const N: usize>(
│ │ │ │ +IntoIterSorted in alloc::collections::binary_heap - Rust pub struct IntoIterSorted<T, A: Allocator = Global> { /* private fields */ }
🔬This is a nightly-only experimental API. (binary_heap_into_iter_sorted
#59278)Implementations§
Trait Implementations§
Source§impl<T: Clone, A: Clone + Allocator> Clone for IntoIterSorted<T, A>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreSource§impl<T: Ord, A: Allocator> ExactSizeIterator for IntoIterSorted<T, A>
Source§impl<T: Ord, A: Allocator> Iterator for IntoIterSorted<T, A>
Source§fn size_hint(&self) -> (usize, Option<usize>)
Returns the bounds on the remaining length of the iterator. Read moreSource§fn next_chunk<const N: usize>(
│ │ │ │ &mut self,
│ │ │ │ -) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>where
│ │ │ │ - Self: Sized,
🔬This is a nightly-only experimental API. (iter_next_chunk
#98326)Advances the iterator and returns an array containing the next N
values. Read more1.0.0 · Source§fn count(self) -> usizewhere
│ │ │ │ - Self: Sized,
Consumes the iterator, counting the number of iterations and returning it. Read more1.0.0 · Source§fn last(self) -> Option<Self::Item>where
│ │ │ │ - Self: Sized,
Consumes the iterator, returning the last element. Read moreSource§fn advance_by(&mut self, n: usize) -> Result<(), NonZero<usize>>
🔬This is a nightly-only experimental API. (iter_advance_by
#77404)Advances the iterator by n
elements. Read more1.0.0 · Source§fn nth(&mut self, n: usize) -> Option<Self::Item>
Returns the n
th element of the iterator. Read more1.28.0 · Source§fn step_by(self, step: usize) -> StepBy<Self>where
│ │ │ │ - Self: Sized,
Creates an iterator starting at the same point, but stepping by
│ │ │ │ -the given amount at each iteration. Read more1.0.0 · Source§fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>
Takes two iterators and creates a new iterator over both in sequence. Read more1.0.0 · Source§fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>where
│ │ │ │ - Self: Sized,
│ │ │ │ - U: IntoIterator,
‘Zips up’ two iterators into a single iterator of pairs. Read moreSource§fn intersperse(self, separator: Self::Item) -> Intersperse<Self>
🔬This is a nightly-only experimental API. (iter_intersperse
#79524)Creates a new iterator which places a copy of separator
between adjacent
│ │ │ │ -items of the original iterator. Read moreSource§fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G>
🔬This is a nightly-only experimental API. (iter_intersperse
#79524)Creates a new iterator which places an item generated by separator
│ │ │ │ -between adjacent items of the original iterator. Read more1.0.0 · Source§fn map<B, F>(self, f: F) -> Map<Self, F>
Takes a closure and creates an iterator which calls that closure on each
│ │ │ │ -element. Read more1.0.0 · Source§fn filter<P>(self, predicate: P) -> Filter<Self, P>
Creates an iterator which uses a closure to determine if an element
│ │ │ │ -should be yielded. Read more1.0.0 · Source§fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>
Creates an iterator that both filters and maps. Read more1.0.0 · Source§fn enumerate(self) -> Enumerate<Self>where
│ │ │ │ - Self: Sized,
Creates an iterator which gives the current iteration count as well as
│ │ │ │ -the next value. Read more1.0.0 · Source§fn peekable(self) -> Peekable<Self>where
│ │ │ │ - Self: Sized,
Creates an iterator which can use the peek
and peek_mut
methods
│ │ │ │ +) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>where
│ │ │ │ + Self: Sized,🔬This is a nightly-only experimental API. (iter_next_chunk
#98326)Advances the iterator and returns an array containing the next N
values. Read more1.0.0 · Source§fn count(self) -> usizewhere
│ │ │ │ + Self: Sized,
Consumes the iterator, counting the number of iterations and returning it. Read more1.0.0 · Source§fn last(self) -> Option<Self::Item>where
│ │ │ │ + Self: Sized,
Consumes the iterator, returning the last element. Read moreSource§fn advance_by(&mut self, n: usize) -> Result<(), NonZero<usize>>
🔬This is a nightly-only experimental API. (iter_advance_by
#77404)Advances the iterator by n
elements. Read more1.0.0 · Source§fn nth(&mut self, n: usize) -> Option<Self::Item>
Returns the n
th element of the iterator. Read more1.28.0 · Source§fn step_by(self, step: usize) -> StepBy<Self>where
│ │ │ │ + Self: Sized,
Creates an iterator starting at the same point, but stepping by
│ │ │ │ +the given amount at each iteration. Read more1.0.0 · Source§fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>
Takes two iterators and creates a new iterator over both in sequence. Read more1.0.0 · Source§fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>where
│ │ │ │ + Self: Sized,
│ │ │ │ + U: IntoIterator,
‘Zips up’ two iterators into a single iterator of pairs. Read moreSource§fn intersperse(self, separator: Self::Item) -> Intersperse<Self>
🔬This is a nightly-only experimental API. (iter_intersperse
#79524)Creates a new iterator which places a copy of separator
between adjacent
│ │ │ │ +items of the original iterator. Read moreSource§fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G>
🔬This is a nightly-only experimental API. (iter_intersperse
#79524)Creates a new iterator which places an item generated by separator
│ │ │ │ +between adjacent items of the original iterator. Read more1.0.0 · Source§fn map<B, F>(self, f: F) -> Map<Self, F>
Takes a closure and creates an iterator which calls that closure on each
│ │ │ │ +element. Read more1.0.0 · Source§fn filter<P>(self, predicate: P) -> Filter<Self, P>
Creates an iterator which uses a closure to determine if an element
│ │ │ │ +should be yielded. Read more1.0.0 · Source§fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>
Creates an iterator that both filters and maps. Read more1.0.0 · Source§fn enumerate(self) -> Enumerate<Self>where
│ │ │ │ + Self: Sized,
Creates an iterator which gives the current iteration count as well as
│ │ │ │ +the next value. Read more1.0.0 · Source§fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>
1.0.0 · Source§fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>
Creates an iterator that yields elements based on a predicate. Read more1.57.0 · Source§fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P>
Creates an iterator that both yields elements based on a predicate and maps. Read more1.0.0 · Source§fn skip(self, n: usize) -> Skip<Self>where
│ │ │ │ - Self: Sized,
Creates an iterator that skips the first n
elements. Read more1.0.0 · Source§fn take(self, n: usize) -> Take<Self>where
│ │ │ │ - Self: Sized,
Creates an iterator that yields the first n
elements, or fewer
│ │ │ │ -if the underlying iterator ends sooner. Read more1.0.0 · Source§fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>
Creates an iterator that works like map, but flattens nested structure. Read more1.29.0 · Source§fn flatten(self) -> Flatten<Self>
Creates an iterator that flattens nested structure. Read moreSource§fn map_windows<F, R, const N: usize>(self, f: F) -> MapWindows<Self, F, N>
🔬This is a nightly-only experimental API. (iter_map_windows
#87155)Calls the given function f
for each contiguous window of size N
over
│ │ │ │ -self
and returns an iterator over the outputs of f
. Like slice::windows()
,
│ │ │ │ -the windows during mapping overlap as well. Read more1.0.0 · Source§fn inspect<F>(self, f: F) -> Inspect<Self, F>
Does something with each element of an iterator, passing the value on. Read more1.0.0 · Source§fn by_ref(&mut self) -> &mut Selfwhere
│ │ │ │ - Self: Sized,
Borrows an iterator, rather than consuming it. Read moreSource§fn try_collect<B>(
│ │ │ │ +their documentation for more information. Read more
1.0.0 · Source§fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>
1.0.0 · Source§fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>
Creates an iterator that yields elements based on a predicate. Read more1.57.0 · Source§fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P>
Creates an iterator that both yields elements based on a predicate and maps. Read more1.0.0 · Source§fn skip(self, n: usize) -> Skip<Self>where
│ │ │ │ + Self: Sized,
Creates an iterator that skips the first n
elements. Read more1.0.0 · Source§fn take(self, n: usize) -> Take<Self>where
│ │ │ │ + Self: Sized,
Creates an iterator that yields the first n
elements, or fewer
│ │ │ │ +if the underlying iterator ends sooner. Read more1.0.0 · Source§fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>
Creates an iterator that works like map, but flattens nested structure. Read more1.29.0 · Source§fn flatten(self) -> Flatten<Self>
Creates an iterator that flattens nested structure. Read moreSource§fn map_windows<F, R, const N: usize>(self, f: F) -> MapWindows<Self, F, N>
🔬This is a nightly-only experimental API. (iter_map_windows
#87155)Calls the given function f
for each contiguous window of size N
over
│ │ │ │ +self
and returns an iterator over the outputs of f
. Like slice::windows()
,
│ │ │ │ +the windows during mapping overlap as well. Read more1.0.0 · Source§fn inspect<F>(self, f: F) -> Inspect<Self, F>
Does something with each element of an iterator, passing the value on. Read more1.0.0 · Source§fn by_ref(&mut self) -> &mut Selfwhere
│ │ │ │ + Self: Sized,
Borrows an iterator, rather than consuming it. Read moreSource§fn try_collect<B>(
│ │ │ │ &mut self,
│ │ │ │ -) -> <<Self::Item as Try>::Residual as Residual<B>>::TryType
🔬This is a nightly-only experimental API. (iterator_try_collect
#94047)Fallibly transforms an iterator into a collection, short circuiting if
│ │ │ │ -a failure is encountered. Read moreSource§fn collect_into<E>(self, collection: &mut E) -> &mut E
🔬This is a nightly-only experimental API. (iter_collect_into
#94780)Collects all the items from an iterator into a collection. Read more1.0.0 · Source§fn partition<B, F>(self, f: F) -> (B, B)
Consumes an iterator, creating two collections from it. Read moreSource§fn is_partitioned<P>(self, predicate: P) -> bool
🔬This is a nightly-only experimental API. (iter_is_partitioned
#62544)Checks if the elements of this iterator are partitioned according to the given predicate,
│ │ │ │ -such that all those that return true
precede all those that return false
. Read more1.27.0 · Source§fn try_fold<B, F, R>(&mut self, init: B, f: F) -> R
An iterator method that applies a function as long as it returns
│ │ │ │ -successfully, producing a single, final value. Read more1.27.0 · Source§fn try_for_each<F, R>(&mut self, f: F) -> R
An iterator method that applies a fallible function to each item in the
│ │ │ │ -iterator, stopping at the first error and returning that error. Read more1.0.0 · Source§fn fold<B, F>(self, init: B, f: F) -> B
Folds every element into an accumulator by applying an operation,
│ │ │ │ -returning the final result. Read more1.51.0 · Source§fn reduce<F>(self, f: F) -> Option<Self::Item>
Reduces the elements to a single one, by repeatedly applying a reducing
│ │ │ │ -operation. Read moreSource§fn try_reduce<R>(
│ │ │ │ +) -> <<Self::Item as Try>::Residual as Residual<B>>::TryType
🔬This is a nightly-only experimental API. (iterator_try_collect
#94047)Fallibly transforms an iterator into a collection, short circuiting if
│ │ │ │ +a failure is encountered. Read moreSource§fn collect_into<E>(self, collection: &mut E) -> &mut E
🔬This is a nightly-only experimental API. (iter_collect_into
#94780)Collects all the items from an iterator into a collection. Read more1.0.0 · Source§fn partition<B, F>(self, f: F) -> (B, B)
Consumes an iterator, creating two collections from it. Read moreSource§fn is_partitioned<P>(self, predicate: P) -> bool
🔬This is a nightly-only experimental API. (iter_is_partitioned
#62544)Checks if the elements of this iterator are partitioned according to the given predicate,
│ │ │ │ +such that all those that return true
precede all those that return false
. Read more1.27.0 · Source§fn try_fold<B, F, R>(&mut self, init: B, f: F) -> R
An iterator method that applies a function as long as it returns
│ │ │ │ +successfully, producing a single, final value. Read more1.27.0 · Source§fn try_for_each<F, R>(&mut self, f: F) -> R
An iterator method that applies a fallible function to each item in the
│ │ │ │ +iterator, stopping at the first error and returning that error. Read more1.0.0 · Source§fn fold<B, F>(self, init: B, f: F) -> B
Folds every element into an accumulator by applying an operation,
│ │ │ │ +returning the final result. Read more1.51.0 · Source§fn reduce<F>(self, f: F) -> Option<Self::Item>
Reduces the elements to a single one, by repeatedly applying a reducing
│ │ │ │ +operation. Read moreSource§fn try_reduce<R>(
│ │ │ │ &mut self,
│ │ │ │ - f: impl FnMut(Self::Item, Self::Item) -> R,
│ │ │ │ -) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryType
🔬This is a nightly-only experimental API. (iterator_try_reduce
#87053)Reduces the elements to a single one by repeatedly applying a reducing operation. If the
│ │ │ │ -closure returns a failure, the failure is propagated back to the caller immediately. Read more1.0.0 · Source§fn all<F>(&mut self, f: F) -> bool
Tests if every element of the iterator matches a predicate. Read more1.0.0 · Source§fn any<F>(&mut self, f: F) -> bool
Tests if any element of the iterator matches a predicate. Read more1.0.0 · Source§fn find<P>(&mut self, predicate: P) -> Option<Self::Item>
Searches for an element of an iterator that satisfies a predicate. Read more1.30.0 · Source§fn find_map<B, F>(&mut self, f: F) -> Option<B>
Applies function to the elements of iterator and returns
│ │ │ │ -the first non-none result. Read moreSource§fn try_find<R>(
│ │ │ │ + f: impl FnMut(Self::Item, Self::Item) -> R,
│ │ │ │ +) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryType
🔬This is a nightly-only experimental API. (iterator_try_reduce
#87053)Reduces the elements to a single one by repeatedly applying a reducing operation. If the
│ │ │ │ +closure returns a failure, the failure is propagated back to the caller immediately. Read more1.0.0 · Source§fn all<F>(&mut self, f: F) -> bool
Tests if every element of the iterator matches a predicate. Read more1.0.0 · Source§fn any<F>(&mut self, f: F) -> bool
Tests if any element of the iterator matches a predicate. Read more1.0.0 · Source§fn find<P>(&mut self, predicate: P) -> Option<Self::Item>
Searches for an element of an iterator that satisfies a predicate. Read more1.30.0 · Source§fn find_map<B, F>(&mut self, f: F) -> Option<B>
Applies function to the elements of iterator and returns
│ │ │ │ +the first non-none result. Read moreSource§fn try_find<R>(
│ │ │ │ &mut self,
│ │ │ │ - f: impl FnMut(&Self::Item) -> R,
│ │ │ │ -) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryType
🔬This is a nightly-only experimental API. (try_find
#63178)Applies function to the elements of iterator and returns
│ │ │ │ -the first true result or the first error. Read more1.0.0 · Source§fn position<P>(&mut self, predicate: P) -> Option<usize>
Searches for an element in an iterator, returning its index. Read more1.0.0 · Source§fn max(self) -> Option<Self::Item>
Returns the maximum element of an iterator. Read more1.0.0 · Source§fn min(self) -> Option<Self::Item>
Returns the minimum element of an iterator. Read more1.6.0 · Source§fn max_by_key<B, F>(self, f: F) -> Option<Self::Item>
Returns the element that gives the maximum value from the
│ │ │ │ -specified function. Read more1.15.0 · Source§fn max_by<F>(self, compare: F) -> Option<Self::Item>
Returns the element that gives the maximum value with respect to the
│ │ │ │ -specified comparison function. Read more1.6.0 · Source§fn min_by_key<B, F>(self, f: F) -> Option<Self::Item>
Returns the element that gives the minimum value from the
│ │ │ │ -specified function. Read more1.15.0 · Source§fn min_by<F>(self, compare: F) -> Option<Self::Item>
Returns the element that gives the minimum value with respect to the
│ │ │ │ -specified comparison function. Read more1.0.0 · Source§fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)
Converts an iterator of pairs into a pair of containers. Read more1.36.0 · Source§fn copied<'a, T>(self) -> Copied<Self>
Creates an iterator which copies all of its elements. Read moreSource§fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N>where
│ │ │ │ - Self: Sized,
🔬This is a nightly-only experimental API. (iter_array_chunks
#100450)Returns an iterator over N
elements of the iterator at a time. Read more1.11.0 · Source§fn product<P>(self) -> P
Iterates over the entire iterator, multiplying all the elements Read more1.5.0 · Source§fn cmp<I>(self, other: I) -> Orderingwhere
│ │ │ │ - I: IntoIterator<Item = Self::Item>,
│ │ │ │ - Self::Item: Ord,
│ │ │ │ - Self: Sized,
Source§fn cmp_by<I, F>(self, other: I, cmp: F) -> Orderingwhere
│ │ │ │ - Self: Sized,
│ │ │ │ - I: IntoIterator,
│ │ │ │ - F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Ordering,
🔬This is a nightly-only experimental API. (iter_order_by
#64295)Lexicographically compares the elements of this Iterator
with those
│ │ │ │ -of another with respect to the specified comparison function. Read more1.5.0 · Source§fn partial_cmp<I>(self, other: I) -> Option<Ordering>where
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
Lexicographically compares the PartialOrd
elements of
│ │ │ │ -this Iterator
with those of another. The comparison works like short-circuit
│ │ │ │ + f: impl FnMut(&Self::Item) -> R,
│ │ │ │ +) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryTypewhere
│ │ │ │ + Self: Sized,
│ │ │ │ + R: Try<Output = bool>,
│ │ │ │ + <R as Try>::Residual: Residual<Option<Self::Item>>,🔬This is a nightly-only experimental API. (try_find
#63178)Applies function to the elements of iterator and returns
│ │ │ │ +the first true result or the first error. Read more1.0.0 · Source§fn position<P>(&mut self, predicate: P) -> Option<usize>
Searches for an element in an iterator, returning its index. Read more1.0.0 · Source§fn max(self) -> Option<Self::Item>
Returns the maximum element of an iterator. Read more1.0.0 · Source§fn min(self) -> Option<Self::Item>
Returns the minimum element of an iterator. Read more1.6.0 · Source§fn max_by_key<B, F>(self, f: F) -> Option<Self::Item>
Returns the element that gives the maximum value from the
│ │ │ │ +specified function. Read more1.15.0 · Source§fn max_by<F>(self, compare: F) -> Option<Self::Item>
Returns the element that gives the maximum value with respect to the
│ │ │ │ +specified comparison function. Read more1.6.0 · Source§fn min_by_key<B, F>(self, f: F) -> Option<Self::Item>
Returns the element that gives the minimum value from the
│ │ │ │ +specified function. Read more1.15.0 · Source§fn min_by<F>(self, compare: F) -> Option<Self::Item>
Returns the element that gives the minimum value with respect to the
│ │ │ │ +specified comparison function. Read more1.0.0 · Source§fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)
Converts an iterator of pairs into a pair of containers. Read more1.36.0 · Source§fn copied<'a, T>(self) -> Copied<Self>
Creates an iterator which copies all of its elements. Read moreSource§fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N>where
│ │ │ │ + Self: Sized,
🔬This is a nightly-only experimental API. (iter_array_chunks
#100450)Returns an iterator over N
elements of the iterator at a time. Read more1.11.0 · Source§fn product<P>(self) -> P
Iterates over the entire iterator, multiplying all the elements Read more1.5.0 · Source§fn cmp<I>(self, other: I) -> Orderingwhere
│ │ │ │ + I: IntoIterator<Item = Self::Item>,
│ │ │ │ + Self::Item: Ord,
│ │ │ │ + Self: Sized,
Source§fn cmp_by<I, F>(self, other: I, cmp: F) -> Orderingwhere
│ │ │ │ + Self: Sized,
│ │ │ │ + I: IntoIterator,
│ │ │ │ + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Ordering,
🔬This is a nightly-only experimental API. (iter_order_by
#64295)Lexicographically compares the elements of this Iterator
with those
│ │ │ │ +of another with respect to the specified comparison function. Read more1.5.0 · Source§fn partial_cmp<I>(self, other: I) -> Option<Ordering>where
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
Lexicographically compares the PartialOrd
elements of
│ │ │ │ +this Iterator
with those of another. The comparison works like short-circuit
│ │ │ │ evaluation, returning a result without comparing the remaining elements.
│ │ │ │ -As soon as an order can be determined, the evaluation stops and a result is returned. Read moreSource§fn partial_cmp_by<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering>where
│ │ │ │ - Self: Sized,
│ │ │ │ - I: IntoIterator,
│ │ │ │ - F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Option<Ordering>,
🔬This is a nightly-only experimental API. (iter_order_by
#64295)Lexicographically compares the elements of this Iterator
with those
│ │ │ │ -of another with respect to the specified comparison function. Read more1.5.0 · Source§fn eq<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialEq<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
Source§fn eq_by<I, F>(self, other: I, eq: F) -> boolwhere
│ │ │ │ - Self: Sized,
│ │ │ │ - I: IntoIterator,
│ │ │ │ - F: FnMut(Self::Item, <I as IntoIterator>::Item) -> bool,
🔬This is a nightly-only experimental API. (iter_order_by
#64295)1.5.0 · Source§fn ne<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialEq<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
1.5.0 · Source§fn lt<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
Determines if the elements of this Iterator
are lexicographically
│ │ │ │ -less than those of another. Read more1.5.0 · Source§fn le<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
Determines if the elements of this Iterator
are lexicographically
│ │ │ │ -less or equal to those of another. Read more1.5.0 · Source§fn gt<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
Determines if the elements of this Iterator
are lexicographically
│ │ │ │ -greater than those of another. Read more1.5.0 · Source§fn ge<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
Determines if the elements of this Iterator
are lexicographically
│ │ │ │ -greater than or equal to those of another. Read more1.82.0 · Source§fn is_sorted(self) -> bool
Checks if the elements of this iterator are sorted. Read more1.82.0 · Source§fn is_sorted_by<F>(self, compare: F) -> bool
Checks if the elements of this iterator are sorted using the given comparator function. Read more1.82.0 · Source§fn is_sorted_by_key<F, K>(self, f: F) -> bool
Checks if the elements of this iterator are sorted using the given key extraction
│ │ │ │ -function. Read moreSource§impl<T: Ord, A: Allocator> FusedIterator for IntoIterSorted<T, A>
Source§impl<T: Ord, A: Allocator> TrustedLen for IntoIterSorted<T, A>
Auto Trait Implementations§
§impl<T, A> Freeze for IntoIterSorted<T, A>where
│ │ │ │ - A: Freeze,
§impl<T, A> RefUnwindSafe for IntoIterSorted<T, A>where
│ │ │ │ - A: RefUnwindSafe,
│ │ │ │ - T: RefUnwindSafe,
§impl<T, A> Send for IntoIterSorted<T, A>
§impl<T, A> Sync for IntoIterSorted<T, A>
§impl<T, A> Unpin for IntoIterSorted<T, A>
§impl<T, A> UnwindSafe for IntoIterSorted<T, A>where
│ │ │ │ - A: UnwindSafe,
│ │ │ │ - T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
│ │ │ │ - T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moreSource§impl<T> CloneToUninit for Twhere
│ │ │ │ - T: Clone,
Source§impl<T, U> Into<U> for Twhere
│ │ │ │ - U: From<T>,
Source§fn into(self) -> U
Calls U::from(self)
.
│ │ │ │ +As soon as an order can be determined, the evaluation stops and a result is returned. Read moreSource§fn partial_cmp_by<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering>where
│ │ │ │ + Self: Sized,
│ │ │ │ + I: IntoIterator,
│ │ │ │ + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Option<Ordering>,
🔬This is a nightly-only experimental API. (iter_order_by
#64295)Lexicographically compares the elements of this Iterator
with those
│ │ │ │ +of another with respect to the specified comparison function. Read more1.5.0 · Source§fn eq<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialEq<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
Source§fn eq_by<I, F>(self, other: I, eq: F) -> boolwhere
│ │ │ │ + Self: Sized,
│ │ │ │ + I: IntoIterator,
│ │ │ │ + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> bool,
🔬This is a nightly-only experimental API. (iter_order_by
#64295)1.5.0 · Source§fn ne<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialEq<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
1.5.0 · Source§fn lt<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
Determines if the elements of this Iterator
are lexicographically
│ │ │ │ +less than those of another. Read more1.5.0 · Source§fn le<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
Determines if the elements of this Iterator
are lexicographically
│ │ │ │ +less or equal to those of another. Read more1.5.0 · Source§fn gt<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
Determines if the elements of this Iterator
are lexicographically
│ │ │ │ +greater than those of another. Read more1.5.0 · Source§fn ge<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
Determines if the elements of this Iterator
are lexicographically
│ │ │ │ +greater than or equal to those of another. Read more1.82.0 · Source§fn is_sorted(self) -> bool
Checks if the elements of this iterator are sorted. Read more1.82.0 · Source§fn is_sorted_by<F>(self, compare: F) -> bool
Checks if the elements of this iterator are sorted using the given comparator function. Read more1.82.0 · Source§fn is_sorted_by_key<F, K>(self, f: F) -> bool
Checks if the elements of this iterator are sorted using the given key extraction
│ │ │ │ +function. Read moreSource§impl<T: Ord, A: Allocator> FusedIterator for IntoIterSorted<T, A>
Source§impl<T: Ord, A: Allocator> TrustedLen for IntoIterSorted<T, A>
Auto Trait Implementations§
§impl<T, A> Freeze for IntoIterSorted<T, A>where
│ │ │ │ + A: Freeze,
§impl<T, A> RefUnwindSafe for IntoIterSorted<T, A>where
│ │ │ │ + A: RefUnwindSafe,
│ │ │ │ + T: RefUnwindSafe,
§impl<T, A> Send for IntoIterSorted<T, A>
§impl<T, A> Sync for IntoIterSorted<T, A>
§impl<T, A> Unpin for IntoIterSorted<T, A>
§impl<T, A> UnwindSafe for IntoIterSorted<T, A>where
│ │ │ │ + A: UnwindSafe,
│ │ │ │ + T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
│ │ │ │ + T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moreSource§impl<T> CloneToUninit for Twhere
│ │ │ │ + T: Clone,
Source§impl<I> IntoIterator for Iwhere
│ │ │ │ - I: Iterator,
│ │ │ │ +From<T> for U
chooses to do.
│ │ │ │ +
pub struct IntoIterSorted<T, A: Allocator = Global> { /* private fields */ }
binary_heap_into_iter_sorted
#59278)Implementations§
Trait Implementations§
Source§impl<T: Clone, A: Clone + Allocator> Clone for IntoIterSorted<T, A>
impl<T: Clone, A: Clone + Allocator> Clone for IntoIterSorted<T, A>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<T: Ord, A: Allocator> ExactSizeIterator for IntoIterSorted<T, A>
impl<T: Ord, A: Allocator> ExactSizeIterator for IntoIterSorted<T, A>
Source§impl<T: Ord, A: Allocator> Iterator for IntoIterSorted<T, A>
impl<T: Ord, A: Allocator> Iterator for IntoIterSorted<T, A>
Source§fn size_hint(&self) -> (usize, Option<usize>)
fn size_hint(&self) -> (usize, Option<usize>)
Source§fn next_chunk<const N: usize>(
│ │ │ │ &mut self,
│ │ │ │ -) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>where
│ │ │ │ - Self: Sized,
fn next_chunk<const N: usize>(
│ │ │ │ &mut self,
│ │ │ │ -) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>where
│ │ │ │ - Self: Sized,
iter_next_chunk
#98326)N
values. Read more1.0.0 · Source§fn count(self) -> usizewhere
│ │ │ │ - Self: Sized,
fn count(self) -> usizewhere
│ │ │ │ - Self: Sized,
1.0.0 · Source§fn last(self) -> Option<Self::Item>where
│ │ │ │ - Self: Sized,
fn last(self) -> Option<Self::Item>where
│ │ │ │ - Self: Sized,
Source§fn advance_by(&mut self, n: usize) -> Result<(), NonZero<usize>>
fn advance_by(&mut self, n: usize) -> Result<(), NonZero<usize>>
iter_advance_by
#77404)n
elements. Read more1.0.0 · Source§fn nth(&mut self, n: usize) -> Option<Self::Item>
fn nth(&mut self, n: usize) -> Option<Self::Item>
n
th element of the iterator. Read more1.28.0 · Source§fn step_by(self, step: usize) -> StepBy<Self>where
│ │ │ │ - Self: Sized,
fn step_by(self, step: usize) -> StepBy<Self>where
│ │ │ │ - Self: Sized,
1.0.0 · Source§fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>
fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>
1.0.0 · Source§fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>where
│ │ │ │ - Self: Sized,
│ │ │ │ - U: IntoIterator,
fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>where
│ │ │ │ - Self: Sized,
│ │ │ │ - U: IntoIterator,
Source§fn intersperse(self, separator: Self::Item) -> Intersperse<Self>
fn intersperse(self, separator: Self::Item) -> Intersperse<Self>
iter_intersperse
#79524)separator
between adjacent
│ │ │ │ -items of the original iterator. Read moreSource§fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G>
fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G>
iter_intersperse
#79524)separator
│ │ │ │ -between adjacent items of the original iterator. Read more1.0.0 · Source§fn map<B, F>(self, f: F) -> Map<Self, F>
fn map<B, F>(self, f: F) -> Map<Self, F>
1.0.0 · Source§fn filter<P>(self, predicate: P) -> Filter<Self, P>
fn filter<P>(self, predicate: P) -> Filter<Self, P>
1.0.0 · Source§fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>
fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>
1.0.0 · Source§fn enumerate(self) -> Enumerate<Self>where
│ │ │ │ - Self: Sized,
fn enumerate(self) -> Enumerate<Self>where
│ │ │ │ - Self: Sized,
1.0.0 · Source§fn peekable(self) -> Peekable<Self>where
│ │ │ │ - Self: Sized,
fn peekable(self) -> Peekable<Self>where
│ │ │ │ - Self: Sized,
peek
and peek_mut
methods
│ │ │ │ +) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>iter_next_chunk
#98326)N
values. Read more1.0.0 · Source§fn count(self) -> usizewhere
│ │ │ │ + Self: Sized,
fn count(self) -> usizewhere
│ │ │ │ + Self: Sized,
1.0.0 · Source§fn last(self) -> Option<Self::Item>where
│ │ │ │ + Self: Sized,
fn last(self) -> Option<Self::Item>where
│ │ │ │ + Self: Sized,
Source§fn advance_by(&mut self, n: usize) -> Result<(), NonZero<usize>>
fn advance_by(&mut self, n: usize) -> Result<(), NonZero<usize>>
iter_advance_by
#77404)n
elements. Read more1.0.0 · Source§fn nth(&mut self, n: usize) -> Option<Self::Item>
fn nth(&mut self, n: usize) -> Option<Self::Item>
n
th element of the iterator. Read more1.28.0 · Source§fn step_by(self, step: usize) -> StepBy<Self>where
│ │ │ │ + Self: Sized,
fn step_by(self, step: usize) -> StepBy<Self>where
│ │ │ │ + Self: Sized,
1.0.0 · Source§fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>
fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>
1.0.0 · Source§fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>where
│ │ │ │ + Self: Sized,
│ │ │ │ + U: IntoIterator,
fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>where
│ │ │ │ + Self: Sized,
│ │ │ │ + U: IntoIterator,
Source§fn intersperse(self, separator: Self::Item) -> Intersperse<Self>
fn intersperse(self, separator: Self::Item) -> Intersperse<Self>
iter_intersperse
#79524)separator
between adjacent
│ │ │ │ +items of the original iterator. Read moreSource§fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G>
fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G>
iter_intersperse
#79524)separator
│ │ │ │ +between adjacent items of the original iterator. Read more1.0.0 · Source§fn map<B, F>(self, f: F) -> Map<Self, F>
fn map<B, F>(self, f: F) -> Map<Self, F>
1.0.0 · Source§fn filter<P>(self, predicate: P) -> Filter<Self, P>
fn filter<P>(self, predicate: P) -> Filter<Self, P>
1.0.0 · Source§fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>
fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>
1.0.0 · Source§fn enumerate(self) -> Enumerate<Self>where
│ │ │ │ + Self: Sized,
fn enumerate(self) -> Enumerate<Self>where
│ │ │ │ + Self: Sized,
1.0.0 · Source§fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>
fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>
1.0.0 · Source§fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>
fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>
1.57.0 · Source§fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P>
fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P>
1.0.0 · Source§fn skip(self, n: usize) -> Skip<Self>where
│ │ │ │ - Self: Sized,
fn skip(self, n: usize) -> Skip<Self>where
│ │ │ │ - Self: Sized,
n
elements. Read more1.0.0 · Source§fn take(self, n: usize) -> Take<Self>where
│ │ │ │ - Self: Sized,
fn take(self, n: usize) -> Take<Self>where
│ │ │ │ - Self: Sized,
n
elements, or fewer
│ │ │ │ -if the underlying iterator ends sooner. Read more1.0.0 · Source§fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>
fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>
1.29.0 · Source§fn flatten(self) -> Flatten<Self>
fn flatten(self) -> Flatten<Self>
Source§fn map_windows<F, R, const N: usize>(self, f: F) -> MapWindows<Self, F, N>
fn map_windows<F, R, const N: usize>(self, f: F) -> MapWindows<Self, F, N>
iter_map_windows
#87155)f
for each contiguous window of size N
over
│ │ │ │ -self
and returns an iterator over the outputs of f
. Like slice::windows()
,
│ │ │ │ -the windows during mapping overlap as well. Read more1.0.0 · Source§fn inspect<F>(self, f: F) -> Inspect<Self, F>
fn inspect<F>(self, f: F) -> Inspect<Self, F>
1.0.0 · Source§fn by_ref(&mut self) -> &mut Selfwhere
│ │ │ │ - Self: Sized,
fn by_ref(&mut self) -> &mut Selfwhere
│ │ │ │ - Self: Sized,
Source§fn try_collect<B>(
│ │ │ │ +their documentation for more information. Read more
fn try_collect<B>( │ │ │ │ +their documentation for more information. Read more
1.0.0 · Source§fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>
fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>
1.0.0 · Source§fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>
fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>
1.57.0 · Source§fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P>
fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P>
1.0.0 · Source§fn skip(self, n: usize) -> Skip<Self>where
│ │ │ │ + Self: Sized,
fn skip(self, n: usize) -> Skip<Self>where
│ │ │ │ + Self: Sized,
n
elements. Read more1.0.0 · Source§fn take(self, n: usize) -> Take<Self>where
│ │ │ │ + Self: Sized,
fn take(self, n: usize) -> Take<Self>where
│ │ │ │ + Self: Sized,
n
elements, or fewer
│ │ │ │ +if the underlying iterator ends sooner. Read more1.0.0 · Source§fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>
fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>
1.29.0 · Source§fn flatten(self) -> Flatten<Self>
fn flatten(self) -> Flatten<Self>
Source§fn map_windows<F, R, const N: usize>(self, f: F) -> MapWindows<Self, F, N>
fn map_windows<F, R, const N: usize>(self, f: F) -> MapWindows<Self, F, N>
iter_map_windows
#87155)f
for each contiguous window of size N
over
│ │ │ │ +self
and returns an iterator over the outputs of f
. Like slice::windows()
,
│ │ │ │ +the windows during mapping overlap as well. Read more1.0.0 · Source§fn inspect<F>(self, f: F) -> Inspect<Self, F>
fn inspect<F>(self, f: F) -> Inspect<Self, F>
1.0.0 · Source§fn by_ref(&mut self) -> &mut Selfwhere
│ │ │ │ + Self: Sized,
fn by_ref(&mut self) -> &mut Selfwhere
│ │ │ │ + Self: Sized,
Source§fn try_collect<B>(
│ │ │ │ &mut self,
│ │ │ │ -) -> <<Self::Item as Try>::Residual as Residual<B>>::TryType
fn try_collect<B>( │ │ │ │ &mut self, │ │ │ │ -) -> <<Self::Item as Try>::Residual as Residual<B>>::TryType
iterator_try_collect
#94047)Source§fn collect_into<E>(self, collection: &mut E) -> &mut E
fn collect_into<E>(self, collection: &mut E) -> &mut E
iter_collect_into
#94780)1.0.0 · Source§fn partition<B, F>(self, f: F) -> (B, B)
fn partition<B, F>(self, f: F) -> (B, B)
Source§fn is_partitioned<P>(self, predicate: P) -> bool
fn is_partitioned<P>(self, predicate: P) -> bool
iter_is_partitioned
#62544)true
precede all those that return false
. Read more1.27.0 · Source§fn try_fold<B, F, R>(&mut self, init: B, f: F) -> R
fn try_fold<B, F, R>(&mut self, init: B, f: F) -> R
1.27.0 · Source§fn try_for_each<F, R>(&mut self, f: F) -> R
fn try_for_each<F, R>(&mut self, f: F) -> R
1.0.0 · Source§fn fold<B, F>(self, init: B, f: F) -> B
fn fold<B, F>(self, init: B, f: F) -> B
1.51.0 · Source§fn reduce<F>(self, f: F) -> Option<Self::Item>
fn reduce<F>(self, f: F) -> Option<Self::Item>
Source§fn try_reduce<R>(
│ │ │ │ +) -> <<Self::Item as Try>::Residual as Residual<B>>::TryType
fn try_reduce<R>( │ │ │ │ +) -> <<Self::Item as Try>::Residual as Residual<B>>::TryType
iterator_try_collect
#94047)Source§fn collect_into<E>(self, collection: &mut E) -> &mut E
fn collect_into<E>(self, collection: &mut E) -> &mut E
iter_collect_into
#94780)1.0.0 · Source§fn partition<B, F>(self, f: F) -> (B, B)
fn partition<B, F>(self, f: F) -> (B, B)
Source§fn is_partitioned<P>(self, predicate: P) -> bool
fn is_partitioned<P>(self, predicate: P) -> bool
iter_is_partitioned
#62544)true
precede all those that return false
. Read more1.27.0 · Source§fn try_fold<B, F, R>(&mut self, init: B, f: F) -> R
fn try_fold<B, F, R>(&mut self, init: B, f: F) -> R
1.27.0 · Source§fn try_for_each<F, R>(&mut self, f: F) -> R
fn try_for_each<F, R>(&mut self, f: F) -> R
1.0.0 · Source§fn fold<B, F>(self, init: B, f: F) -> B
fn fold<B, F>(self, init: B, f: F) -> B
1.51.0 · Source§fn reduce<F>(self, f: F) -> Option<Self::Item>
fn reduce<F>(self, f: F) -> Option<Self::Item>
Source§fn try_reduce<R>(
│ │ │ │ &mut self,
│ │ │ │ - f: impl FnMut(Self::Item, Self::Item) -> R,
│ │ │ │ -) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryType
fn try_reduce<R>( │ │ │ │ &mut self, │ │ │ │ - f: impl FnMut(Self::Item, Self::Item) -> R, │ │ │ │ -) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryType
iterator_try_reduce
#87053)1.0.0 · Source§fn all<F>(&mut self, f: F) -> bool
fn all<F>(&mut self, f: F) -> bool
1.0.0 · Source§fn any<F>(&mut self, f: F) -> bool
fn any<F>(&mut self, f: F) -> bool
1.0.0 · Source§fn find<P>(&mut self, predicate: P) -> Option<Self::Item>
fn find<P>(&mut self, predicate: P) -> Option<Self::Item>
1.30.0 · Source§fn find_map<B, F>(&mut self, f: F) -> Option<B>
fn find_map<B, F>(&mut self, f: F) -> Option<B>
Source§fn try_find<R>(
│ │ │ │ + f: impl FnMut(Self::Item, Self::Item) -> R,
│ │ │ │ +) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryType
fn try_find<R>( │ │ │ │ + f: impl FnMut(Self::Item, Self::Item) -> R, │ │ │ │ +) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryType
iterator_try_reduce
#87053)1.0.0 · Source§fn all<F>(&mut self, f: F) -> bool
fn all<F>(&mut self, f: F) -> bool
1.0.0 · Source§fn any<F>(&mut self, f: F) -> bool
fn any<F>(&mut self, f: F) -> bool
1.0.0 · Source§fn find<P>(&mut self, predicate: P) -> Option<Self::Item>
fn find<P>(&mut self, predicate: P) -> Option<Self::Item>
1.30.0 · Source§fn find_map<B, F>(&mut self, f: F) -> Option<B>
fn find_map<B, F>(&mut self, f: F) -> Option<B>
Source§fn try_find<R>(
│ │ │ │ &mut self,
│ │ │ │ - f: impl FnMut(&Self::Item) -> R,
│ │ │ │ -) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryType
fn try_find<R>( │ │ │ │ &mut self, │ │ │ │ - f: impl FnMut(&Self::Item) -> R, │ │ │ │ -) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryType
try_find
#63178)1.0.0 · Source§fn position<P>(&mut self, predicate: P) -> Option<usize>
fn position<P>(&mut self, predicate: P) -> Option<usize>
1.0.0 · Source§fn max(self) -> Option<Self::Item>
fn max(self) -> Option<Self::Item>
1.0.0 · Source§fn min(self) -> Option<Self::Item>
fn min(self) -> Option<Self::Item>
1.6.0 · Source§fn max_by_key<B, F>(self, f: F) -> Option<Self::Item>
fn max_by_key<B, F>(self, f: F) -> Option<Self::Item>
1.15.0 · Source§fn max_by<F>(self, compare: F) -> Option<Self::Item>
fn max_by<F>(self, compare: F) -> Option<Self::Item>
1.6.0 · Source§fn min_by_key<B, F>(self, f: F) -> Option<Self::Item>
fn min_by_key<B, F>(self, f: F) -> Option<Self::Item>
1.15.0 · Source§fn min_by<F>(self, compare: F) -> Option<Self::Item>
fn min_by<F>(self, compare: F) -> Option<Self::Item>
1.0.0 · Source§fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)
fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)
1.36.0 · Source§fn copied<'a, T>(self) -> Copied<Self>
fn copied<'a, T>(self) -> Copied<Self>
Source§fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N>where
│ │ │ │ - Self: Sized,
fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N>where
│ │ │ │ - Self: Sized,
iter_array_chunks
#100450)N
elements of the iterator at a time. Read more1.11.0 · Source§fn product<P>(self) -> P
fn product<P>(self) -> P
1.5.0 · Source§fn cmp<I>(self, other: I) -> Orderingwhere
│ │ │ │ - I: IntoIterator<Item = Self::Item>,
│ │ │ │ - Self::Item: Ord,
│ │ │ │ - Self: Sized,
fn cmp<I>(self, other: I) -> Orderingwhere
│ │ │ │ - I: IntoIterator<Item = Self::Item>,
│ │ │ │ - Self::Item: Ord,
│ │ │ │ - Self: Sized,
Source§fn cmp_by<I, F>(self, other: I, cmp: F) -> Orderingwhere
│ │ │ │ - Self: Sized,
│ │ │ │ - I: IntoIterator,
│ │ │ │ - F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Ordering,
fn cmp_by<I, F>(self, other: I, cmp: F) -> Orderingwhere
│ │ │ │ - Self: Sized,
│ │ │ │ - I: IntoIterator,
│ │ │ │ - F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Ordering,
iter_order_by
#64295)Iterator
with those
│ │ │ │ -of another with respect to the specified comparison function. Read more1.5.0 · Source§fn partial_cmp<I>(self, other: I) -> Option<Ordering>where
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
fn partial_cmp<I>(self, other: I) -> Option<Ordering>where
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
PartialOrd
elements of
│ │ │ │ -this Iterator
with those of another. The comparison works like short-circuit
│ │ │ │ + f: impl FnMut(&Self::Item) -> R,
│ │ │ │ +) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryTypetry_find
#63178)1.0.0 · Source§fn position<P>(&mut self, predicate: P) -> Option<usize>
fn position<P>(&mut self, predicate: P) -> Option<usize>
1.0.0 · Source§fn max(self) -> Option<Self::Item>
fn max(self) -> Option<Self::Item>
1.0.0 · Source§fn min(self) -> Option<Self::Item>
fn min(self) -> Option<Self::Item>
1.6.0 · Source§fn max_by_key<B, F>(self, f: F) -> Option<Self::Item>
fn max_by_key<B, F>(self, f: F) -> Option<Self::Item>
1.15.0 · Source§fn max_by<F>(self, compare: F) -> Option<Self::Item>
fn max_by<F>(self, compare: F) -> Option<Self::Item>
1.6.0 · Source§fn min_by_key<B, F>(self, f: F) -> Option<Self::Item>
fn min_by_key<B, F>(self, f: F) -> Option<Self::Item>
1.15.0 · Source§fn min_by<F>(self, compare: F) -> Option<Self::Item>
fn min_by<F>(self, compare: F) -> Option<Self::Item>
1.0.0 · Source§fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)
fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)
1.36.0 · Source§fn copied<'a, T>(self) -> Copied<Self>
fn copied<'a, T>(self) -> Copied<Self>
Source§fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N>where
│ │ │ │ + Self: Sized,
fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N>where
│ │ │ │ + Self: Sized,
iter_array_chunks
#100450)N
elements of the iterator at a time. Read more1.11.0 · Source§fn product<P>(self) -> P
fn product<P>(self) -> P
1.5.0 · Source§fn cmp<I>(self, other: I) -> Orderingwhere
│ │ │ │ + I: IntoIterator<Item = Self::Item>,
│ │ │ │ + Self::Item: Ord,
│ │ │ │ + Self: Sized,
fn cmp<I>(self, other: I) -> Orderingwhere
│ │ │ │ + I: IntoIterator<Item = Self::Item>,
│ │ │ │ + Self::Item: Ord,
│ │ │ │ + Self: Sized,
Source§fn cmp_by<I, F>(self, other: I, cmp: F) -> Orderingwhere
│ │ │ │ + Self: Sized,
│ │ │ │ + I: IntoIterator,
│ │ │ │ + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Ordering,
fn cmp_by<I, F>(self, other: I, cmp: F) -> Orderingwhere
│ │ │ │ + Self: Sized,
│ │ │ │ + I: IntoIterator,
│ │ │ │ + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Ordering,
iter_order_by
#64295)Iterator
with those
│ │ │ │ +of another with respect to the specified comparison function. Read more1.5.0 · Source§fn partial_cmp<I>(self, other: I) -> Option<Ordering>where
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
fn partial_cmp<I>(self, other: I) -> Option<Ordering>where
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
PartialOrd
elements of
│ │ │ │ +this Iterator
with those of another. The comparison works like short-circuit
│ │ │ │ evaluation, returning a result without comparing the remaining elements.
│ │ │ │ -As soon as an order can be determined, the evaluation stops and a result is returned. Read moreSource§fn partial_cmp_by<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering>where
│ │ │ │ - Self: Sized,
│ │ │ │ - I: IntoIterator,
│ │ │ │ - F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Option<Ordering>,
fn partial_cmp_by<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering>where
│ │ │ │ - Self: Sized,
│ │ │ │ - I: IntoIterator,
│ │ │ │ - F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Option<Ordering>,
iter_order_by
#64295)Iterator
with those
│ │ │ │ -of another with respect to the specified comparison function. Read more1.5.0 · Source§fn eq<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialEq<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
fn eq<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialEq<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
Source§fn eq_by<I, F>(self, other: I, eq: F) -> boolwhere
│ │ │ │ - Self: Sized,
│ │ │ │ - I: IntoIterator,
│ │ │ │ - F: FnMut(Self::Item, <I as IntoIterator>::Item) -> bool,
fn eq_by<I, F>(self, other: I, eq: F) -> boolwhere
│ │ │ │ - Self: Sized,
│ │ │ │ - I: IntoIterator,
│ │ │ │ - F: FnMut(Self::Item, <I as IntoIterator>::Item) -> bool,
iter_order_by
#64295)1.5.0 · Source§fn ne<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialEq<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
fn ne<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialEq<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
1.5.0 · Source§fn lt<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
fn lt<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
Iterator
are lexicographically
│ │ │ │ -less than those of another. Read more1.5.0 · Source§fn le<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
fn le<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
Iterator
are lexicographically
│ │ │ │ -less or equal to those of another. Read more1.5.0 · Source§fn gt<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
fn gt<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
Iterator
are lexicographically
│ │ │ │ -greater than those of another. Read more1.5.0 · Source§fn ge<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
fn ge<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
Iterator
are lexicographically
│ │ │ │ -greater than or equal to those of another. Read more1.82.0 · Source§fn is_sorted(self) -> bool
fn is_sorted(self) -> bool
1.82.0 · Source§fn is_sorted_by<F>(self, compare: F) -> bool
fn is_sorted_by<F>(self, compare: F) -> bool
1.82.0 · Source§fn is_sorted_by_key<F, K>(self, f: F) -> bool
fn is_sorted_by_key<F, K>(self, f: F) -> bool
impl<T: Ord, A: Allocator> FusedIterator for IntoIterSorted<T, A>
impl<T: Ord, A: Allocator> TrustedLen for IntoIterSorted<T, A>
Auto Trait Implementations§
impl<T, A> Freeze for IntoIterSorted<T, A>where
│ │ │ │ - A: Freeze,
impl<T, A> RefUnwindSafe for IntoIterSorted<T, A>where
│ │ │ │ - A: RefUnwindSafe,
│ │ │ │ - T: RefUnwindSafe,
impl<T, A> Send for IntoIterSorted<T, A>
impl<T, A> Sync for IntoIterSorted<T, A>
impl<T, A> Unpin for IntoIterSorted<T, A>
impl<T, A> UnwindSafe for IntoIterSorted<T, A>where
│ │ │ │ - A: UnwindSafe,
│ │ │ │ - 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
Source§impl<T> CloneToUninit for Twhere
│ │ │ │ - T: Clone,
impl<T> CloneToUninit for Twhere
│ │ │ │ - T: Clone,
Source§impl<T, U> Into<U> for Twhere
│ │ │ │ - U: From<T>,
impl<T, U> Into<U> for Twhere
│ │ │ │ - U: From<T>,
Source§fn into(self) -> U
fn into(self) -> U
Calls U::from(self)
.
Source§fn partial_cmp_by<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering>where
│ │ │ │ + Self: Sized,
│ │ │ │ + I: IntoIterator,
│ │ │ │ + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Option<Ordering>,
fn partial_cmp_by<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering>where
│ │ │ │ + Self: Sized,
│ │ │ │ + I: IntoIterator,
│ │ │ │ + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Option<Ordering>,
iter_order_by
#64295)Iterator
with those
│ │ │ │ +of another with respect to the specified comparison function. Read more1.5.0 · Source§fn eq<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialEq<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
fn eq<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialEq<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
Source§fn eq_by<I, F>(self, other: I, eq: F) -> boolwhere
│ │ │ │ + Self: Sized,
│ │ │ │ + I: IntoIterator,
│ │ │ │ + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> bool,
fn eq_by<I, F>(self, other: I, eq: F) -> boolwhere
│ │ │ │ + Self: Sized,
│ │ │ │ + I: IntoIterator,
│ │ │ │ + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> bool,
iter_order_by
#64295)1.5.0 · Source§fn ne<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialEq<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
fn ne<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialEq<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
1.5.0 · Source§fn lt<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
fn lt<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
Iterator
are lexicographically
│ │ │ │ +less than those of another. Read more1.5.0 · Source§fn le<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
fn le<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
Iterator
are lexicographically
│ │ │ │ +less or equal to those of another. Read more1.5.0 · Source§fn gt<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
fn gt<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
Iterator
are lexicographically
│ │ │ │ +greater than those of another. Read more1.5.0 · Source§fn ge<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
fn ge<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
Iterator
are lexicographically
│ │ │ │ +greater than or equal to those of another. Read more1.82.0 · Source§fn is_sorted(self) -> bool
fn is_sorted(self) -> bool
1.82.0 · Source§fn is_sorted_by<F>(self, compare: F) -> bool
fn is_sorted_by<F>(self, compare: F) -> bool
1.82.0 · Source§fn is_sorted_by_key<F, K>(self, f: F) -> bool
fn is_sorted_by_key<F, K>(self, f: F) -> bool
impl<T: Ord, A: Allocator> FusedIterator for IntoIterSorted<T, A>
impl<T: Ord, A: Allocator> TrustedLen for IntoIterSorted<T, A>
Auto Trait Implementations§
impl<T, A> Freeze for IntoIterSorted<T, A>where
│ │ │ │ + A: Freeze,
impl<T, A> RefUnwindSafe for IntoIterSorted<T, A>where
│ │ │ │ + A: RefUnwindSafe,
│ │ │ │ + T: RefUnwindSafe,
impl<T, A> Send for IntoIterSorted<T, A>
impl<T, A> Sync for IntoIterSorted<T, A>
impl<T, A> Unpin for IntoIterSorted<T, A>
impl<T, A> UnwindSafe for IntoIterSorted<T, A>where
│ │ │ │ + A: UnwindSafe,
│ │ │ │ + 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
Source§impl<T> CloneToUninit for Twhere
│ │ │ │ + T: Clone,
impl<T> CloneToUninit for Twhere
│ │ │ │ + T: Clone,
Source§impl<I> IntoIterator for Iwhere
│ │ │ │ - I: Iterator,
impl<I> IntoIterator for Iwhere
│ │ │ │ - I: Iterator,
From<T> for U
chooses to do.
│ │ │ │ +Source§impl<I> IntoIterator for Iwhere
│ │ │ │ + I: Iterator,
impl<I> IntoIterator for Iwhere
│ │ │ │ + I: Iterator,
pub struct Iter<'a, T: 'a> { /* private fields */ }
Expand description
An iterator over the elements of a BinaryHeap
.
This struct
is created by BinaryHeap::iter()
. See its
│ │ │ │ documentation for more.
Trait Implementations§
1.82.0 · Source§impl<T> Default for Iter<'_, T>
impl<T> Default for Iter<'_, T>
Trait Implementations§
1.0.0 · Source§impl<'a, T> DoubleEndedIterator for Iter<'a, T>
impl<'a, T> DoubleEndedIterator for Iter<'a, T>
Source§fn next_back(&mut self) -> Option<&'a T>
fn next_back(&mut self) -> Option<&'a T>
Source§fn advance_back_by(&mut self, n: usize) -> Result<(), NonZero<usize>>
fn advance_back_by(&mut self, n: usize) -> Result<(), NonZero<usize>>
iter_advance_by
#77404)n
elements. Read more1.37.0 · Source§fn nth_back(&mut self, n: usize) -> Option<Self::Item>
fn nth_back(&mut self, n: usize) -> Option<Self::Item>
n
th element from the end of the iterator. Read more1.27.0 · Source§fn try_rfold<B, F, R>(&mut self, init: B, f: F) -> R
fn try_rfold<B, F, R>(&mut self, init: B, f: F) -> R
Iterator::try_fold()
: it takes
│ │ │ │ -elements starting from the back of the iterator. Read more1.0.0 · Source§impl<T> ExactSizeIterator for Iter<'_, T>
impl<T> ExactSizeIterator for Iter<'_, T>
1.0.0 · Source§impl<'a, T> Iterator for Iter<'a, T>
impl<'a, T> Iterator for Iter<'a, T>
1.0.0 · Source§impl<'a, T> DoubleEndedIterator for Iter<'a, T>
impl<'a, T> DoubleEndedIterator for Iter<'a, T>
Source§fn next_back(&mut self) -> Option<&'a T>
fn next_back(&mut self) -> Option<&'a T>
Source§fn advance_back_by(&mut self, n: usize) -> Result<(), NonZero<usize>>
fn advance_back_by(&mut self, n: usize) -> Result<(), NonZero<usize>>
iter_advance_by
#77404)n
elements. Read more1.37.0 · Source§fn nth_back(&mut self, n: usize) -> Option<Self::Item>
fn nth_back(&mut self, n: usize) -> Option<Self::Item>
n
th element from the end of the iterator. Read more1.27.0 · Source§fn try_rfold<B, F, R>(&mut self, init: B, f: F) -> R
fn try_rfold<B, F, R>(&mut self, init: B, f: F) -> R
Iterator::try_fold()
: it takes
│ │ │ │ +elements starting from the back of the iterator. Read more1.0.0 · Source§impl<T> ExactSizeIterator for Iter<'_, T>
impl<T> ExactSizeIterator for Iter<'_, T>
1.0.0 · Source§impl<'a, T> Iterator for Iter<'a, T>
impl<'a, T> Iterator for Iter<'a, T>
Source§fn next(&mut self) -> Option<&'a T>
fn next(&mut self) -> Option<&'a T>
Source§fn size_hint(&self) -> (usize, Option<usize>)
fn size_hint(&self) -> (usize, Option<usize>)
Source§fn next_chunk<const N: usize>(
│ │ │ │ &mut self,
│ │ │ │ -) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>where
│ │ │ │ - Self: Sized,
fn next_chunk<const N: usize>(
│ │ │ │ &mut self,
│ │ │ │ -) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>where
│ │ │ │ - Self: Sized,
iter_next_chunk
#98326)N
values. Read more1.0.0 · Source§fn count(self) -> usizewhere
│ │ │ │ - Self: Sized,
fn count(self) -> usizewhere
│ │ │ │ - Self: Sized,
Source§fn advance_by(&mut self, n: usize) -> Result<(), NonZero<usize>>
fn advance_by(&mut self, n: usize) -> Result<(), NonZero<usize>>
iter_advance_by
#77404)n
elements. Read more1.0.0 · Source§fn nth(&mut self, n: usize) -> Option<Self::Item>
fn nth(&mut self, n: usize) -> Option<Self::Item>
n
th element of the iterator. Read more1.28.0 · Source§fn step_by(self, step: usize) -> StepBy<Self>where
│ │ │ │ - Self: Sized,
fn step_by(self, step: usize) -> StepBy<Self>where
│ │ │ │ - Self: Sized,
1.0.0 · Source§fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>
fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>
1.0.0 · Source§fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>where
│ │ │ │ - Self: Sized,
│ │ │ │ - U: IntoIterator,
fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>where
│ │ │ │ - Self: Sized,
│ │ │ │ - U: IntoIterator,
Source§fn intersperse(self, separator: Self::Item) -> Intersperse<Self>
fn intersperse(self, separator: Self::Item) -> Intersperse<Self>
iter_intersperse
#79524)separator
between adjacent
│ │ │ │ -items of the original iterator. Read moreSource§fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G>
fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G>
iter_intersperse
#79524)separator
│ │ │ │ -between adjacent items of the original iterator. Read more1.0.0 · Source§fn map<B, F>(self, f: F) -> Map<Self, F>
fn map<B, F>(self, f: F) -> Map<Self, F>
1.0.0 · Source§fn filter<P>(self, predicate: P) -> Filter<Self, P>
fn filter<P>(self, predicate: P) -> Filter<Self, P>
1.0.0 · Source§fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>
fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>
1.0.0 · Source§fn enumerate(self) -> Enumerate<Self>where
│ │ │ │ - Self: Sized,
fn enumerate(self) -> Enumerate<Self>where
│ │ │ │ - Self: Sized,
1.0.0 · Source§fn peekable(self) -> Peekable<Self>where
│ │ │ │ - Self: Sized,
fn peekable(self) -> Peekable<Self>where
│ │ │ │ - Self: Sized,
peek
and peek_mut
methods
│ │ │ │ +) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>iter_next_chunk
#98326)N
values. Read more1.0.0 · Source§fn count(self) -> usizewhere
│ │ │ │ + Self: Sized,
fn count(self) -> usizewhere
│ │ │ │ + Self: Sized,
Source§fn advance_by(&mut self, n: usize) -> Result<(), NonZero<usize>>
fn advance_by(&mut self, n: usize) -> Result<(), NonZero<usize>>
iter_advance_by
#77404)n
elements. Read more1.0.0 · Source§fn nth(&mut self, n: usize) -> Option<Self::Item>
fn nth(&mut self, n: usize) -> Option<Self::Item>
n
th element of the iterator. Read more1.28.0 · Source§fn step_by(self, step: usize) -> StepBy<Self>where
│ │ │ │ + Self: Sized,
fn step_by(self, step: usize) -> StepBy<Self>where
│ │ │ │ + Self: Sized,
1.0.0 · Source§fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>
fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>
1.0.0 · Source§fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>where
│ │ │ │ + Self: Sized,
│ │ │ │ + U: IntoIterator,
fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>where
│ │ │ │ + Self: Sized,
│ │ │ │ + U: IntoIterator,
Source§fn intersperse(self, separator: Self::Item) -> Intersperse<Self>
fn intersperse(self, separator: Self::Item) -> Intersperse<Self>
iter_intersperse
#79524)separator
between adjacent
│ │ │ │ +items of the original iterator. Read moreSource§fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G>
fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G>
iter_intersperse
#79524)separator
│ │ │ │ +between adjacent items of the original iterator. Read more1.0.0 · Source§fn map<B, F>(self, f: F) -> Map<Self, F>
fn map<B, F>(self, f: F) -> Map<Self, F>
1.0.0 · Source§fn filter<P>(self, predicate: P) -> Filter<Self, P>
fn filter<P>(self, predicate: P) -> Filter<Self, P>
1.0.0 · Source§fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>
fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>
1.0.0 · Source§fn enumerate(self) -> Enumerate<Self>where
│ │ │ │ + Self: Sized,
fn enumerate(self) -> Enumerate<Self>where
│ │ │ │ + Self: Sized,
1.0.0 · Source§fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>
fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>
1.0.0 · Source§fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>
fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>
1.57.0 · Source§fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P>
fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P>
1.0.0 · Source§fn skip(self, n: usize) -> Skip<Self>where
│ │ │ │ - Self: Sized,
fn skip(self, n: usize) -> Skip<Self>where
│ │ │ │ - Self: Sized,
n
elements. Read more1.0.0 · Source§fn take(self, n: usize) -> Take<Self>where
│ │ │ │ - Self: Sized,
fn take(self, n: usize) -> Take<Self>where
│ │ │ │ - Self: Sized,
n
elements, or fewer
│ │ │ │ -if the underlying iterator ends sooner. Read more1.0.0 · Source§fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>
fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>
1.29.0 · Source§fn flatten(self) -> Flatten<Self>
fn flatten(self) -> Flatten<Self>
Source§fn map_windows<F, R, const N: usize>(self, f: F) -> MapWindows<Self, F, N>
fn map_windows<F, R, const N: usize>(self, f: F) -> MapWindows<Self, F, N>
iter_map_windows
#87155)f
for each contiguous window of size N
over
│ │ │ │ -self
and returns an iterator over the outputs of f
. Like slice::windows()
,
│ │ │ │ -the windows during mapping overlap as well. Read more1.0.0 · Source§fn inspect<F>(self, f: F) -> Inspect<Self, F>
fn inspect<F>(self, f: F) -> Inspect<Self, F>
1.0.0 · Source§fn by_ref(&mut self) -> &mut Selfwhere
│ │ │ │ - Self: Sized,
fn by_ref(&mut self) -> &mut Selfwhere
│ │ │ │ - Self: Sized,
Source§fn try_collect<B>(
│ │ │ │ +their documentation for more information. Read more
fn try_collect<B>( │ │ │ │ +their documentation for more information. Read more
1.0.0 · Source§fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>
fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>
1.0.0 · Source§fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>
fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>
1.57.0 · Source§fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P>
fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P>
1.0.0 · Source§fn skip(self, n: usize) -> Skip<Self>where
│ │ │ │ + Self: Sized,
fn skip(self, n: usize) -> Skip<Self>where
│ │ │ │ + Self: Sized,
n
elements. Read more1.0.0 · Source§fn take(self, n: usize) -> Take<Self>where
│ │ │ │ + Self: Sized,
fn take(self, n: usize) -> Take<Self>where
│ │ │ │ + Self: Sized,
n
elements, or fewer
│ │ │ │ +if the underlying iterator ends sooner. Read more1.0.0 · Source§fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>
fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>
1.29.0 · Source§fn flatten(self) -> Flatten<Self>
fn flatten(self) -> Flatten<Self>
Source§fn map_windows<F, R, const N: usize>(self, f: F) -> MapWindows<Self, F, N>
fn map_windows<F, R, const N: usize>(self, f: F) -> MapWindows<Self, F, N>
iter_map_windows
#87155)f
for each contiguous window of size N
over
│ │ │ │ +self
and returns an iterator over the outputs of f
. Like slice::windows()
,
│ │ │ │ +the windows during mapping overlap as well. Read more1.0.0 · Source§fn inspect<F>(self, f: F) -> Inspect<Self, F>
fn inspect<F>(self, f: F) -> Inspect<Self, F>
1.0.0 · Source§fn by_ref(&mut self) -> &mut Selfwhere
│ │ │ │ + Self: Sized,
fn by_ref(&mut self) -> &mut Selfwhere
│ │ │ │ + Self: Sized,
Source§fn try_collect<B>(
│ │ │ │ &mut self,
│ │ │ │ -) -> <<Self::Item as Try>::Residual as Residual<B>>::TryType
fn try_collect<B>( │ │ │ │ &mut self, │ │ │ │ -) -> <<Self::Item as Try>::Residual as Residual<B>>::TryType
iterator_try_collect
#94047)Source§fn collect_into<E>(self, collection: &mut E) -> &mut E
fn collect_into<E>(self, collection: &mut E) -> &mut E
iter_collect_into
#94780)1.0.0 · Source§fn partition<B, F>(self, f: F) -> (B, B)
fn partition<B, F>(self, f: F) -> (B, B)
Source§fn partition_in_place<'a, T, P>(self, predicate: P) -> usizewhere
│ │ │ │ +) -> <<Self::Item as Try>::Residual as Residual<B>>::TryTypewhere
│ │ │ │ + Self: Sized,
│ │ │ │ + Self::Item: Try,
│ │ │ │ + <Self::Item as Try>::Residual: Residual<B>,
│ │ │ │ + B: FromIterator<<Self::Item as Try>::Output>,🔬This is a nightly-only experimental API. (iterator_try_collect
#94047)Fallibly transforms an iterator into a collection, short circuiting if
│ │ │ │ +a failure is encountered. Read moreSource§fn collect_into<E>(self, collection: &mut E) -> &mut E
🔬This is a nightly-only experimental API. (iter_collect_into
#94780)Collects all the items from an iterator into a collection. Read more1.0.0 · Source§fn partition<B, F>(self, f: F) -> (B, B)
Consumes an iterator, creating two collections from it. Read moreSource§fn partition_in_place<'a, T, P>(self, predicate: P) -> usize
🔬This is a nightly-only experimental API. (iter_partition_in_place
#62543)Reorders the elements of this iterator in-place according to the given predicate,
│ │ │ │ + Self: Sized + DoubleEndedIterator<Item = &'a mut T>,
│ │ │ │ + P: FnMut(&T) -> bool,🔬This is a nightly-only experimental API. (iter_partition_in_place
#62543)Reorders the elements of this iterator in-place according to the given predicate,
│ │ │ │ such that all those that return true
precede all those that return false
.
│ │ │ │ -Returns the number of true
elements found. Read moreSource§fn is_partitioned<P>(self, predicate: P) -> bool
🔬This is a nightly-only experimental API. (iter_is_partitioned
#62544)Checks if the elements of this iterator are partitioned according to the given predicate,
│ │ │ │ -such that all those that return true
precede all those that return false
. Read more1.27.0 · Source§fn try_fold<B, F, R>(&mut self, init: B, f: F) -> R
An iterator method that applies a function as long as it returns
│ │ │ │ -successfully, producing a single, final value. Read more1.27.0 · Source§fn try_for_each<F, R>(&mut self, f: F) -> R
An iterator method that applies a fallible function to each item in the
│ │ │ │ -iterator, stopping at the first error and returning that error. Read more1.0.0 · Source§fn fold<B, F>(self, init: B, f: F) -> B
Folds every element into an accumulator by applying an operation,
│ │ │ │ -returning the final result. Read more1.51.0 · Source§fn reduce<F>(self, f: F) -> Option<Self::Item>
Reduces the elements to a single one, by repeatedly applying a reducing
│ │ │ │ -operation. Read moreSource§fn try_reduce<R>(
│ │ │ │ +Returns the number of true
elements found. Read more
fn partition_in_place<'a, T, P>(self, predicate: P) -> usizewhere
│ │ │ │ +) -> <<Self::Item as Try>::Residual as Residual<B>>::TryTypewhere
│ │ │ │ + Self: Sized,
│ │ │ │ + Self::Item: Try,
│ │ │ │ + <Self::Item as Try>::Residual: Residual<B>,
│ │ │ │ + B: FromIterator<<Self::Item as Try>::Output>,🔬This is a nightly-only experimental API. (iterator_try_collect
#94047)Fallibly transforms an iterator into a collection, short circuiting if
│ │ │ │ +a failure is encountered. Read moreSource§fn collect_into<E>(self, collection: &mut E) -> &mut E
🔬This is a nightly-only experimental API. (iter_collect_into
#94780)Collects all the items from an iterator into a collection. Read more1.0.0 · Source§fn partition<B, F>(self, f: F) -> (B, B)
Consumes an iterator, creating two collections from it. Read moreSource§fn partition_in_place<'a, T, P>(self, predicate: P) -> usize
🔬This is a nightly-only experimental API. (iter_partition_in_place
#62543)Reorders the elements of this iterator in-place according to the given predicate,
│ │ │ │ + Self: Sized + DoubleEndedIterator<Item = &'a mut T>,
│ │ │ │ + P: FnMut(&T) -> bool,🔬This is a nightly-only experimental API. (iter_partition_in_place
#62543)Reorders the elements of this iterator in-place according to the given predicate,
│ │ │ │ such that all those that return true
precede all those that return false
.
│ │ │ │ -Returns the number of true
elements found. Read moreSource§fn is_partitioned<P>(self, predicate: P) -> bool
🔬This is a nightly-only experimental API. (iter_is_partitioned
#62544)Checks if the elements of this iterator are partitioned according to the given predicate,
│ │ │ │ -such that all those that return true
precede all those that return false
. Read more1.27.0 · Source§fn try_fold<B, F, R>(&mut self, init: B, f: F) -> R
An iterator method that applies a function as long as it returns
│ │ │ │ -successfully, producing a single, final value. Read more1.27.0 · Source§fn try_for_each<F, R>(&mut self, f: F) -> R
An iterator method that applies a fallible function to each item in the
│ │ │ │ -iterator, stopping at the first error and returning that error. Read more1.0.0 · Source§fn fold<B, F>(self, init: B, f: F) -> B
Folds every element into an accumulator by applying an operation,
│ │ │ │ -returning the final result. Read more1.51.0 · Source§fn reduce<F>(self, f: F) -> Option<Self::Item>
Reduces the elements to a single one, by repeatedly applying a reducing
│ │ │ │ -operation. Read moreSource§fn try_reduce<R>(
│ │ │ │ +Returns the number of true
elements found. Read more
iterator_try_collect
#94047)Source§fn collect_into<E>(self, collection: &mut E) -> &mut E
fn collect_into<E>(self, collection: &mut E) -> &mut E
iter_collect_into
#94780)1.0.0 · Source§fn partition<B, F>(self, f: F) -> (B, B)
fn partition<B, F>(self, f: F) -> (B, B)
Source§fn partition_in_place<'a, T, P>(self, predicate: P) -> usize
fn partition_in_place<'a, T, P>(self, predicate: P) -> usize
iter_partition_in_place
#62543)iter_partition_in_place
#62543)true
precede all those that return false
.
│ │ │ │ -Returns the number of true
elements found. Read moreSource§fn is_partitioned<P>(self, predicate: P) -> bool
fn is_partitioned<P>(self, predicate: P) -> bool
iter_is_partitioned
#62544)true
precede all those that return false
. Read more1.27.0 · Source§fn try_fold<B, F, R>(&mut self, init: B, f: F) -> R
fn try_fold<B, F, R>(&mut self, init: B, f: F) -> R
1.27.0 · Source§fn try_for_each<F, R>(&mut self, f: F) -> R
fn try_for_each<F, R>(&mut self, f: F) -> R
1.0.0 · Source§fn fold<B, F>(self, init: B, f: F) -> B
fn fold<B, F>(self, init: B, f: F) -> B
1.51.0 · Source§fn reduce<F>(self, f: F) -> Option<Self::Item>
fn reduce<F>(self, f: F) -> Option<Self::Item>
Source§fn try_reduce<R>(
│ │ │ │ +Returns the number of true
elements found. Read more
fn try_reduce<R>(
│ │ │ │ +Returns the number of true
elements found. Read more
Source§fn is_partitioned<P>(self, predicate: P) -> bool
fn is_partitioned<P>(self, predicate: P) -> bool
iter_is_partitioned
#62544)true
precede all those that return false
. Read more1.27.0 · Source§fn try_fold<B, F, R>(&mut self, init: B, f: F) -> R
fn try_fold<B, F, R>(&mut self, init: B, f: F) -> R
1.27.0 · Source§fn try_for_each<F, R>(&mut self, f: F) -> R
fn try_for_each<F, R>(&mut self, f: F) -> R
1.0.0 · Source§fn fold<B, F>(self, init: B, f: F) -> B
fn fold<B, F>(self, init: B, f: F) -> B
1.51.0 · Source§fn reduce<F>(self, f: F) -> Option<Self::Item>
fn reduce<F>(self, f: F) -> Option<Self::Item>
Source§fn try_reduce<R>(
│ │ │ │ &mut self,
│ │ │ │ - f: impl FnMut(Self::Item, Self::Item) -> R,
│ │ │ │ -) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryType
fn try_reduce<R>( │ │ │ │ &mut self, │ │ │ │ - f: impl FnMut(Self::Item, Self::Item) -> R, │ │ │ │ -) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryType
iterator_try_reduce
#87053)1.0.0 · Source§fn all<F>(&mut self, f: F) -> bool
fn all<F>(&mut self, f: F) -> bool
1.0.0 · Source§fn any<F>(&mut self, f: F) -> bool
fn any<F>(&mut self, f: F) -> bool
1.0.0 · Source§fn find<P>(&mut self, predicate: P) -> Option<Self::Item>
fn find<P>(&mut self, predicate: P) -> Option<Self::Item>
1.30.0 · Source§fn find_map<B, F>(&mut self, f: F) -> Option<B>
fn find_map<B, F>(&mut self, f: F) -> Option<B>
Source§fn try_find<R>(
│ │ │ │ + f: impl FnMut(Self::Item, Self::Item) -> R,
│ │ │ │ +) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryType
fn try_find<R>( │ │ │ │ + f: impl FnMut(Self::Item, Self::Item) -> R, │ │ │ │ +) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryType
iterator_try_reduce
#87053)1.0.0 · Source§fn all<F>(&mut self, f: F) -> bool
fn all<F>(&mut self, f: F) -> bool
1.0.0 · Source§fn any<F>(&mut self, f: F) -> bool
fn any<F>(&mut self, f: F) -> bool
1.0.0 · Source§fn find<P>(&mut self, predicate: P) -> Option<Self::Item>
fn find<P>(&mut self, predicate: P) -> Option<Self::Item>
1.30.0 · Source§fn find_map<B, F>(&mut self, f: F) -> Option<B>
fn find_map<B, F>(&mut self, f: F) -> Option<B>
Source§fn try_find<R>(
│ │ │ │ &mut self,
│ │ │ │ - f: impl FnMut(&Self::Item) -> R,
│ │ │ │ -) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryType
fn try_find<R>( │ │ │ │ &mut self, │ │ │ │ - f: impl FnMut(&Self::Item) -> R, │ │ │ │ -) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryType
try_find
#63178)1.0.0 · Source§fn position<P>(&mut self, predicate: P) -> Option<usize>
fn position<P>(&mut self, predicate: P) -> Option<usize>
1.0.0 · Source§fn rposition<P>(&mut self, predicate: P) -> Option<usize>where
│ │ │ │ - P: FnMut(Self::Item) -> bool,
│ │ │ │ - Self: Sized + ExactSizeIterator + DoubleEndedIterator,
fn rposition<P>(&mut self, predicate: P) -> Option<usize>where
│ │ │ │ - P: FnMut(Self::Item) -> bool,
│ │ │ │ - Self: Sized + ExactSizeIterator + DoubleEndedIterator,
1.0.0 · Source§fn max(self) -> Option<Self::Item>
fn max(self) -> Option<Self::Item>
1.0.0 · Source§fn min(self) -> Option<Self::Item>
fn min(self) -> Option<Self::Item>
1.6.0 · Source§fn max_by_key<B, F>(self, f: F) -> Option<Self::Item>
fn max_by_key<B, F>(self, f: F) -> Option<Self::Item>
1.15.0 · Source§fn max_by<F>(self, compare: F) -> Option<Self::Item>
fn max_by<F>(self, compare: F) -> Option<Self::Item>
1.6.0 · Source§fn min_by_key<B, F>(self, f: F) -> Option<Self::Item>
fn min_by_key<B, F>(self, f: F) -> Option<Self::Item>
1.15.0 · Source§fn min_by<F>(self, compare: F) -> Option<Self::Item>
fn min_by<F>(self, compare: F) -> Option<Self::Item>
1.0.0 · Source§fn rev(self) -> Rev<Self>where
│ │ │ │ - Self: Sized + DoubleEndedIterator,
fn rev(self) -> Rev<Self>where
│ │ │ │ - Self: Sized + DoubleEndedIterator,
1.0.0 · Source§fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)
fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)
1.36.0 · Source§fn copied<'a, T>(self) -> Copied<Self>
fn copied<'a, T>(self) -> Copied<Self>
Source§fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N>where
│ │ │ │ - Self: Sized,
fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N>where
│ │ │ │ - Self: Sized,
iter_array_chunks
#100450)N
elements of the iterator at a time. Read more1.11.0 · Source§fn product<P>(self) -> P
fn product<P>(self) -> P
1.5.0 · Source§fn cmp<I>(self, other: I) -> Orderingwhere
│ │ │ │ - I: IntoIterator<Item = Self::Item>,
│ │ │ │ - Self::Item: Ord,
│ │ │ │ - Self: Sized,
fn cmp<I>(self, other: I) -> Orderingwhere
│ │ │ │ - I: IntoIterator<Item = Self::Item>,
│ │ │ │ - Self::Item: Ord,
│ │ │ │ - Self: Sized,
Source§fn cmp_by<I, F>(self, other: I, cmp: F) -> Orderingwhere
│ │ │ │ - Self: Sized,
│ │ │ │ - I: IntoIterator,
│ │ │ │ - F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Ordering,
fn cmp_by<I, F>(self, other: I, cmp: F) -> Orderingwhere
│ │ │ │ - Self: Sized,
│ │ │ │ - I: IntoIterator,
│ │ │ │ - F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Ordering,
iter_order_by
#64295)Iterator
with those
│ │ │ │ -of another with respect to the specified comparison function. Read more1.5.0 · Source§fn partial_cmp<I>(self, other: I) -> Option<Ordering>where
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
fn partial_cmp<I>(self, other: I) -> Option<Ordering>where
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
PartialOrd
elements of
│ │ │ │ -this Iterator
with those of another. The comparison works like short-circuit
│ │ │ │ + f: impl FnMut(&Self::Item) -> R,
│ │ │ │ +) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryTypetry_find
#63178)1.0.0 · Source§fn position<P>(&mut self, predicate: P) -> Option<usize>
fn position<P>(&mut self, predicate: P) -> Option<usize>
1.0.0 · Source§fn rposition<P>(&mut self, predicate: P) -> Option<usize>where
│ │ │ │ + P: FnMut(Self::Item) -> bool,
│ │ │ │ + Self: Sized + ExactSizeIterator + DoubleEndedIterator,
fn rposition<P>(&mut self, predicate: P) -> Option<usize>where
│ │ │ │ + P: FnMut(Self::Item) -> bool,
│ │ │ │ + Self: Sized + ExactSizeIterator + DoubleEndedIterator,
1.0.0 · Source§fn max(self) -> Option<Self::Item>
fn max(self) -> Option<Self::Item>
1.0.0 · Source§fn min(self) -> Option<Self::Item>
fn min(self) -> Option<Self::Item>
1.6.0 · Source§fn max_by_key<B, F>(self, f: F) -> Option<Self::Item>
fn max_by_key<B, F>(self, f: F) -> Option<Self::Item>
1.15.0 · Source§fn max_by<F>(self, compare: F) -> Option<Self::Item>
fn max_by<F>(self, compare: F) -> Option<Self::Item>
1.6.0 · Source§fn min_by_key<B, F>(self, f: F) -> Option<Self::Item>
fn min_by_key<B, F>(self, f: F) -> Option<Self::Item>
1.15.0 · Source§fn min_by<F>(self, compare: F) -> Option<Self::Item>
fn min_by<F>(self, compare: F) -> Option<Self::Item>
1.0.0 · Source§fn rev(self) -> Rev<Self>where
│ │ │ │ + Self: Sized + DoubleEndedIterator,
fn rev(self) -> Rev<Self>where
│ │ │ │ + Self: Sized + DoubleEndedIterator,
1.0.0 · Source§fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)
fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)
1.36.0 · Source§fn copied<'a, T>(self) -> Copied<Self>
fn copied<'a, T>(self) -> Copied<Self>
Source§fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N>where
│ │ │ │ + Self: Sized,
fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N>where
│ │ │ │ + Self: Sized,
iter_array_chunks
#100450)N
elements of the iterator at a time. Read more1.11.0 · Source§fn product<P>(self) -> P
fn product<P>(self) -> P
1.5.0 · Source§fn cmp<I>(self, other: I) -> Orderingwhere
│ │ │ │ + I: IntoIterator<Item = Self::Item>,
│ │ │ │ + Self::Item: Ord,
│ │ │ │ + Self: Sized,
fn cmp<I>(self, other: I) -> Orderingwhere
│ │ │ │ + I: IntoIterator<Item = Self::Item>,
│ │ │ │ + Self::Item: Ord,
│ │ │ │ + Self: Sized,
Source§fn cmp_by<I, F>(self, other: I, cmp: F) -> Orderingwhere
│ │ │ │ + Self: Sized,
│ │ │ │ + I: IntoIterator,
│ │ │ │ + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Ordering,
fn cmp_by<I, F>(self, other: I, cmp: F) -> Orderingwhere
│ │ │ │ + Self: Sized,
│ │ │ │ + I: IntoIterator,
│ │ │ │ + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Ordering,
iter_order_by
#64295)Iterator
with those
│ │ │ │ +of another with respect to the specified comparison function. Read more1.5.0 · Source§fn partial_cmp<I>(self, other: I) -> Option<Ordering>where
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
fn partial_cmp<I>(self, other: I) -> Option<Ordering>where
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
PartialOrd
elements of
│ │ │ │ +this Iterator
with those of another. The comparison works like short-circuit
│ │ │ │ evaluation, returning a result without comparing the remaining elements.
│ │ │ │ -As soon as an order can be determined, the evaluation stops and a result is returned. Read moreSource§fn partial_cmp_by<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering>where
│ │ │ │ - Self: Sized,
│ │ │ │ - I: IntoIterator,
│ │ │ │ - F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Option<Ordering>,
fn partial_cmp_by<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering>where
│ │ │ │ - Self: Sized,
│ │ │ │ - I: IntoIterator,
│ │ │ │ - F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Option<Ordering>,
iter_order_by
#64295)Iterator
with those
│ │ │ │ -of another with respect to the specified comparison function. Read more1.5.0 · Source§fn eq<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialEq<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
fn eq<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialEq<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
Source§fn eq_by<I, F>(self, other: I, eq: F) -> boolwhere
│ │ │ │ - Self: Sized,
│ │ │ │ - I: IntoIterator,
│ │ │ │ - F: FnMut(Self::Item, <I as IntoIterator>::Item) -> bool,
fn eq_by<I, F>(self, other: I, eq: F) -> boolwhere
│ │ │ │ - Self: Sized,
│ │ │ │ - I: IntoIterator,
│ │ │ │ - F: FnMut(Self::Item, <I as IntoIterator>::Item) -> bool,
iter_order_by
#64295)1.5.0 · Source§fn ne<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialEq<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
fn ne<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialEq<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
1.5.0 · Source§fn lt<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
fn lt<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
Iterator
are lexicographically
│ │ │ │ -less than those of another. Read more1.5.0 · Source§fn le<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
fn le<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
Iterator
are lexicographically
│ │ │ │ -less or equal to those of another. Read more1.5.0 · Source§fn gt<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
fn gt<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
Iterator
are lexicographically
│ │ │ │ -greater than those of another. Read more1.5.0 · Source§fn ge<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
fn ge<I>(self, other: I) -> boolwhere
│ │ │ │ - I: IntoIterator,
│ │ │ │ - Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ - Self: Sized,
Iterator
are lexicographically
│ │ │ │ -greater than or equal to those of another. Read more1.82.0 · Source§fn is_sorted(self) -> bool
fn is_sorted(self) -> bool
1.82.0 · Source§fn is_sorted_by<F>(self, compare: F) -> bool
fn is_sorted_by<F>(self, compare: F) -> bool
1.82.0 · Source§fn is_sorted_by_key<F, K>(self, f: F) -> bool
fn is_sorted_by_key<F, K>(self, f: F) -> bool
impl<T> FusedIterator for Iter<'_, T>
Auto Trait Implementations§
impl<'a, T> Freeze for Iter<'a, T>
impl<'a, T> RefUnwindSafe for Iter<'a, T>where
│ │ │ │ - T: RefUnwindSafe,
impl<'a, T> Send for Iter<'a, T>where
│ │ │ │ - T: Sync,
impl<'a, T> Sync for Iter<'a, T>where
│ │ │ │ - T: Sync,
impl<'a, T> Unpin for Iter<'a, T>
impl<'a, T> UnwindSafe for Iter<'a, T>where
│ │ │ │ - T: RefUnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
│ │ │ │ - T: Clone,
impl<T> CloneToUninit for Twhere
│ │ │ │ - T: Clone,
Source§impl<T, U> Into<U> for Twhere
│ │ │ │ - U: From<T>,
impl<T, U> Into<U> for Twhere
│ │ │ │ - U: From<T>,
Source§fn into(self) -> U
fn into(self) -> U
Calls U::from(self)
.
Source§fn partial_cmp_by<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering>where
│ │ │ │ + Self: Sized,
│ │ │ │ + I: IntoIterator,
│ │ │ │ + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Option<Ordering>,
fn partial_cmp_by<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering>where
│ │ │ │ + Self: Sized,
│ │ │ │ + I: IntoIterator,
│ │ │ │ + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Option<Ordering>,
iter_order_by
#64295)Iterator
with those
│ │ │ │ +of another with respect to the specified comparison function. Read more1.5.0 · Source§fn eq<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialEq<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
fn eq<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialEq<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
Source§fn eq_by<I, F>(self, other: I, eq: F) -> boolwhere
│ │ │ │ + Self: Sized,
│ │ │ │ + I: IntoIterator,
│ │ │ │ + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> bool,
fn eq_by<I, F>(self, other: I, eq: F) -> boolwhere
│ │ │ │ + Self: Sized,
│ │ │ │ + I: IntoIterator,
│ │ │ │ + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> bool,
iter_order_by
#64295)1.5.0 · Source§fn ne<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialEq<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
fn ne<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialEq<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
1.5.0 · Source§fn lt<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
fn lt<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
Iterator
are lexicographically
│ │ │ │ +less than those of another. Read more1.5.0 · Source§fn le<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
fn le<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
Iterator
are lexicographically
│ │ │ │ +less or equal to those of another. Read more1.5.0 · Source§fn gt<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
fn gt<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
Iterator
are lexicographically
│ │ │ │ +greater than those of another. Read more1.5.0 · Source§fn ge<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
fn ge<I>(self, other: I) -> boolwhere
│ │ │ │ + I: IntoIterator,
│ │ │ │ + Self::Item: PartialOrd<<I as IntoIterator>::Item>,
│ │ │ │ + Self: Sized,
Iterator
are lexicographically
│ │ │ │ +greater than or equal to those of another. Read more1.82.0 · Source§fn is_sorted(self) -> bool
fn is_sorted(self) -> bool
1.82.0 · Source§fn is_sorted_by<F>(self, compare: F) -> bool
fn is_sorted_by<F>(self, compare: F) -> bool
1.82.0 · Source§fn is_sorted_by_key<F, K>(self, f: F) -> bool
fn is_sorted_by_key<F, K>(self, f: F) -> bool
impl<T> FusedIterator for Iter<'_, T>
Auto Trait Implementations§
impl<'a, T> Freeze for Iter<'a, T>
impl<'a, T> RefUnwindSafe for Iter<'a, T>where
│ │ │ │ + T: RefUnwindSafe,
impl<'a, T> Send for Iter<'a, T>where
│ │ │ │ + T: Sync,
impl<'a, T> Sync for Iter<'a, T>where
│ │ │ │ + T: Sync,
impl<'a, T> Unpin for Iter<'a, T>
impl<'a, T> UnwindSafe for Iter<'a, T>where
│ │ │ │ + T: RefUnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
│ │ │ │ + T: Clone,
impl<T> CloneToUninit for Twhere
│ │ │ │ + T: Clone,
Source§impl<I> IntoIterator for Iwhere
│ │ │ │ - I: Iterator,
impl<I> IntoIterator for Iwhere
│ │ │ │ - I: Iterator,
From<T> for U
chooses to do.
│ │ │ │ +