Struct mmtk::scheduler::worker_goals::WorkerGoals
source · pub(crate) struct WorkerGoals {
current: Option<WorkerGoal>,
requests: EnumMap<WorkerGoal, bool>,
}
Expand description
This current and reqeusted goals.
Fields§
§current: Option<WorkerGoal>
The current goal.
requests: EnumMap<WorkerGoal, bool>
Requests received from mutators. requests[goal]
is true if the goal
is requested.
Implementations§
source§impl WorkerGoals
impl WorkerGoals
sourcepub fn set_request(&mut self, goal: WorkerGoal) -> bool
pub fn set_request(&mut self, goal: WorkerGoal) -> bool
Set the goal
as requested. Return true
if the requested state of the goal
changed
from false
to true
.
sourcepub fn poll_next_goal(&mut self) -> Option<WorkerGoal>
pub fn poll_next_goal(&mut self) -> Option<WorkerGoal>
Move the highest priority goal from the pending requests to the current request. Return
that goal, or None
if no goal has been requested.
sourcepub fn current(&self) -> Option<WorkerGoal>
pub fn current(&self) -> Option<WorkerGoal>
Get the current goal if exists.
sourcepub fn on_current_goal_completed(&mut self)
pub fn on_current_goal_completed(&mut self)
Called when the current goal is completed. This will clear the current goal.
sourcepub fn debug_is_requested(&self, goal: WorkerGoal) -> bool
pub fn debug_is_requested(&self, goal: WorkerGoal) -> bool
Test if the given goal
is requested. Used for debug purpose, only. The workers always
respond to the request of the highest priority first.
Trait Implementations§
source§impl Debug for WorkerGoals
impl Debug for WorkerGoals
source§impl Default for WorkerGoals
impl Default for WorkerGoals
source§fn default() -> WorkerGoals
fn default() -> WorkerGoals
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl RefUnwindSafe for WorkerGoals
impl Send for WorkerGoals
impl Sync for WorkerGoals
impl Unpin for WorkerGoals
impl UnwindSafe for WorkerGoals
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