Development Documentation (main branch) - For stable release docs, see docs.rs/eidetica

DocStore

Struct DocStore 

Source
pub struct DocStore { /* private fields */ }
Expand description

A document-oriented Store providing ergonomic access to Doc CRDT data.

DocStore wraps the Doc CRDT to provide path-based access to nested document structures. It supports string values and deletions via tombstones.

§API Overview

Implementations§

Source§

impl DocStore

Source

pub async fn get(&self, key: impl AsRef<str>) -> Result<Value>

Gets a value associated with a key from the Store.

This method prioritizes returning data staged within the current Transaction. If the key is not found in the staged data it retrieves the fully merged historical state from the backend up to the point defined by the Transaction’s parents and returns the value from there.

§Arguments
  • key - The key to retrieve the value for.
§Returns

A Result containing the MapValue if found, or Error::NotFound.

Source

pub async fn get_option(&self, key: impl AsRef<str>) -> Option<Value>

Gets a value associated with a key from the Store (HashMap-like API).

This method returns an Option for compatibility with std::HashMap. Returns None if the key is not found or is deleted.

§Arguments
  • key - The key to retrieve the value for.
§Returns

An Option containing the cloned Value if found, or None.

Source

pub async fn get_result(&self, key: impl AsRef<str>) -> Result<Value>

Gets a value associated with a key from the Store (Result-based API for backward compatibility).

This method prioritizes returning data staged within the current Transaction. If the key is not found in the staged data it retrieves the fully merged historical state from the backend up to the point defined by the Transaction’s parents and returns the value from there.

§Arguments
  • key - The key to retrieve the value for.
§Returns

A Result containing the MapValue if found, or Error::NotFound.

Source

pub async fn get_string(&self, key: impl AsRef<str>) -> Result<String>

Gets a string value associated with a key from the Store.

This is a convenience method that calls get() and expects the value to be a string.

§Arguments
  • key - The key to retrieve the value for.
§Returns

A Result containing the string value if found, or an error if the key is not found or if the value is not a string.

Source

pub async fn set( &self, key: impl Into<String>, value: impl Into<Value>, ) -> Result<()>

Stages the setting of a key-value pair within the associated Transaction.

This method updates the Map data held within the Transaction for this Doc instance’s subtree name. The change is not persisted to the backend until the Transaction::commit() method is called.

§Arguments
  • key - The key to set.
  • value - The value to associate with the key (can be &str, String, Value, etc.)
§Returns

A Result<()> indicating success or an error during serialization or staging.

Source

pub async fn insert( &self, key: impl Into<String>, value: impl Into<Value>, ) -> Result<Option<Value>>

Sets a key-value pair (HashMap-like API).

Returns the previous value if one existed, or None if the key was not present. This follows std::HashMap::insert() semantics.

§Arguments
  • key - The key to set.
  • value - The value to associate with the key (can be &str, String, Value, etc.)
§Returns

A Result<Option<Value>> containing the previous value, or None if no previous value.

Source

pub async fn set_result( &self, key: impl Into<String>, value: impl Into<Value>, ) -> Result<()>

Sets a key-value pair (Result-based API for backward compatibility).

This method updates the Map data held within the Transaction for this Doc instance’s subtree name. The change is not persisted to the backend until the Transaction::commit() method is called.

§Arguments
  • key - The key to set.
  • value - The value to associate with the key (can be &str, String, Value, etc.)
§Returns

A Result<()> indicating success or an error during serialization or staging.

Source

pub async fn set_string( &self, key: impl Into<String>, value: impl Into<String>, ) -> Result<()>

Convenience method to set a string value.

Source

pub async fn get_list(&self, key: impl AsRef<str>) -> Result<List>

Stages the setting of a nested value within the associated Transaction.

This method allows setting any valid Value type (String, Map, or Deleted).

§Arguments
  • key - The key to set.
  • value - The Value to associate with the key.
§Returns

A Result<()> indicating success or an error during serialization or staging. Convenience method to get a List value.

Source

pub async fn get_node(&self, key: impl AsRef<str>) -> Result<Doc>

Convenience method to get a nested Doc value.

Source

pub async fn set_list( &self, key: impl Into<String>, list: impl Into<List>, ) -> Result<()>

Convenience method to set a list value.

Source

pub async fn set_node( &self, key: impl Into<String>, node: impl Into<Doc>, ) -> Result<()>

