pub struct Spore {
pub schema: String,
pub capsule: SporeCapsule,
pub capsule_signature: String,
}Expand description
Full Spore manifest (content-addressed)
Fields§
§schema: String§capsule: SporeCapsule§capsule_signature: StringImplementations§
Source§impl Spore
impl Spore
Sourcepub fn new(
domain: &str,
name: &str,
synopsis: &str,
intent: Vec<String>,
license: &str,
) -> Self
pub fn new( domain: &str, name: &str, synopsis: &str, intent: Vec<String>, license: &str, ) -> Self
Create a new spore (unsigned, uri placeholder)
pub fn uri(&self) -> &str
pub fn timestamp_ms(&self) -> u64
pub fn embedded_core_key(&self) -> Option<&str>
Returns the effective author key: the embedded core.key if present,
otherwise falls back to the given host key.
Sourcepub fn extract_bonds(&self) -> Vec<BondProjection>
pub fn extract_bonds(&self) -> Vec<BondProjection>
Extract lightweight bond projections from this spore’s bonds.
pub fn tree(&self) -> &SporeTree
pub fn distributions(&self) -> &[SporeDist]
pub fn followed_strain_uris(&self) -> Vec<&str>
pub fn follows_uri(&self, uri: &str) -> bool
pub fn follows_all(&self, required_uris: &[&str]) -> bool
pub fn extended_strain_uris(&self) -> Vec<&str>
pub fn extends_uri(&self, uri: &str) -> bool
pub fn extends_all(&self, required_uris: &[&str]) -> bool
pub fn is_strain_definition(&self, accepted_root_lineage_uris: &[&str]) -> bool
pub fn spawned_from_uri(&self) -> Option<&str>
pub fn spawned_from_hash(&self) -> Option<String>
pub fn verify_core_signature(&self, author_key: &str) -> Result<()>
pub fn verify_capsule_signature(&self, host_key: &str) -> Result<()>
pub fn verify_signatures(&self, host_key: &str, author_key: &str) -> Result<()>
Sourcepub fn verify_self_hosted_signatures(&self, key: &str) -> Result<()>
pub fn verify_self_hosted_signatures(&self, key: &str) -> Result<()>
Verify both signatures using the same key (self-hosted case where host == author).
pub fn computed_uri_hash_from_tree_hash( &self, tree_hash: &str, ) -> Result<String>
pub fn verify_uri_hash_from_tree_hash( &self, expected_hash: &str, tree_hash: &str, ) -> Result<()>
pub fn verify_content_hash( &self, entries: &[TreeEntry], expected_hash: &str, ) -> Result<()>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Spore
impl<'de> Deserialize<'de> for Spore
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PrettyJson for Spore
impl PrettyJson for Spore
fn to_pretty_json(&self) -> Result<String>
Auto Trait Implementations§
impl Freeze for Spore
impl RefUnwindSafe for Spore
impl Send for Spore
impl Sync for Spore
impl Unpin for Spore
impl UnsafeUnpin for Spore
impl UnwindSafe for Spore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more