Crate noatun

Crate noatun 

Source
Expand description

§Welcome to Noatun

For a comprehensive introduction, see guide.

For getting started, see the following key types:

  • Database - Main database object.
  • Message - Trait that messages must implement.

Re-exports§

pub use crate::data_types::NoatunCell;
pub use crate::data_types::OpaqueNoatunCell;
pub use database::Database;
pub use database::DatabaseSettings;
pub use database::OpenMode;

Modules§

communication
Tokio-based communication mechanism for synchronizing a noatun database with peers.
data_types
Datatypes for use in the noatun materialized view.
database
This module contains the main user-facing database type: Database.
diagnostics
Module containing data types used by the diagnostics feature of noatun.
distributor
The distributor contains all logic needed to distribute events between noatun instances. It does not contain any actual IO code. Instead, something like crate::communication::DatabaseCommunication can be used to communicate over UDP or similar.
guide
Introduction to Noatun
noatun_instant
Module use to abstract ‘Instant’. If the tokio feature is activated, it resolves to ‘tokio::time::Instant’, otherwise std::time::Instant.
prelude
Commonly used types
sequence_nr
Helper module containing the definition of the SequenceNr type.
simple_metrics
Simple metrics recorder

Macros§

noatun_object
Define a noatun object.
noatun_pod
Define a noatun pod struct.

Structs§

CutOffDuration
How far back in time the cutoff time nominally is.
CutOffState
The current cutoff hash and timestamp
DummyMessageSerializer
Dummy serializer that panics on all use
DummyUnitObject
A state-less object, mostly useful for testing
FatPtr
A fat pointer to noatun materialized view storage.
MessageFrame
A MessageFrame is the fundamental building block of a Noatun database.
MessageHeader
A Noatun-message has a header with the id, and the list of parents. See MessageFrame.
MessageId
The identity of a message.
NoatunContext
Global unit struct used for accessing the current thread local noatun context.
NoatunTime
Wall clock time
SavefileMessageSerializer
A noatun serializer using the savefile library. See savefile.
SchemaHasher
Hasher for hashing noatun database schemas.
ThinPtr
An offset into the on disk store.

Enums§

GenPtr
A pointer into the materialized view store.
Persistence
Controls how long this message will persist
Target
Strategy for handling any pre-existing database files when opening a database

Constants§

CONTEXT
The current context for the running thread.
DEBUG_NODE
In debug-builds, this thread local data tracks which node is currently processed

Traits§

FixedSizeObject
Trait for implementations of Object that have a fixed size, and have an internal representation that is bitwise compatible with their Database format.
Message
An event handled by Noatun.
MessageExt
Extension trait to provide serialization for Message impls
NoatunMessageSerializer
Trait for a serializer that can serialize/deserialize a Message of type MSG.
NoatunPod
Trait for noatun plain data objects.
NoatunStorable
A trait for things that can be stored in the noatun materialized view.
Object
An item that can be stored in the noatun db materialized view.
Pointer
Type abstracting any type of pointer into the materialized view

Functions§

bytes_of
Cast a reference to a NoatunStorable into a slice of bytes
bytes_of_mut
Cast a reference to a NoatunStorable into a slice of bytes
bytes_of_mut_object
Cast a reference to a NoatunStorable into a slice of bytes
calculate_schema_hash
Calculate the correct hash for the schema of the given object
cast_slice
Cast from a slice of I to a slice of O.
cast_slice_mut
Cast from a slice of I to a slice of O.
cast_storable
Cast between two different storable objects
dyn_cast_slice
Requires alignment to be correct at runtime, panics otherwise
dyn_cast_slice_mut
Requires alignment to be correct at runtime, panics otherwise
from_bytes
Convert from a slice of bytes to a T.
from_bytes_mut
Convert from a slice of bytes to a T.
read_unaligned
Read a value of type T from the bytes of ‘data’.
set_test_epoch
Helper useful for tests.
test_elapsed
Returns the time elapsed since the test epoch established using set_test_epoch
test_epoch
Helper useful for tests

Derive Macros§

Savefile