Skip to main content

ProtocolWrite

Trait ProtocolWrite 

Source
pub trait ProtocolWrite: Protocol {
    type Address: AddressLike;
    type Value: ValueLike;

    // Required methods
    fn write(
        &self,
        conn: &mut dyn Connection,
        addr: &Self::Address,
        value: &Self::Value,
    ) -> Result<()>;
    fn write_batch(
        &self,
        conn: &mut dyn Connection,
        items: &[(Self::Address, Self::Value)],
    ) -> Result<()>;
}
Expand description

写操作 trait。

Required Associated Types§

Required Methods§

Source

fn write( &self, conn: &mut dyn Connection, addr: &Self::Address, value: &Self::Value, ) -> Result<()>

向指定地址写入单个值。

Source

fn write_batch( &self, conn: &mut dyn Connection, items: &[(Self::Address, Self::Value)], ) -> Result<()>

批量写入多个地址的值。

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§