pub struct QuiescentRegion { /* private fields */ }Expand description
Quiescent, pre-transfer owner of a zero-initialized Mach mapping.
This is the only typestate that exposes ordinary byte slices. Consuming it chooses the one writer direction and permanently removes those accessors.
Implementations§
Source§impl QuiescentRegion
impl QuiescentRegion
Sourcepub fn new(len: usize) -> Result<Self, MachError>
pub fn new(len: usize) -> Result<Self, MachError>
Allocates a non-executable, zero-initialized Mach VM region.
Sourcepub const fn logical_len(&self) -> usize
pub const fn logical_len(&self) -> usize
Returns the requested logical layout length within the capability.
Sourcepub const fn is_empty(&self) -> bool
pub const fn is_empty(&self) -> bool
Returns whether the logical region is empty (always false for a valid value).
Sourcepub fn as_bytes_mut(&mut self) -> &mut [u8] ⓘ
pub fn as_bytes_mut(&mut self) -> &mut [u8] ⓘ
Mutably borrows quiescent initialization bytes.
Sourcepub fn into_local_writer(
self,
expected_len: usize,
) -> Result<LocalWriterRegion, MachError>
pub fn into_local_writer( self, expected_len: usize, ) -> Result<LocalWriterRegion, MachError>
Selects this process as sole writer and creates one read-only peer entry.
Sourcepub fn into_remote_writer(
self,
expected_len: usize,
) -> Result<RemoteWriterRegion, MachError>
pub fn into_remote_writer( self, expected_len: usize, ) -> Result<RemoteWriterRegion, MachError>
Selects the peer as sole writer and permanently downgrades this mapping.
Sourcepub fn into_bound_local_writer(
self,
expected: ValidationExpectations,
topology: RegionSetLayout,
) -> Result<WriterRegion<MacWriterMapping>, MacBindingError>
pub fn into_bound_local_writer( self, expected: ValidationExpectations, topology: RegionSetLayout, ) -> Result<WriterRegion<MacWriterMapping>, MacBindingError>
Validates the complete padded capability, then consumes it as the sole writer.
Sourcepub fn into_bound_remote_writer(
self,
expected: ValidationExpectations,
topology: RegionSetLayout,
) -> Result<ReaderRegion<MacReaderMapping>, MacBindingError>
pub fn into_bound_remote_writer( self, expected: ValidationExpectations, topology: RegionSetLayout, ) -> Result<ReaderRegion<MacReaderMapping>, MacBindingError>
Validates the complete padded capability, then downgrades it to read-only.
Sourcepub fn transfer_local_writer(
self,
expected: ValidationExpectations,
topology: RegionSetLayout,
channel: &ParentChannel,
) -> Result<WriterRegion<TransferredWriterMapping>, MacBindingError>
pub fn transfer_local_writer( self, expected: ValidationExpectations, topology: RegionSetLayout, channel: &ParentChannel, ) -> Result<WriterRegion<TransferredWriterMapping>, MacBindingError>
Validates, transfers a read-only entry, and commits the local writer.
Sourcepub fn transfer_remote_writer(
self,
expected: ValidationExpectations,
topology: RegionSetLayout,
channel: &ParentChannel,
) -> Result<ReaderRegion<TransferredReaderMapping>, MacBindingError>
pub fn transfer_remote_writer( self, expected: ValidationExpectations, topology: RegionSetLayout, channel: &ParentChannel, ) -> Result<ReaderRegion<TransferredReaderMapping>, MacBindingError>
Validates, transfers the sole writer entry, and commits local read-only access.