Trait foundationdb::tuple::Encode
source · pub trait Encode {
fn encode<W: Write>(&self, w: &mut W, tuple_depth: TupleDepth) -> Result<()>;
fn encode_to<W: Write>(&self, w: &mut W) -> Result<()> { ... }
fn to_vec(&self) -> Vec<u8> ⓘ { ... }
}
Expand description
For types that are encodable as defined by the tuple definitions on FoundationDB
Required Methods§
sourcefn encode<W: Write>(&self, w: &mut W, tuple_depth: TupleDepth) -> Result<()>
fn encode<W: Write>(&self, w: &mut W, tuple_depth: TupleDepth) -> Result<()>
Encodes this tuple/element into the associated Write
Arguments
w
- a Write to put the self as FoundationDB encoded bytestuple_depth
- the current depth in recursive tuple-like datastructures, it should be incremented only when encoding a tuple inside another object, seeencode_to
for a method which can initialize the TupleDepth.