Struct miri::borrow_tracker::tree_borrows::perms::PermTransition
source · pub struct PermTransition(PermissionPriv, PermissionPriv);Expand description
Transition from one permission to the next.
Tuple Fields§
§0: PermissionPriv§1: PermissionPrivImplementations§
source§impl PermTransition
impl PermTransition
sourcepub fn summary(&self) -> &'static str
pub fn summary(&self) -> &'static str
Readable explanation of the consequences of an event. Fits in the sentence “This accessed caused {trans.summary()}”.
Important: for the purposes of this explanation, Reserved is considered
to have write permissions, because that’s what the diagnostics care about
(otherwise Reserved -> Frozen would be considered a noop).
source§impl PermTransition
impl PermTransition
sourcefn is_possible(old: PermissionPriv, new: PermissionPriv) -> bool
fn is_possible(old: PermissionPriv, new: PermissionPriv) -> bool
All transitions created through normal means (using perform_access)
should be possible, but the same is not guaranteed by construction of
transitions inferred by diagnostics. This checks that a transition
reconstructed by diagnostics is indeed one that could happen.
pub fn from(old: Permission, new: Permission) -> Option<Self>
pub fn is_noop(self) -> bool
sourcepub fn applied(self, starting_point: Permission) -> Option<Permission>
pub fn applied(self, starting_point: Permission) -> Option<Permission>
Extract result of a transition (checks that the starting point matches).
sourcepub fn started(self) -> Permission
pub fn started(self) -> Permission
Extract starting point of a transition
sourcepub fn is_allowed_by_protector(&self) -> bool
pub fn is_allowed_by_protector(&self) -> bool
Determines whether a transition that occured is compatible with the presence
of a Protector. This is not included in the transition functions because
it would distract from the few places where the transition is modified
because of a protector, but not forbidden.
Note: this is not in charge of checking that there is a protector, it should be used as
let no_protector_error = if is_protected(tag) {
transition.is_allowed_by_protector()
};sourcepub fn apply_start(self, app: Self) -> Option<Self>
pub fn apply_start(self, app: Self) -> Option<Self>
Composition function: get the transition that can be added after app to
produce self.
Trait Implementations§
source§impl Clone for PermTransition
impl Clone for PermTransition
source§fn clone(&self) -> PermTransition
fn clone(&self) -> PermTransition
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for PermTransition
impl Debug for PermTransition
source§impl Display for PermTransition
impl Display for PermTransition
source§impl PartialEq<PermTransition> for PermTransition
impl PartialEq<PermTransition> for PermTransition
source§fn eq(&self, other: &PermTransition) -> bool
fn eq(&self, other: &PermTransition) -> bool
self and other values to be equal, and is used
by ==.impl Copy for PermTransition
impl Eq for PermTransition
impl StructuralEq for PermTransition
impl StructuralPartialEq for PermTransition
Auto Trait Implementations§
impl RefUnwindSafe for PermTransition
impl Send for PermTransition
impl Sync for PermTransition
impl Unpin for PermTransition
impl UnwindSafe for PermTransition
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
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.
Size:2 bytes