pub struct AdvisoryLockingSynchronousProxy { /* private fields */ }
Implementations§
source§impl AdvisoryLockingSynchronousProxy
impl AdvisoryLockingSynchronousProxy
pub fn new(channel: Channel) -> Self
pub fn into_channel(self) -> Channel
sourcepub fn wait_for_event(
&self,
deadline: MonotonicInstant,
) -> Result<AdvisoryLockingEvent, Error>
pub fn wait_for_event( &self, deadline: MonotonicInstant, ) -> Result<AdvisoryLockingEvent, Error>
Waits until an event arrives and returns it. It is safe for other threads to make concurrent requests while waiting for an event.
sourcepub fn advisory_lock(
&self,
request: &AdvisoryLockRequest,
___deadline: MonotonicInstant,
) -> Result<AdvisoryLockingAdvisoryLockResult, Error>
pub fn advisory_lock( &self, request: &AdvisoryLockRequest, ___deadline: MonotonicInstant, ) -> Result<AdvisoryLockingAdvisoryLockResult, Error>
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.
Trait Implementations§
source§impl SynchronousProxy for AdvisoryLockingSynchronousProxy
impl SynchronousProxy for AdvisoryLockingSynchronousProxy
§type Proxy = AdvisoryLockingProxy
type Proxy = AdvisoryLockingProxy
The async proxy for the same protocol.
§type Protocol = AdvisoryLockingMarker
type Protocol = AdvisoryLockingMarker
The protocol which this
Proxy
controls.source§fn from_channel(inner: Channel) -> Self
fn from_channel(inner: Channel) -> Self
Create a proxy over the given channel.
source§fn into_channel(self) -> Channel
fn into_channel(self) -> Channel
Convert the proxy back into a channel.
source§fn as_channel(&self) -> &Channel
fn as_channel(&self) -> &Channel
Get a reference to the proxy’s underlying channel. Read more
Auto Trait Implementations§
impl Freeze for AdvisoryLockingSynchronousProxy
impl RefUnwindSafe for AdvisoryLockingSynchronousProxy
impl Send for AdvisoryLockingSynchronousProxy
impl Sync for AdvisoryLockingSynchronousProxy
impl Unpin for AdvisoryLockingSynchronousProxy
impl UnwindSafe for AdvisoryLockingSynchronousProxy
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