Struct catalyst_entities::CodeGuard
source · pub struct CodeGuard<'a> { /* private fields */ }Expand description
Guard hods a lock on code, but not always blocking. If the guarded code is not finished, lock will block and disallow shared access from other threads, in case of finished code, lock will not block but disallow exclusive access from other threads.
Implementations§
source§impl<'a> CodeGuard<'a>
impl<'a> CodeGuard<'a>
sourcepub fn instructions(&self) -> &[u8] ⓘ
pub fn instructions(&self) -> &[u8] ⓘ
Returns guaranteed immutable reference to code instructions.
sourcepub fn try_instructions_mut(&mut self) -> Result<&mut [u8], &[u8]>
pub fn try_instructions_mut(&mut self) -> Result<&mut [u8], &[u8]>
Returns mutable reference to code instructions. If the code is not finished, this will return Ok, otherwise Err.
Trait Implementations§
Auto Trait Implementations§
impl<'a> !ArchiveCopy for CodeGuard<'a>
impl<'a> !NoInteriorMutability for CodeGuard<'a>
impl<'a> RefUnwindSafe for CodeGuard<'a>
impl<'a> Send for CodeGuard<'a>
impl<'a> Sync for CodeGuard<'a>
impl<'a> Unpin for CodeGuard<'a>
impl<'a> !UnwindSafe for CodeGuard<'a>
Blanket Implementations§
source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.