Convenience method to set a nested Doc value.

Source

pub async fn set_value( &self, key: impl Into<String>, value: impl Into<Value>, ) -> Result<()>

Legacy method for backward compatibility - now just an alias to set

Source

pub async fn get_value(&self, key: impl AsRef<str>) -> Result<Value>

Legacy method for backward compatibility - now just an alias to get

Source

pub async fn get_path(&self, path: impl AsRef<Path>) -> Result<Value>

Enhanced access methods with type inference

These methods provide cleaner access with automatic type conversion, similar to the CRDT Doc interface but adapted for the DocStore transaction model.

Gets a value by path using dot notation (e.g., “user.profile.name”)

Traverses the DocStore data structure following the path segments separated by dots. This method follows the DocStore staging model by checking local staged data first, then falling back to historical data from the backend.

§Path Syntax
  • Docs: Navigate by key name (e.g., “user.profile.name”)
  • Lists: Navigate by index (e.g., “items.0.title”)
  • Mixed: Combine both (e.g., “users.0.tags.1”)
§Examples
let txn = database.new_transaction().await?;
let store = txn.get_store::<DocStore>("data").await?;

store.set_path(path!("user.profile.name"), "Alice").await?;

// Navigate nested structure
let name = store.get_path(path!("user.profile.name")).await?;
§Returns

A Result<Value> containing the value if found, or an error if not found.

Source

pub async fn get_path_option(&self, path: impl AsRef<Path>) -> Option<Value>

Gets a value by path using dot notation (HashMap-like API).

§Returns

An Option<Value> containing the value if found, or None if not found.

Source

pub async fn get_path_result(&self, path: impl AsRef<Path>) -> Result<Value>

Gets a value by path using dot notation (Result-based API for backward compatibility).

§Returns

A Result<Value> containing the value if found, or an error if not found.

Source§

impl DocStore

Source

pub async fn get_as<T>(&self, key: impl AsRef<str>) -> Result<T>
where T: for<'a> TryFrom<&'a Value, Error = CRDTError>,

Gets a value with automatic type conversion using TryFrom.

This provides a generic interface that can convert to any type that implements TryFrom<&Value>, making the API more ergonomic by reducing type specification.

§Examples
let txn = database.new_transaction().await?;
let store = txn.get_store::<DocStore>("data").await?;

store.set("name", "Alice").await?;
store.set("age", 30).await?;

// Type inference makes this clean
let name: String = store.get_as("name").await?;
let age: i64 = store.get_as("age").await?;

assert_eq!(name, "Alice");
assert_eq!(age, 30);
Source

pub async fn get_path_as<T>(&self, path: impl AsRef<Path>) -> Result<T>
where T: for<'a> TryFrom<&'a Value, Error = CRDTError>,

Gets a value by path with automatic type conversion using TryFrom

Similar to get_as() but works with dot-notation paths for nested access. This method follows the DocStore staging model by checking local staged data first, then falling back to historical data from the backend.

§Examples
let txn = database.new_transaction().await?;
let store = txn.get_store::<DocStore>("data").await?;

// Assuming nested structure exists
// Type inference with path access
let name: String = store.get_path_as(path!("user.profile.name")).await?;
let age: i64 = store.get_path_as(path!("user.profile.age")).await?;

assert_eq!(name, "Alice");
assert_eq!(age, 30);
§Errors

Returns an error if:

  • The path doesn’t exist (SubtreeError::KeyNotFound)
  • The value cannot be converted to type T (CRDTError::TypeMismatch)
  • The DocStore operation fails
Source

pub async fn get_or_insert<T>( &self, key: impl AsRef<str>, default: T, ) -> Result<T>
where T: Into<Value> + for<'a> TryFrom<&'a Value, Error = CRDTError> + Clone,

Mutable access methods for transaction-based modification

These methods work with DocStore’s staging model, where changes are staged in the Transaction transaction rather than modified in-place.

Get or insert a value with a default.

If the key exists (in either local staging area or historical data), returns the existing value. If the key doesn’t exist, sets it to the default value and returns that.

§Examples
let txn = database.new_transaction().await?;
let store = txn.get_store::<DocStore>("data").await?;

// Key doesn't exist - will set default
let count1: i64 = store.get_or_insert("counter", 0).await?;
assert_eq!(count1, 0);

// Key exists - will return existing value
store.set("counter", 5).await?;
let count2: i64 = store.get_or_insert("counter", 100).await?;
assert_eq!(count2, 5);
Source

