pub trait AdvisoryLockingClientSender {
type Transport: Transport;
// Required method
fn advisory_lock<___R>(
&self,
request: &mut ___R,
) -> Result<ResponseFuture<'_, Self::Transport, AdvisoryLock>, EncodeError>
where ___R: Encode<<Self::Transport as Transport>::SendBuffer, Encoded = WireAdvisoryLockingAdvisoryLockRequest>;
}
Expand description
A helper trait for the AdvisoryLocking
client sender.
Required Associated Types§
Required Methods§
Sourcefn advisory_lock<___R>(
&self,
request: &mut ___R,
) -> Result<ResponseFuture<'_, Self::Transport, AdvisoryLock>, EncodeError>where
___R: Encode<<Self::Transport as Transport>::SendBuffer, Encoded = WireAdvisoryLockingAdvisoryLockRequest>,
fn advisory_lock<___R>(
&self,
request: &mut ___R,
) -> Result<ResponseFuture<'_, Self::Transport, AdvisoryLock>, EncodeError>where
___R: Encode<<Self::Transport as Transport>::SendBuffer, Encoded = WireAdvisoryLockingAdvisoryLockRequest>,
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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
Source§impl<___T> AdvisoryLockingClientSender for ClientSender<___T, AdvisoryLocking>where
___T: Transport,
impl<___T> AdvisoryLockingClientSender for ClientSender<___T, AdvisoryLocking>where
___T: Transport,
Source§fn advisory_lock<___R>(
&self,
request: &mut ___R,
) -> Result<ResponseFuture<'_, Self::Transport, AdvisoryLock>, EncodeError>where
___R: Encode<<Self::Transport as Transport>::SendBuffer, Encoded = WireAdvisoryLockingAdvisoryLockRequest>,
fn advisory_lock<___R>(
&self,
request: &mut ___R,
) -> Result<ResponseFuture<'_, Self::Transport, AdvisoryLock>, EncodeError>where
___R: Encode<<Self::Transport as Transport>::SendBuffer, Encoded = WireAdvisoryLockingAdvisoryLockRequest>,
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.