[][src]Struct raystack::Ref

pub struct 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.

impl PartialEq<Ref> for Ref[src]

impl StructuralEq for Ref[src]

impl StructuralPartialEq for Ref[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.