pub trait HostCas: Sized + Send {
// Required methods
fn new(
&mut self,
bucket: Resource<Bucket>,
key: String,
) -> impl Future<Output = Result<Resource<Cas>, Error>> + Send;
fn current(
&mut self,
self_: Resource<Cas>,
) -> impl Future<Output = Result<Option<Vec<u8>>, Error>> + Send;
fn drop(
&mut self,
rep: Resource<Cas>,
) -> impl Future<Output = Result<()>> + Send;
}
Required Methods§
Sourcefn new(
&mut self,
bucket: Resource<Bucket>,
key: String,
) -> impl Future<Output = Result<Resource<Cas>, Error>> + Send
fn new( &mut self, bucket: Resource<Bucket>, key: String, ) -> impl Future<Output = Result<Resource<Cas>, Error>> + Send
Construct a new CAS operation. Implementors can map the underlying functionality (transactions, versions, etc) as desired.
Sourcefn current(
&mut self,
self_: Resource<Cas>,
) -> impl Future<Output = Result<Option<Vec<u8>>, Error>> + Send
fn current( &mut self, self_: Resource<Cas>, ) -> impl Future<Output = Result<Option<Vec<u8>>, Error>> + Send
Get the current value of the key (if it exists). This allows for avoiding reads if all that is needed to ensure the atomicity of the operation
fn drop( &mut self, rep: Resource<Cas>, ) -> impl Future<Output = Result<()>> + Send
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: HostCas + ?Sized + Send> HostCas for &mut _T
impl<_T: HostCas + ?Sized + Send> HostCas for &mut _T
Source§async fn new(
&mut self,
bucket: Resource<Bucket>,
key: String,
) -> Result<Resource<Cas>, Error>
async fn new( &mut self, bucket: Resource<Bucket>, key: String, ) -> Result<Resource<Cas>, Error>
Construct a new CAS operation. Implementors can map the underlying functionality (transactions, versions, etc) as desired.
Source§async fn current(
&mut self,
self_: Resource<Cas>,
) -> Result<Option<Vec<u8>>, Error>
async fn current( &mut self, self_: Resource<Cas>, ) -> Result<Option<Vec<u8>>, Error>
Get the current value of the key (if it exists). This allows for avoiding reads if all that is needed to ensure the atomicity of the operation