pub struct SubjectRef { /* private fields */ }Expand description
Re-export canonical pack value types used by core public structs. Typed reference to the subject a fact, proposal, intent, or citation is about.
ActorId answers “who”; ContextKey answers “where in the convergence
state”; SubjectRef answers “what object is being reasoned about.” The
canonical wire form is scheme://kind/id, where scheme is the owning app
or domain, kind is an app-owned noun, and id is opaque to Converge.
Implementations§
Source§impl SubjectRef
impl SubjectRef
Sourcepub fn new(
scheme: impl Into<String>,
kind: impl Into<String>,
id: impl Into<String>,
) -> Result<SubjectRef, SubjectRefError>
pub fn new( scheme: impl Into<String>, kind: impl Into<String>, id: impl Into<String>, ) -> Result<SubjectRef, SubjectRefError>
Creates a typed subject reference after validating and normalizing its structural parts.
scheme and kind are normalized to ASCII lowercase. id is
preserved exactly after validation because apps own its semantics.
Sourcepub fn parse(value: &str) -> Result<SubjectRef, SubjectRefError>
pub fn parse(value: &str) -> Result<SubjectRef, SubjectRefError>
Parses the canonical scheme://kind/id wire form.
Trait Implementations§
Source§impl Clone for SubjectRef
impl Clone for SubjectRef
Source§fn clone(&self) -> SubjectRef
fn clone(&self) -> SubjectRef
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SubjectRef
impl Debug for SubjectRef
Source§impl<'de> Deserialize<'de> for SubjectRef
impl<'de> Deserialize<'de> for SubjectRef
Source§fn deserialize<D>(
deserializer: D,
) -> Result<SubjectRef, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<SubjectRef, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for SubjectRef
impl Display for SubjectRef
impl Eq for SubjectRef
Source§impl FromStr for SubjectRef
impl FromStr for SubjectRef
Source§type Err = SubjectRefError
type Err = SubjectRefError
The associated error which can be returned from parsing.
Source§fn from_str(value: &str) -> Result<SubjectRef, <SubjectRef as FromStr>::Err>
fn from_str(value: &str) -> Result<SubjectRef, <SubjectRef as FromStr>::Err>
Parses a string
s to return a value of this type. Read moreSource§impl Hash for SubjectRef
impl Hash for SubjectRef
Source§impl Ord for SubjectRef
impl Ord for SubjectRef
Source§fn cmp(&self, other: &SubjectRef) -> Ordering
fn cmp(&self, other: &SubjectRef) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for SubjectRef
impl PartialEq for SubjectRef
Source§fn eq(&self, other: &SubjectRef) -> bool
fn eq(&self, other: &SubjectRef) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for SubjectRef
impl PartialOrd for SubjectRef
Source§impl Serialize for SubjectRef
impl Serialize for SubjectRef
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for SubjectRef
Auto Trait Implementations§
impl Freeze for SubjectRef
impl RefUnwindSafe for SubjectRef
impl Send for SubjectRef
impl Sync for SubjectRef
impl Unpin for SubjectRef
impl UnsafeUnpin for SubjectRef
impl UnwindSafe for SubjectRef
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.