pub struct LicencePolicy {
pub class: LicenceClass,
pub use_class: UseClass,
pub redistribution: RedistributionClass,
pub obligations: LicenceObligations,
pub terms_url: String,
pub attribution: String,
}Expand description
Full licence policy recorded on a Q42 asset envelope.
Fields§
§class: LicenceClass§use_class: UseClass§redistribution: RedistributionClass§obligations: LicenceObligations§terms_url: StringUpstream terms URL (may be empty only for CC0 when explicitly recorded).
attribution: StringImplementations§
Source§impl LicencePolicy
impl LicencePolicy
Sourcepub fn try_new(
class: LicenceClass,
use_class: UseClass,
redistribution: RedistributionClass,
terms_url: impl Into<String>,
attribution: impl Into<String>,
) -> Result<Self, AssetEnvelopeError>
pub fn try_new( class: LicenceClass, use_class: UseClass, redistribution: RedistributionClass, terms_url: impl Into<String>, attribution: impl Into<String>, ) -> Result<Self, AssetEnvelopeError>
Build a policy from explicit classes. Unknown licence fails closed.
Sourcepub fn from_tag(
tag: &str,
terms_url: impl Into<String>,
attribution: impl Into<String>,
) -> Result<Self, AssetEnvelopeError>
pub fn from_tag( tag: &str, terms_url: impl Into<String>, attribution: impl Into<String>, ) -> Result<Self, AssetEnvelopeError>
Parse from a short licence tag plus recorded terms. Unknown tags fail closed.
Sourcepub fn is_spc_discharged(&self, accumulated_pool: u64, cost: u64) -> bool
pub fn is_spc_discharged(&self, accumulated_pool: u64, cost: u64) -> bool
Check whether a Social Permissive Commons obligation has discharged based on accumulated payments meeting audited production cost + ROI cap.
Sourcepub fn allows_redistribution(&self) -> bool
pub fn allows_redistribution(&self) -> bool
May this asset (or a derived bundle) be redistributed outside the local node?
Sourcepub fn union_obligations(&self, other: &Self) -> Self
pub fn union_obligations(&self, other: &Self) -> Self
Most-restrictive union of two policies for a derived asset.
Trait Implementations§
Source§impl Clone for LicencePolicy
impl Clone for LicencePolicy
Source§impl Debug for LicencePolicy
impl Debug for LicencePolicy
impl Eq for LicencePolicy
Source§impl PartialEq for LicencePolicy
impl PartialEq for LicencePolicy
impl StructuralPartialEq for LicencePolicy
Auto Trait Implementations§
impl Freeze for LicencePolicy
impl RefUnwindSafe for LicencePolicy
impl Send for LicencePolicy
impl Sync for LicencePolicy
impl Unpin for LicencePolicy
impl UnsafeUnpin for LicencePolicy
impl UnwindSafe for LicencePolicy
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more