pub struct Manifest {Show 14 fields
pub codex: String,
pub id: DocumentId,
pub state: DocumentState,
pub created: DateTime<Utc>,
pub modified: DateTime<Utc>,
pub content: ContentRef,
pub metadata: Metadata,
pub hash_algorithm: HashAlgorithm,
pub presentation: Vec<PresentationRef>,
pub assets: Option<AssetManifest>,
pub security: Option<SecurityRef>,
pub phantoms: Option<PhantomsRef>,
pub extensions: Vec<Extension>,
pub lineage: Option<Lineage>,
}Expand description
Document manifest - the root metadata structure.
Fields§
§codex: StringSpecification version (e.g., “0.1”).
id: DocumentIdContent-addressable document identifier.
state: DocumentStateDocument lifecycle state.
created: DateTime<Utc>Creation timestamp.
modified: DateTime<Utc>Last modification timestamp.
content: ContentRefContent layer reference.
metadata: MetadataMetadata references.
hash_algorithm: HashAlgorithmHash algorithm used (defaults to SHA-256).
presentation: Vec<PresentationRef>Presentation layer references.
assets: Option<AssetManifest>Asset manifest.
security: Option<SecurityRef>Security layer reference.
phantoms: Option<PhantomsRef>Phantom clusters reference.
extensions: Vec<Extension>Active extensions.
lineage: Option<Lineage>Version history and parent reference.
Implementations§
Source§impl Manifest
impl Manifest
Sourcepub fn new(content: ContentRef, metadata: Metadata) -> Self
pub fn new(content: ContentRef, metadata: Metadata) -> Self
Create a new manifest with required fields.
Sourcepub fn has_extension(&self, namespace: &str) -> bool
pub fn has_extension(&self, namespace: &str) -> bool
Check if an extension is declared in the manifest.
Extension IDs use dot notation like “codex.semantic” or “codex.legal”. This method checks if the given namespace (e.g., “semantic”, “legal”) matches any declared extension.
Sourcepub fn get_extension(&self, namespace: &str) -> Option<&Extension>
pub fn get_extension(&self, namespace: &str) -> Option<&Extension>
Get a declared extension by namespace.
Returns the extension declaration if found.
Sourcepub fn declared_extension_ids(&self) -> Vec<&str>
pub fn declared_extension_ids(&self) -> Vec<&str>
Get all declared extension IDs.
Sourcepub fn validate(&self) -> Result<()>
pub fn validate(&self) -> Result<()>
Check if the manifest is valid.
§Errors
Returns an error if:
- The Codex version is unsupported
- State requirements are not met (e.g., frozen documents without signatures)
Sourcepub fn has_precise_layout(&self) -> bool
pub fn has_precise_layout(&self) -> bool
Check if the manifest contains a precise layout reference.
Sourcepub fn precise_layouts(&self) -> Vec<&PresentationRef>
pub fn precise_layouts(&self) -> Vec<&PresentationRef>
Get all precise layout references.