1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
//! Core AT Protocol repository types.
//!
//! This module contains fundamental types for the AT Protocol repository
//! system, including strong references that combine URIs with content
//! identifiers for immutable referencing.
use crate;
use ;
/// The namespace identifier for strong references
pub const STRONG_REF_NSID: &str = "com.atproto.repo.strongRef";
/// Strong reference to an AT Protocol record.
///
/// A strong reference combines an AT URI with a CID (Content Identifier),
/// providing both a location and a content hash. This ensures that the
/// reference points to a specific, immutable version of a record.
///
/// Strong references are commonly used to:
/// - Reference specific versions of records
/// - Create immutable links between records
/// - Ensure content integrity through CID verification
///
/// # Example
///
/// ```ignore
/// use atproto_record::lexicon::com::atproto::repo::{StrongRef, TypedStrongRef};
///
/// let strong_ref = StrongRef {
/// uri: "at://did:plc:example/app.bsky.feed.post/3k4duaz5vfs2b".to_string(),
/// cid: "bafyreib55ro5klxlwfxc5hzfonpdog6donvqvwdvjbloffqrmkenbqgpde".to_string(),
/// };
///
/// // Use TypedStrongRef for automatic $type field handling
/// let typed_ref = TypedStrongRef::new(strong_ref);
/// ```
/// Type alias for StrongRef with automatic $type field handling.
///
/// This type wrapper ensures that the `$type` field is automatically
/// added during serialization and validated during deserialization.
pub type TypedStrongRef = ;