pub struct GptManager { /* private fields */ }Expand description
Runs a GPT device.
Implementations§
Source§impl GptManager
impl GptManager
pub async fn new( block_proxy: BlockProxy, partitions_dir: Arc<Simple>, ) -> Result<Arc<Self>, Error>
Sourcepub async fn new_with_mapper(
block_proxy: BlockProxy,
mapper_proxy: Option<MapperProxy>,
partitions_dir: Arc<Simple>,
) -> Result<Arc<Self>, Error>
pub async fn new_with_mapper( block_proxy: BlockProxy, mapper_proxy: Option<MapperProxy>, partitions_dir: Arc<Simple>, ) -> Result<Arc<Self>, Error>
Creates a new GptManager with an optional mapper proxy and default configuration.
pub async fn new_with_config( block_proxy: BlockProxy, partitions_dir: Arc<Simple>, config: Config, ) -> Result<Arc<Self>, Error>
Sourcepub async fn new_with_config_and_mapper(
block_proxy: BlockProxy,
mapper_proxy: Option<MapperProxy>,
partitions_dir: Arc<Simple>,
config: Config,
) -> Result<Arc<Self>, Error>
pub async fn new_with_config_and_mapper( block_proxy: BlockProxy, mapper_proxy: Option<MapperProxy>, partitions_dir: Arc<Simple>, config: Config, ) -> Result<Arc<Self>, Error>
Creates a new GptManager with custom config and an optional mapper proxy.
Sourcepub async fn mapper_session_proxy(&self) -> &MapperSessionProxy
pub async fn mapper_session_proxy(&self) -> &MapperSessionProxy
Returns a reference to the parent device’s fblock::MapperSessionProxy.
§Panics
Panics if the parent device was not configured with a mapper proxy.
Sourcepub fn next_partition_key(&self) -> u64
pub fn next_partition_key(&self) -> u64
Allocates and returns the next unique partition key for mapper sessions.
Sourcepub async fn register_mappings(
&self,
key: u64,
offset_map: &OffsetMap,
) -> Result<(), Error>
pub async fn register_mappings( &self, key: u64, offset_map: &OffsetMap, ) -> Result<(), Error>
Registers the extent mapping for a partition under key with the parent mapper session.
§Panics
Panics if the parent device was not configured with a mapper proxy.
Sourcepub fn has_mapper(&self) -> bool
pub fn has_mapper(&self) -> bool
Returns true if this GPT instance was configured with a mapper proxy.
pub fn block_size(&self) -> u32
pub fn block_count(&self) -> u64
pub async fn create_transaction(self: &Arc<Self>) -> Result<EventPair, Status>
pub async fn commit_transaction( self: &Arc<Self>, transaction: EventPair, ) -> Result<(), Status>
pub async fn add_partition( &self, request: PartitionsManagerAddPartitionRequest, ) -> Result<(), Status>
pub async fn handle_partitions_requests( &self, gpt_index: usize, requests: PartitionRequestStream, ) -> Result<(), Status>
pub async fn handle_composite_partitions_requests( &self, gpt_indexes: Vec<usize>, requests: OverlayPartitionRequestStream, ) -> Result<(), Status>
pub async fn reset_partition_table( self: &Arc<Self>, partitions: Vec<PartitionInfo>, ) -> Result<(), Status>
pub async fn shutdown(self: Arc<Self>)
Trait Implementations§
Source§impl Debug for GptManager
impl Debug for GptManager
Source§impl Drop for GptManager
impl Drop for GptManager
Auto Trait Implementations§
impl !Freeze for GptManager
impl !RefUnwindSafe for GptManager
impl !UnwindSafe for GptManager
impl Send for GptManager
impl Sync for GptManager
impl Unpin for GptManager
impl UnsafeUnpin for GptManager
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, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<T> InstanceFromServiceTransport<T> for T
impl<T> InstanceFromServiceTransport<T> for T
§fn from_service_transport(handle: T) -> T
fn from_service_transport(handle: T) -> T
Converts the given service transport handle of type
T to [Self]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