Struct miri::borrow_tracker::tree_borrows::perms::Permission
source · pub struct Permission {
inner: PermissionPriv,
}
Expand description
Public interface to the state machine that controls read-write permissions.
This is the “private enum
” pattern.
Fields§
§inner: PermissionPriv
Implementations§
source§impl Permission
impl Permission
sourcepub fn short_name(self) -> &'static str
pub fn short_name(self) -> &'static str
Abbreviated name of the permission (uniformly 3 letters for nice alignment).
source§impl Permission
impl Permission
sourcepub fn is_initial(&self) -> bool
pub fn is_initial(&self) -> bool
Check if self
can be the initial state of a pointer.
sourcepub fn new_active() -> Self
pub fn new_active() -> Self
Default initial permission of the root of a new tree.
sourcepub fn new_reserved(ty_is_freeze: bool) -> Self
pub fn new_reserved(ty_is_freeze: bool) -> Self
Default initial permission of a reborrowed mutable reference.
sourcepub fn new_frozen() -> Self
pub fn new_frozen() -> Self
Default initial permission of a reborrowed shared reference
pub fn is_active(self) -> bool
pub fn is_reserved(self, interior_mut: Option<bool>) -> bool
pub fn is_frozen(self) -> bool
pub fn is_disabled(self) -> bool
sourcepub fn perform_access(
kind: AccessKind,
rel_pos: AccessRelatedness,
old_perm: Self,
protected: bool
) -> Option<PermTransition>
pub fn perform_access( kind: AccessKind, rel_pos: AccessRelatedness, old_perm: Self, protected: bool ) -> Option<PermTransition>
Apply the transition to the inner PermissionPriv.
Trait Implementations§
source§impl Clone for Permission
impl Clone for Permission
source§fn clone(&self) -> Permission
fn clone(&self) -> Permission
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for Permission
impl Debug for Permission
source§impl Display for Permission
impl Display for Permission
source§impl Hash for Permission
impl Hash for Permission
source§impl PartialEq<Permission> for Permission
impl PartialEq<Permission> for Permission
source§fn eq(&self, other: &Permission) -> bool
fn eq(&self, other: &Permission) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<Permission> for Permission
impl PartialOrd<Permission> for Permission
source§fn partial_cmp(&self, other: &Permission) -> Option<Ordering>
fn partial_cmp(&self, other: &Permission) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for Permission
impl Eq for Permission
impl StructuralEq for Permission
impl StructuralPartialEq for Permission
Auto Trait Implementations§
impl RefUnwindSafe for Permission
impl Send for Permission
impl Sync for Permission
impl Unpin for Permission
impl UnwindSafe for Permission
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
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: 1 byte