pub enum AdvisoryLockingRequest {
AdvisoryLock {
request: AdvisoryLockRequest,
responder: AdvisoryLockingAdvisoryLockResponder,
},
}
Expand description
Advisory locking protocol.
This protocol is intended to be composed into the |File| protocol to provide support for advisory locking.
Advisory locks are purely advisory. They do not prevent actual read or write operations from occurring on the file, either through this connection or through other connections.
These primitives are designed to support the flock() and fcntl(), specifically F_SETLK, F_SETLKW, and F_GETLK, functionality that code running on Fuchsia expects from other operating systems.
Variants§
AdvisoryLock
Acquires an advisory lock on the underlying file.
The lock lasts until either this connection is closed or this method is called with |AdvisoryLockType.UNLOCK| to release the lock explicitly.
Advisory locks are purely advisory. They do not prevent actual read or write operations from occurring on the file, either through this connection or through other connections.
This method requires the following rights:
- [
Rights.READ_BYTES
] ifrequest.type
is [AdvisoryLockType.READ
]. - [
Rights.WRITE_BYTES
] ifrequest.type
is [AdvisoryLockType.WRITE
].
§Errors
ZX_ERR_BAD_STATE
The specified type of lock cannot be acquired. For example, another connection might hold a conflicting lock type.ZX_ERR_NOT_SUPPORTED
This file does not support advisory locking.ZX_ERR_ACCESS_DENIED
This connection does not have sufficient rights to acquire the given type of lock.
Implementations§
source§impl AdvisoryLockingRequest
impl AdvisoryLockingRequest
pub fn into_advisory_lock( self, ) -> Option<(AdvisoryLockRequest, AdvisoryLockingAdvisoryLockResponder)>
sourcepub fn method_name(&self) -> &'static str
pub fn method_name(&self) -> &'static str
Name of the method defined in FIDL