Struct miri::borrow_tracker::tree_borrows::perms::PermTransition
source · pub struct PermTransition {
from: PermissionPriv,
to: PermissionPriv,
}
Expand description
Transition from one permission to the next.
Fields§
§from: PermissionPriv
§to: PermissionPriv
Implementations§
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 transition corresponds to {trans.summary()}”.
sourcepub(in borrow_tracker::tree_borrows) fn is_relevant(
&self,
err: TransitionError,
) -> bool
pub(in borrow_tracker::tree_borrows) fn is_relevant( &self, err: TransitionError, ) -> bool
Determines whether self
is a relevant transition for the error err
.
self
will be a transition that happened to a tag some time before
that tag caused the error.
Irrelevant events:
- modifications of write permissions when the error is related to read permissions
(on failed reads and protected
Frozen -> Disabled
, ignoreReserved -> Active
,Reserved(conflicted=false) -> Reserved(conflicted=true)
, andActive -> Frozen
) - all transitions for attempts to deallocate strongly protected tags
§Panics
This function assumes that its arguments apply to the same location and that they were obtained during a normal execution. It will panic otherwise.
- all transitions involved in
self
anderr
should be increasing (Reserved < Active < Frozen < Disabled); - between
self
anderr
the permission should also be increasing, so all permissions insideerr
should be greater thanself.1
; Active
andReserved(conflicted=false)
cannot cause an error due to insufficient permissions, soerr
cannot be aChildAccessForbidden(_)
of either of them;err
should not beProtectedDisabled(Disabled)
, because the protected tag should not have beenDisabled
in the first place (if this occurs it means we have unprotected tags that become protected)
sourcepub fn endpoint(&self) -> Permission
pub fn endpoint(&self) -> Permission
Endpoint of a transition.
Meant only for diagnostics, use applied
in non-diagnostics
code, which also checks that the starting point matches the current state.
source§impl PermTransition
impl PermTransition
sourcefn is_possible(self) -> bool
fn is_possible(self) -> 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(from: Permission, to: 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 produces_disabled(self) -> bool
pub fn produces_disabled(self) -> bool
Determines if this transition would disable the permission.
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 for PermTransition
impl PartialEq for PermTransition
impl Copy for PermTransition
impl Eq for PermTransition
impl StructuralPartialEq for PermTransition
Auto Trait Implementations§
impl Freeze for PermTransition
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)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