Struct mmtk::plan::markcompact::mutator::ALLOCATOR_MAPPING
source · pub struct ALLOCATOR_MAPPING {
__private_field: (),
}
Fields§
§__private_field: ()
Methods from Deref<Target = EnumMap<AllocationSemantics, AllocatorSelector>>§
pub fn values(&self) -> Values<'_, V>
pub fn values(&self) -> Values<'_, V>
An iterator visiting all values. The iterator type is &V
.
§Examples
use enum_map::enum_map;
let map = enum_map! { false => 3, true => 4 };
let mut values = map.values();
assert_eq!(values.next(), Some(&3));
assert_eq!(values.next(), Some(&4));
assert_eq!(values.next(), None);
pub fn iter(&self) -> Iter<'_, K, V>
pub fn iter(&self) -> Iter<'_, K, V>
Returns an iterator over enum map.
The iteration order is deterministic, and when using [macro@Enum] derive it will be the order in which enum variants are declared.
§Examples
use enum_map::{enum_map, Enum};
#[derive(Enum, PartialEq)]
enum E {
A,
B,
C,
}
let map = enum_map! { E::A => 1, E::B => 2, E::C => 3};
assert!(map.iter().eq([(E::A, &1), (E::B, &2), (E::C, &3)]));
pub fn as_array(&self) -> &<K as EnumArray<V>>::Array
pub fn as_array(&self) -> &<K as EnumArray<V>>::Array
Returns a reference to the underlying array.
The order of elements is deterministic, and when using [macro@Enum] derive it will be the order in which enum variants are declared.
§Examples
use enum_map::{enum_map, Enum};
#[derive(Enum, PartialEq)]
enum E {
A,
B,
C,
}
let map = enum_map! { E::A => 1, E::B => 2, E::C => 3};
assert_eq!(map.as_array(), &[1, 2, 3]);
pub fn as_slice(&self) -> &[V]
pub fn as_slice(&self) -> &[V]
Converts an enum map to a slice representing values.
The order of elements is deterministic, and when using [macro@Enum] derive it will be the order in which enum variants are declared.
§Examples
use enum_map::{enum_map, Enum};
#[derive(Enum, PartialEq)]
enum E {
A,
B,
C,
}
let map = enum_map! { E::A => 1, E::B => 2, E::C => 3};
assert_eq!(map.as_slice(), &[1, 2, 3]);
Trait Implementations§
source§impl Deref for ALLOCATOR_MAPPING
impl Deref for ALLOCATOR_MAPPING
§type Target = EnumMap<AllocationSemantics, AllocatorSelector>
type Target = EnumMap<AllocationSemantics, AllocatorSelector>
The resulting type after dereferencing.
source§fn deref(&self) -> &EnumMap<AllocationSemantics, AllocatorSelector>
fn deref(&self) -> &EnumMap<AllocationSemantics, AllocatorSelector>
Dereferences the value.
impl LazyStatic for ALLOCATOR_MAPPING
Auto Trait Implementations§
impl RefUnwindSafe for ALLOCATOR_MAPPING
impl Send for ALLOCATOR_MAPPING
impl Sync for ALLOCATOR_MAPPING
impl Unpin for ALLOCATOR_MAPPING
impl UnwindSafe for ALLOCATOR_MAPPING
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more