pub struct CriticalSectionV2 {
pub acquisition: LockAcquisitionV2,
pub start_line: u32,
pub end_line: Option<u32>,
pub field_accesses: Vec<FieldAccessV2>,
pub contains_expensive_ops: bool,
pub contains_await: bool,
}Expand description
A critical section (V2 - uses VarId).
Fields§
§acquisition: LockAcquisitionV2The lock acquisition that starts this critical section.
start_line: u32Line where the critical section starts.
end_line: Option<u32>Line where the critical section ends (guard dropped).
field_accesses: Vec<FieldAccessV2>Fields accessed within this critical section.
contains_expensive_ops: boolWhether the CS contains expensive operations.
contains_await: boolWhether the CS contains await points (async issue).
Implementations§
Source§impl CriticalSectionV2
impl CriticalSectionV2
Sourcepub fn new(acquisition: LockAcquisitionV2) -> Self
pub fn new(acquisition: LockAcquisitionV2) -> Self
Create a new critical section.
Sourcepub fn add_field_access(&mut self, access: FieldAccessV2)
pub fn add_field_access(&mut self, access: FieldAccessV2)
Add a field access.
Sourcepub fn mark_expensive(&mut self)
pub fn mark_expensive(&mut self)
Mark as containing expensive operations.
Sourcepub fn mark_await(&mut self)
pub fn mark_await(&mut self)
Mark as containing await point.
Sourcepub fn unique_fields(&self) -> Vec<&str>
pub fn unique_fields(&self) -> Vec<&str>
Get unique fields accessed.
Sourcepub fn field_access_kind(&self, field: &str) -> Option<AccessKind>
pub fn field_access_kind(&self, field: &str) -> Option<AccessKind>
Get the merged access kind for a field.
Sourcepub fn is_read_only(&self) -> bool
pub fn is_read_only(&self) -> bool
Check if only read accesses occurred.
Trait Implementations§
Source§impl Clone for CriticalSectionV2
impl Clone for CriticalSectionV2
Source§fn clone(&self) -> CriticalSectionV2
fn clone(&self) -> CriticalSectionV2
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CriticalSectionV2
impl RefUnwindSafe for CriticalSectionV2
impl Send for CriticalSectionV2
impl Sync for CriticalSectionV2
impl Unpin for CriticalSectionV2
impl UnsafeUnpin for CriticalSectionV2
impl UnwindSafe for CriticalSectionV2
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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