Skip to main content

Crate atproto_dasl

Crate atproto_dasl 

Source
Expand description

DASL (Data-Addressed Structures & Links) implementation for AT Protocol.

This crate implements the DASL framework specifications:

  • CID: Content Identifiers - hashes with metadata for addressing resources by content
  • DRISL: Deterministic Representation for Interoperable Structures and Links - deterministic CBOR encoding/decoding with serde integration
  • CAR: Content-Addressable aRchives - serialized sets of content-addressed resources
  • MASL: Metadata for Arbitrary Structures & Links - CBOR metadata documents
  • RASL: Retrieval of Arbitrary Structures & Links - URL scheme and HTTP retrieval
  • BDASL: Big DASL - large file hashing with streaming verification
  • Web Tiles: Composable web documents and applications with security constraints

§Example Usage

use atproto_dasl::{to_vec, from_slice};
use serde::{Serialize, Deserialize};

#[derive(Serialize, Deserialize, Debug, PartialEq)]
struct Post {
    text: String,
    likes: u64,
}

let post = Post { text: "Hello!".into(), likes: 42 };

// Serialize to DAG-CBOR bytes
let bytes = to_vec(&post).unwrap();

// Deserialize back
let decoded: Post = from_slice(&bytes).unwrap();
assert_eq!(post, decoded);

Re-exports§

pub use cid::Cid;
pub use cid::DAG_CBOR_CODEC;
pub use cid::DaslCid;
pub use cid::MULTIBASE_IDENTITY;
pub use cid::RawCid;
pub use cid::compute_cid_blake3;
pub use cid::compute_cid_for;
pub use cid::compute_raw_cid;
pub use cid::compute_raw_cid_blake3;
pub use cid::verify_cid_bytes;
pub use cid::verify_cid_reader;
pub use drisl::DecodeConfig;
pub use drisl::EncodeConfig;
pub use drisl::TimeMode;
pub use drisl::from_reader;
pub use drisl::from_reader_non_strict;
pub use drisl::from_reader_with_config;
pub use drisl::from_slice;
pub use drisl::from_slice_non_strict;
pub use drisl::from_slice_with_config;
pub use drisl::to_vec;
pub use drisl::to_vec_with_config;
pub use drisl::to_writer;
pub use drisl::to_writer_with_config;
pub use errors::CarError;
pub use errors::DaslCidError;
pub use errors::DecodeError;
pub use errors::EncodeError;
pub use errors::MaslError;
pub use errors::RaslError;
pub use errors::StorageError;
pub use errors::TilesError;
pub use errors::VarintError;
pub use value::Ipld;
pub use car::CarBlock;
pub use car::CarConfig;
pub use car::CarHeader;
pub use car::CarReader;
pub use car::CarWriter;
pub use car::LimitsConfig;
pub use storage::BlockStorage;
pub use storage::DiskStorage;
pub use storage::MemoryStorage;
pub use storage::SpillableBuffer;
pub use storage::SpillableReader;

Modules§

bdasl
BDASL (Big DASL).
car
CAR v1 (Content Addressable aRchive) implementation.
cid
CID (Content Identifier) support for DAG-CBOR.
drisl
DRISL (Deterministic Representation for Interoperable Structures and Links).
errors
Structured error types for DASL operations.
masl
MASL (Metadata for Arbitrary Structures & Links).
rasl
RASL (Retrieval of Arbitrary Structures & Links).
storage
Storage abstraction for block storage backends.
tiles
Web Tiles: composable web documents and applications.
value
IPLD Data Model value representation.
varint
Unsigned LEB128 varint encoding for CAR format.

Type Aliases§

CidCore
A Cid that contains a multihash with an allocated size of 512 bits.