pub async fn modify<T, F>(&self, key: impl AsRef<str>, f: F) -> Result<()>
where T: for<'a> TryFrom<&'a Value, Error = CRDTError> + Into<Value>, F: FnOnce(&mut T),

Modifies a value in-place using a closure

If the key exists and can be converted to type T, the closure is called with the value. After the closure returns, the modified value is staged back to the DocStore.

This method handles the DocStore staging model by:

  1. Getting the current value (from local staging or historical data)
  2. Converting it to the desired type
  3. Applying the modification closure
  4. Staging the result back to the Transaction
§Errors

Returns an error if:

  • The key doesn’t exist (SubtreeError::KeyNotFound)
  • The value cannot be converted to type T (CRDTError::TypeMismatch)
  • Setting the value fails
§Examples
let txn = database.new_transaction().await?;
let store = txn.get_store::<DocStore>("data").await?;

store.set("count", 5).await?;
store.set("text", "hello").await?;

// Modify counter
store.modify::<i64, _>("count", |count| {
    *count += 10;
}).await?;
assert_eq!(store.get_as::<i64>("count").await?, 15);

// Modify string
store.modify::<String, _>("text", |text| {
    text.push_str(" world");
}).await?;
assert_eq!(store.get_as::<String>("text").await?, "hello world");
Source

pub async fn modify_or_insert<T, F>( &self, key: impl AsRef<str>, default: T, f: F, ) -> Result<()>
where T: Into<Value> + for<'a> TryFrom<&'a Value, Error = CRDTError> + Clone, F: FnOnce(&mut T),

Modify a value or insert a default if it doesn’t exist.

This is a combination of get_or_insert and modify that ensures the key exists before modification.

§Examples
let txn = database.new_transaction().await?;
let store = txn.get_store::<DocStore>("data").await?;

// Key doesn't exist - will create with default then modify
store.modify_or_insert::<i64, _>("counter", 0, |count| {
    *count += 5;
}).await?;
assert_eq!(store.get_as::<i64>("counter").await?, 5);

// Key exists - will just modify
store.modify_or_insert::<i64, _>("counter", 100, |count| {
    *count *= 2;
}).await?;
assert_eq!(store.get_as::<i64>("counter").await?, 10);
Source

pub async fn get_or_insert_path<T>( &self, path: impl AsRef<Path>, default: T, ) -> Result<T>
where T: Into<Value> + for<'a> TryFrom<&'a Value, Error = CRDTError> + Clone,

Get or insert a value at a path with a default, similar to get_or_insert but for paths

If the path exists (in either local staging area or historical data), returns the existing value. If the path doesn’t exist, sets it to the default value and returns that. Intermediate nodes are created as needed.

§Examples
let txn = database.new_transaction().await?;
let store = txn.get_store::<DocStore>("data").await?;

// Path doesn't exist - will create structure and set default
let count1: i64 = store.get_or_insert_path(path!("user.stats.score"), 0).await?;
assert_eq!(count1, 0);

// Path exists - will return existing value
store.set_path(path!("user.stats.score"), 42).await?;
let count2: i64 = store.get_or_insert_path(path!("user.stats.score"), 100).await?;
assert_eq!(count2, 42);
Source

pub async fn get_or_insert_path_str<T>( &self, path: &str, default: T, ) -> Result<T>
where T: Into<Value> + for<'a> TryFrom<&'a Value, Error = CRDTError> + Clone,

Get or insert a value at a path with string paths for runtime normalization

Source

pub async fn modify_or_insert_path<T, F>( &self, path: impl AsRef<Path>, default: T, f: F, ) -> Result<()>
where T: Into<Value> + for<'a> TryFrom<&'a Value, Error = CRDTError> + Clone, F: FnOnce(&mut T),

Modify a value at a path or insert a default if it doesn’t exist.

This is a combination of get_or_insert_path and modify_path that ensures the path exists before modification, creating intermediate structure as needed.

§Examples
let txn = database.new_transaction().await?;
let store = txn.get_store::<DocStore>("data").await?;

// Path doesn't exist - will create structure with default then modify
store.modify_or_insert_path::<i64, _>(path!("user.stats.score"), 0, |score| {
    *score += 10;
}).await?;
assert_eq!(store.get_path_as::<i64>(path!("user.stats.score")).await?, 10);

