pub struct Gpt { /* private fields */ }
Expand description
Manages a connection to a GPT-formatted block device.
Implementations§
Source§impl Gpt
impl Gpt
Sourcepub async fn open(client: Arc<RemoteBlockClient>) -> Result<Self, Error>
pub async fn open(client: Arc<RemoteBlockClient>) -> Result<Self, Error>
Loads and validates a GPT-formatted block device.
Sourcepub async fn format(
client: Arc<RemoteBlockClient>,
partitions: Vec<PartitionInfo>,
) -> Result<Self, Error>
pub async fn format( client: Arc<RemoteBlockClient>, partitions: Vec<PartitionInfo>, ) -> Result<Self, Error>
Formats client
as a new GPT with partitions
. Overwrites any existing GPT on the block
device.
pub fn client(&self) -> &Arc<RemoteBlockClient>
pub fn header(&self) -> &Header
pub fn partitions(&self) -> &BTreeMap<u32, PartitionInfo>
Sourcepub fn create_transaction(&self) -> Option<Transaction>
pub fn create_transaction(&self) -> Option<Transaction>
Returns None if there’s already a pending transaction.
pub async fn commit_transaction( &mut self, transaction: Transaction, ) -> Result<(), TransactionCommitError>
Sourcepub fn add_partition(
&mut self,
transaction: &mut Transaction,
info: PartitionInfo,
) -> Result<usize, AddPartitionError>
pub fn add_partition( &mut self, transaction: &mut Transaction, info: PartitionInfo, ) -> Result<usize, AddPartitionError>
Adds a partition in transaction
. info.start_block
must be unset and will be dynamically
chosen in a first-fit manner.
The indedx of the partition in the table is returned on success.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Gpt
impl !RefUnwindSafe for Gpt
impl Send for Gpt
impl Sync for Gpt
impl Unpin for Gpt
impl !UnwindSafe for Gpt
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