[−][src]Struct raystack::Ref
A Haystack Ref.
Implementations
impl Ref
[src]
pub fn new(s: String) -> Result<Ref, ParseRefError>
[src]
Create a new Ref
.
Example
use raystack_core::Ref; let my_ref = Ref::new("@p:bigProject:r:24efe1c4-24aef280".to_string()).unwrap();
pub fn from_encoded_json_string(json_string: &str) -> Result<Ref, ParseRefError>
[src]
Return a Ref by decoding a ref which was encoded in a JSON string. In
raw JSON strings, refs are formatted with a r:
prefix instead of
an @
sign.
Example
use raystack_core::Ref; let json_str = "r:p:bigProject:r:24efe1c4-24aef280"; let my_ref = Ref::from_encoded_json_string(json_str).unwrap();
pub fn to_encoded_json_string(&self) -> String
[src]
Return a string containing this ref, encoded with a r:
prefix instead
of with an @
sign. This representation for refs is used in raw
JSON strings sent to and from a Haystack server.
pub fn into_string(self) -> String
[src]
Convert this ref into a string.
pub fn to_axon_code(&self) -> &str
[src]
Return this ref as an Axon ref literal.
Trait Implementations
impl AsRef<str> for Ref
[src]
impl Clone for Ref
[src]
impl Debug for Ref
[src]
impl Display for Ref
[src]
impl Eq for Ref
[src]
impl FromStr for Ref
[src]
type Err = ParseRefError
The associated error which can be returned from parsing.
pub fn from_str(s: &str) -> Result<Ref, <Ref as FromStr>::Err>
[src]
impl PartialEq<Ref> for Ref
[src]
impl StructuralEq for Ref
[src]
impl StructuralPartialEq for Ref
[src]
Auto Trait Implementations
impl RefUnwindSafe for Ref
[src]
impl Send for Ref
[src]
impl Sync for Ref
[src]
impl Unpin for Ref
[src]
impl UnwindSafe for Ref
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
pub fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,