// Path exists - will just modify
store.modify_or_insert_path::<i64, _>(path!("user.stats.score"), 100, |score| {
    *score *= 2;
}).await?;
assert_eq!(store.get_path_as::<i64>(path!("user.stats.score")).await?, 20);
Source

pub async fn modify_or_insert_path_str<T, F>( &self, path: &str, default: T, f: F, ) -> Result<()>
where T: Into<Value> + for<'a> TryFrom<&'a Value, Error = CRDTError> + Clone, F: FnOnce(&mut T),

Modify a value or insert a default with string paths for runtime normalization

Source

pub async fn set_path( &self, path: impl AsRef<Path>, value: impl Into<Value>, ) -> Result<()>

Sets a value at the given path, creating intermediate nodes as needed

This method stages a path-based set operation in the Transaction transaction. The path uses dot notation to navigate and create nested map structures. Intermediate maps are created automatically where necessary.

§Important: Creates Nested Maps, Not Flat Keys

Using dots in the path creates a hierarchy of nested maps, not flat keys with dots. For example, set_path("user.name", "Alice") creates:

{
  "user": {
    "name": "Alice"
  }
}

NOT: { "user.name": "Alice" }

§Path Syntax
  • Docs: Navigate by key name (e.g., “user.profile.name”)
  • Creating structure: Intermediate nodes are created automatically
  • Overwriting: If a path segment points to a non-node value, it will be overwritten
§Examples
let txn = database.new_transaction().await?;
let store = txn.get_store::<DocStore>("data").await?;

// Set nested values, creating structure as needed
store.set_path(path!("user.profile.name"), "Alice").await?;
store.set_path(path!("user.profile.age"), 30).await?;
store.set_path(path!("user.settings.theme"), "dark").await?;

// This creates nested structure:
// {
//   "user": {
//     "profile": { "name": "Alice", "age": 30 },
//     "settings": { "theme": "dark" }
//   }
// }

// Access with get_path methods
assert_eq!(store.get_path_as::<String>(path!("user.profile.name")).await?, "Alice");

// Or navigate the nested structure manually from get_all()
let all = store.get_all().await?;
// all.get("user") returns a Doc, NOT all.get("user.profile.name")
if let Some(Value::Doc(user)) = all.get("user") {
    if let Some(Value::Doc(profile)) = user.get("profile") {
        assert_eq!(profile.get("name"), Some(&Value::Text("Alice".to_string())));
    }
}
§Errors

Returns an error if:

  • The path is empty
  • A non-final segment contains a non-node value that cannot be navigated through
  • The DocStore operation fails
Source

pub async fn set_path_str( &self, path: &str, value: impl Into<Value>, ) -> Result<()>

Sets a value at the given path with string paths for runtime normalization

Source

pub async fn modify_path<T, F>( &self, path: impl AsRef<Path>, f: F, ) -> Result<()>
where T: for<'a> TryFrom<&'a Value, Error = CRDTError> + Into<Value>, F: FnOnce(&mut T),

Modifies a value at a path in-place using a closure

Similar to modify() but works with dot-notation paths for nested access. This method follows the DocStore staging model by checking local staged data first, then falling back to historical data from the backend.

§Errors

Returns an error if:

  • The path doesn’t exist (SubtreeError::KeyNotFound)
  • The value cannot be converted to type T (CRDTError::TypeMismatch)
  • Setting the path fails (CRDTError::InvalidPath)
§Examples
let txn = database.new_transaction().await?;
let store = txn.get_store::<DocStore>("data").await?;

store.set_path(path!("user.score"), 100).await?;

store.modify_path::<i64, _>(path!("user.score"), |score| {
    *score += 50;
}).await?;

assert_eq!(store.get_path_as::<i64>(path!("user.score")).await?, 150);
Source

pub async fn modify_path_str<T, F>(&self, path: &str, f: F) -> Result<()>
where T: for<'a> TryFrom<&'a Value, Error = CRDTError> + Into<Value>, F: FnOnce(&mut T),

Modify a value at a path with string paths for runtime normalization

Source

pub async fn delete(&self, key: impl AsRef<str>) -> Result<bool>

Stages the deletion of a key within the associated Transaction.

This method removes the key-value pair from the Map data held within the Transaction for this Doc instance’s subtree name. A tombstone is created, which will propagate the deletion when merged with other data. The change is not persisted to the backend until the Transaction::commit() method is called.

