pub trait Trove<T> {
// Required methods
fn trove_type() -> DataAddress;
fn to_bytes(trove: &T) -> Result<Bytes>;
async fn from_bytes(client: &DwebClient, bytes: Bytes) -> Result<T>;
}Expand description
gives access to every version of the struct that has ever been stored on Autonomi.
Each History
For read-only access, only the address of the history is needed, which gives access to both the first entry in the history and the most recent.
For write access, both the owning secret key and the name must be provided.
Example, using the built-in dweb::trove::Tree struct you can store and access every published version of a tree of files, which might represent a website.
Notes:
- the dweb-cli supports viewing of versioned websites and directories using a standard web browser, including viewing every version published on Autonomi (similar to the Internet Archive).
- History manages a sequence of versions of a struct implementing Trove, amounting to a versioned history for any struct impl Trove.
Required Methods§
fn trove_type() -> DataAddress
fn to_bytes(trove: &T) -> Result<Bytes>
async fn from_bytes(client: &DwebClient, bytes: Bytes) -> Result<T>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.