pub trait PersistentReservation: Sync {
// Required methods
fn capabilities(&self) -> ReservationCapabilities;
fn report<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<ReservationReport, DiskError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn register<'life0, 'async_trait>(
&'life0 self,
current_key: Option<u64>,
new_key: u64,
ptpl: Option<bool>,
) -> Pin<Box<dyn Future<Output = Result<(), DiskError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn reserve<'life0, 'async_trait>(
&'life0 self,
key: u64,
reservation_type: ReservationType,
) -> Pin<Box<dyn Future<Output = Result<(), DiskError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn release<'life0, 'async_trait>(
&'life0 self,
key: u64,
reservation_type: ReservationType,
) -> Pin<Box<dyn Future<Output = Result<(), DiskError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn clear<'life0, 'async_trait>(
&'life0 self,
key: u64,
) -> Pin<Box<dyn Future<Output = Result<(), DiskError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn preempt<'life0, 'async_trait>(
&'life0 self,
current_key: u64,
preempt_key: u64,
reservation_type: ReservationType,
abort: bool,
) -> Pin<Box<dyn Future<Output = Result<(), DiskError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}
Expand description
Trait implemented by disks that support SCSI-style persistent reservations.
Required Methods§
Sourcefn capabilities(&self) -> ReservationCapabilities
fn capabilities(&self) -> ReservationCapabilities
Returns the disk’s capabilities.
Sourcefn report<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<ReservationReport, DiskError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn report<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<ReservationReport, DiskError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns a report of the current registration and reservation state.
Sourcefn register<'life0, 'async_trait>(
&'life0 self,
current_key: Option<u64>,
new_key: u64,
ptpl: Option<bool>,
) -> Pin<Box<dyn Future<Output = Result<(), DiskError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn register<'life0, 'async_trait>(
&'life0 self,
current_key: Option<u64>,
new_key: u64,
ptpl: Option<bool>,
) -> Pin<Box<dyn Future<Output = Result<(), DiskError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Updates the registration for this client.
If the current key does not match old_key
, then fails with
DiskError::ReservationConflict
. If old_key
is None
, then update
the registration regardless.
If new_key
is 0, then remove the registration.
ptpl
provides an optional new state for “persist through power loss”.
Sourcefn reserve<'life0, 'async_trait>(
&'life0 self,
key: u64,
reservation_type: ReservationType,
) -> Pin<Box<dyn Future<Output = Result<(), DiskError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn reserve<'life0, 'async_trait>(
&'life0 self,
key: u64,
reservation_type: ReservationType,
) -> Pin<Box<dyn Future<Output = Result<(), DiskError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Creates a reservation for this client with type reservation_type
.
Fails with DiskError::ReservationConflict
if there is a key mismatch.
Sourcefn release<'life0, 'async_trait>(
&'life0 self,
key: u64,
reservation_type: ReservationType,
) -> Pin<Box<dyn Future<Output = Result<(), DiskError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn release<'life0, 'async_trait>(
&'life0 self,
key: u64,
reservation_type: ReservationType,
) -> Pin<Box<dyn Future<Output = Result<(), DiskError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Releases the reservation for this client with type reservation_type
.
Fails with DiskError::ReservationConflict
if there is a key or type
mismatch.
Sourcefn clear<'life0, 'async_trait>(
&'life0 self,
key: u64,
) -> Pin<Box<dyn Future<Output = Result<(), DiskError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn clear<'life0, 'async_trait>(
&'life0 self,
key: u64,
) -> Pin<Box<dyn Future<Output = Result<(), DiskError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Clears any reservation and registration for this client.
Fails with DiskError::ReservationConflict
if there is a key mismatch.
Sourcefn preempt<'life0, 'async_trait>(
&'life0 self,
current_key: u64,
preempt_key: u64,
reservation_type: ReservationType,
abort: bool,
) -> Pin<Box<dyn Future<Output = Result<(), DiskError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn preempt<'life0, 'async_trait>(
&'life0 self,
current_key: u64,
preempt_key: u64,
reservation_type: ReservationType,
abort: bool,
) -> Pin<Box<dyn Future<Output = Result<(), DiskError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Preempts an existing reservation. See the SCSI spec for the precise behavior of this.