When using the get method, deleted keys will return Error::NotFound. However, the deletion is still tracked internally as a tombstone, which ensures that the deletion propagates correctly when merging with other versions of the data.

§Examples
let txn = database.new_transaction().await?;
let store = txn.get_store::<DocStore>("my_data").await?;

// First set a value
store.set("user1", "Alice").await?;

// Later delete the value
store.delete("user1").await?;

// Attempting to get the deleted key will return NotFound
assert!(store.get("user1").await.is_err());

// You can verify the tombstone exists by checking the full state
let all_data = store.get_all().await?;
assert!(all_data.is_tombstone("user1"));
§Arguments
  • key - The key to delete.
§Returns
  • Ok(true) if the key existed and was deleted
  • Ok(false) if the key did not exist (no-op)
  • Err on serialization or staging errors
Source

pub async fn get_all(&self) -> Result<Doc>

Retrieves all key-value pairs as a Doc, merging staged and historical state.

This method combines the data staged within the current Transaction with the fully merged historical state from the backend, providing a complete view of the document as it would appear if the transaction were committed. The staged data takes precedence in case of conflicts (overwrites).

§Important: Understanding Nested Structure

When using set_path() with dot-notation paths, the data is stored as nested maps. The returned Doc will contain the top-level keys, with nested structures as Value::Doc values.

§Example:
let txn = database.new_transaction().await?;
let store = txn.get_store::<DocStore>("data").await?;

// Using set_path creates nested structure
store.set_path(path!("user.name"), "Alice").await?;
store.set_path(path!("user.age"), 30).await?;
store.set_path(path!("config.theme"), "dark").await?;

let all_data = store.get_all().await?;

// The top-level map has keys "user" and "config", NOT "user.name", "user.age", etc.
assert_eq!(all_data.len(), 2); // Only 2 top-level keys

// To access nested data from get_all():
if let Some(Value::Doc(user_node)) = all_data.get("user") {
    // user_node contains "name" and "age" as its children
    assert_eq!(user_node.get("name"), Some(&Value::Text("Alice".to_string())));
    assert_eq!(user_node.get("age"), Some(&Value::Text("30".to_string())));
}

// For direct access, use get_path() or get_path_as() instead:
assert_eq!(store.get_path_as::<String>(path!("user.name")).await?, "Alice");
§Returns

A Result containing the merged Doc data structure with nested maps for path-based data.

Source

pub async fn contains_key(&self, key: impl AsRef<str>) -> bool

Returns true if the DocStore contains the given key

This method checks both local staged data and historical backend data following the DocStore staging model. A key is considered to exist if:

  • It exists in local staged data (and is not deleted)
  • It exists in backend data (and is not deleted)

Deleted keys (tombstones) are treated as non-existent.

§Examples
let txn = database.new_transaction().await?;
let store = txn.get_store::<DocStore>("data").await?;

assert!(!store.contains_key("missing").await); // Key doesn't exist

store.set("name", "Alice").await?;
assert!(store.contains_key("name").await); // Key exists in staging

store.delete("name").await?;
assert!(!store.contains_key("name").await); // Key deleted (tombstone)
Source

pub async fn contains_path(&self, path: impl AsRef<Path>) -> bool

Returns true if the DocStore contains the given path

This method checks both local staged data and historical backend data following the DocStore staging model. A path is considered to exist if:

  • The complete path exists and points to a non-deleted value
  • All intermediate segments are navigable (nodes or lists)
§Path Syntax

Uses the same dot notation as other path methods:

  • Docs: Navigate by key name (e.g., “user.profile.name”)
  • Lists: Navigate by index (e.g., “items.0.title”)
  • Mixed: Combine both (e.g., “users.0.tags.1”)
§Examples
let txn = database.new_transaction().await?;
let store = txn.get_store::<DocStore>("data").await?;

assert!(!store.contains_path(path!("user.name")).await); // Path doesn't exist

store.set_path(path!("user.profile.name"), "Alice").await?;
assert!(store.contains_path(path!("user")).await); // Intermediate path exists
assert!(store.contains_path(path!("user.profile")).await); // Intermediate path exists
assert!(store.contains_path(path!("user.profile.name")).await); // Full path exists
assert!(!store.contains_path(path!("user.profile.age")).await); // Path doesn't exist
Source

pub async fn contains_path_str(&self, path: &str) -> bool

Returns true if the DocStore contains the given path with string paths for runtime normalization

