Skip to main content

Data

Trait Data 

Source
pub trait Data:
    Comparable
    + Clonable
    + SerializeDyn
    + DeserializableDyn
    + Send
    + Sync
    + Debug
    + AsAny
    + SizeOf
    + SupportsRoaring {
    // Required methods
    fn default_hash(&self) -> u64;
    fn dyn_hash(&self, hasher: &mut dyn Hasher);
    fn as_data(&self) -> &dyn Data;
    fn as_data_mut(&mut self) -> &mut dyn Data;
}
Expand description

Defines the minimal set of operations that must be supported by all data types stored in DBSP batches.

This trait is object safe and can be invoked via dynamic dispatch.

Required Methods§

Source

fn default_hash(&self) -> u64

Compute a hash of the object using default hasher and seed.

Source

fn dyn_hash(&self, hasher: &mut dyn Hasher)

Source

fn as_data(&self) -> &dyn Data

Cast any type that implements this trait to &dyn Data.

This method will not be needed once trait downcasting has been stabilized.

Source

fn as_data_mut(&mut self) -> &mut dyn Data

Cast any type that implements this trait to &mut dyn Data.

This method will not be needed once trait downcasting has been stabilized.

Trait Implementations§

Source§

impl Checkpoint for dyn Data + 'static

Source§

fn checkpoint(&self) -> Result<Vec<u8>, Error>

Source§

fn restore(&mut self, data: &[u8]) -> Result<(), Error>

Source§

impl Deserialize<Box<dyn Data>, Deserializer> for ()

Source§

fn deserialize( &self, _deserializer: &mut Deserializer, ) -> Result<Box<DynData>, <Deserializer as Fallible>::Error>

Deserializes using the given deserializer

Blanket Implementations§

Source§

impl<V> Erase<dyn Data> for V

Source§

fn erase(&self) -> &(dyn Data + 'static)

Convert a reference to self into a reference to Trait.
Source§

fn erase_mut(&mut self) -> &mut (dyn Data + 'static)

Convert a mutable reference to self into a mutable reference to Trait.
Source§

fn erase_box(self: Box<V>) -> Box<dyn Data>

Convert Box<Self> into Box<Trait>.
Source§

fn erase_archived( archived: &<V as Archive>::Archived, ) -> &<dyn Data as ArchiveTrait>::Archived

Convert a reference to an archived representation of Self into a reference to a trait object of type Trait::Archived.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<T: DBData> Data for T