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. Must only be used for the root, this is not in general an “initial” permission!
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
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
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
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 for Permission
impl PartialEq for Permission
source§fn eq(&self, other: &Permission) -> bool
fn eq(&self, other: &Permission) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for Permission
impl PartialOrd 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
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
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