Skip to main content

Spore

Struct Spore 

Source
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: String

Implementations§

Source§

impl Spore

Source

pub fn new( domain: &str, name: &str, synopsis: &str, intent: Vec<String>, license: &str, ) -> Self

Create a new spore (unsigned, uri placeholder)

Source

pub fn uri(&self) -> &str

Source

pub fn author_domain(&self) -> &str

Source

pub fn timestamp_ms(&self) -> u64

Source

pub fn embedded_core_key(&self) -> Option<&str>

Source

pub fn effective_author_key<'a>(&'a self, host_key: &'a str) -> &'a str

Returns the effective author key: the embedded core.key if present, otherwise falls back to the given host key.

Source

pub fn extract_bonds(&self) -> Vec<BondProjection>

Extract lightweight bond projections from this spore’s bonds.

Source

pub fn tree(&self) -> &SporeTree

Source

pub fn distributions(&self) -> &[SporeDist]

Source

pub fn followed_strain_uris(&self) -> Vec<&str>

Source

pub fn follows_uri(&self, uri: &str) -> bool

Source

pub fn follows_all(&self, required_uris: &[&str]) -> bool

Source

pub fn extended_strain_uris(&self) -> Vec<&str>

Source

pub fn extends_uri(&self, uri: &str) -> bool

Source

pub fn extends_all(&self, required_uris: &[&str]) -> bool

Source

pub fn is_strain_definition(&self, accepted_root_lineage_uris: &[&str]) -> bool

Source

pub fn spawned_from_uri(&self) -> Option<&str>

Source

pub fn spawned_from_hash(&self) -> Option<String>

Source

pub fn verify_core_signature(&self, author_key: &str) -> Result<()>

Source

pub fn verify_capsule_signature(&self, host_key: &str) -> Result<()>

Source

pub fn verify_signatures(&self, host_key: &str, author_key: &str) -> Result<()>

Source

pub fn verify_self_hosted_signatures(&self, key: &str) -> Result<()>

Verify both signatures using the same key (self-hosted case where host == author).

Source

pub fn computed_uri_hash_from_tree_hash( &self, tree_hash: &str, ) -> Result<String>

Source

pub fn verify_uri_hash_from_tree_hash( &self, expected_hash: &str, tree_hash: &str, ) -> Result<()>

Source

pub fn verify_content_hash( &self, entries: &[TreeEntry], expected_hash: &str, ) -> Result<()>

Source

pub fn verify_content_hash_and_size( &self, entries: &[TreeEntry], expected_hash: &str, ) -> Result<()>

Verify content hash and size_bytes match the manifest. Returns an error if hash or size mismatch.

Trait Implementations§

Source§

impl Clone for Spore

Source§

fn clone(&self) -> Spore

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Spore

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Spore

Source§

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

Source§

impl Serialize for Spore

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,