Source§

impl DocStore

Source

pub fn get_value_mut(&self, key: impl Into<String>) -> ValueEditor<'_>

Gets a mutable editor for a value associated with the given key.

If the key does not exist, the editor will be initialized with an empty map, allowing immediate use of map-modifying methods. The type can be changed later using ValueEditor::set().

Changes made via the ValueEditor are staged in the Transaction by its set method and must be committed via Transaction::commit() to be persisted to the Doc’s backend.

Source

pub fn get_root_mut(&self) -> ValueEditor<'_>

Gets a mutable editor for the root of this Doc’s subtree.

Changes made via the ValueEditor are staged in the Transaction by its set method and must be committed via Transaction::commit() to be persisted to the Doc’s backend.

Source

pub async fn get_at_path<S, P>(&self, path: P) -> Result<Value>
where S: AsRef<str>, P: AsRef<[S]>,

Retrieves a Value from the Doc using a specified path.

The path is a slice of strings, where each string is a key in the nested map structure. If the path is empty, it retrieves the entire content of this Doc’s named subtree as a Value::Doc.

This method operates on the fully merged view of the Doc’s data, including any local changes from the current Transaction layered on top of the backend state.

§Arguments
  • path: A slice of String representing the path to the desired value.
§Errors
  • Error::NotFound if any segment of the path does not exist (for non-empty paths), or if the final value or an intermediate value is a Value::Deleted (tombstone).
  • Error::Io with ErrorKind::InvalidData if a non-map value is encountered during path traversal where a map was expected.
Source

pub async fn set_at_path<S, P>(&self, path: P, value: Value) -> Result<()>
where S: Into<String> + Clone, P: AsRef<[S]>,

Sets a Value at a specified path within the Doc’s Transaction.

The path is a slice of strings, where each string is a key in the nested map structure.

This method modifies the local data associated with the Transaction. The changes are not persisted to the backend until Transaction::commit() is called. If the path does not exist, it will be created. Intermediate non-map values in the path will be overwritten by maps as needed to complete the path.

§Arguments
  • path: A slice of String representing the path where the value should be set.
  • value: The Value to set at the specified path.
§Errors
  • Error::InvalidOperation if the path is empty and value is not a Value::Doc.
  • Error::Serialize if the updated subtree data cannot be serialized to JSON.
  • Potentially other errors from Transaction::update_subtree.

Trait Implementations§

Source§

impl Registered for DocStore

Source§

fn type_id() -> &'static str

Returns a unique identifier for this type. Read more
Source§

fn supports_type_id(type_id: &str) -> bool

Check if this type supports loading from a stored type_id. Read more
Source§

impl Store for DocStore

Source§

type Data = Doc

The CRDT data type used for local (staged) data in this store. Read more
Source§

fn new<'life0, 'async_trait>( txn: &'life0 Transaction, subtree_name: String, ) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Creates a new Store handle associated with a specific transaction. Read more
Source§

fn name(&self) -> &str

Returns the name of this subtree.
Source§

fn transaction(&self) -> &Transaction

Returns a reference to the transaction this Store is associated with. Read more
Source§

fn default_config() -> Doc

Returns the default configuration for this Store type as a Doc. Read more
Source§

fn init<'life0, 'async_trait>( txn: &'life0 Transaction, subtree_name: String, ) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Initializes a new subtree and registers it in the _index. Read more
Source§

fn get_config<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Doc>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Gets the current configuration for this Store from the _index subtree. Read more
Source§

fn set_config<'life0, 'async_trait>( &'life0 self, config: Doc, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Sets the configuration for this Store in the _index subtree. Read more
Source§

fn get_height_strategy<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Option<HeightStrategy>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Gets the height strategy for this Store from the _index subtree. Read more
Source§

fn set_height_strategy<'life0, 'async_trait>( &'life0 self, strategy: Option<HeightStrategy>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Sets the height strategy for this Store in the _index subtree. Read more
Source§

fn local_data(&self) -> Result<Option<Self::Data>>

Returns the local (staged) data for this store from the current transaction. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CompatExt for T

§

fn compat(self) -> Compat<T>

Applies the [Compat] adapter by value. Read more
§

fn compat_ref(&self) -> Compat<&T>

Applies the [Compat] adapter by shared reference. Read more
§

fn compat_mut(&mut self) -> Compat<&mut T>

Applies the [Compat] adapter by mutable reference. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more