[][src]Struct raystack::Ref

pub struct Ref(_);

A Haystack Ref.

Methods

impl Ref[src]

pub fn new(s: String) -> Result<Self, ParseRefError>[src]

Create a new Ref.

Example

use raystack::Ref;
let my_ref = Ref::new("@p:bigProject:r:24efe1c4-24aef280".to_string()).unwrap();

pub fn from_encoded_json_string(
    json_string: &str
) -> Result<Self, ParseRefError>
[src]

Return a Ref by decoding a ref which was encoded in a JSON string. In raw JSON strings, ref are formatted with a r: prefix instead of an @ sign.

Example

use raystack::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 Eq for Ref[src]

impl Clone for Ref[src]

impl PartialEq<Ref> for Ref[src]

impl Debug for Ref[src]

impl FromStr for Ref[src]

type Err = ParseRefError

The associated error which can be returned from parsing.

Auto Trait Implementations

impl Unpin for Ref

impl Sync for Ref

impl Send for Ref

impl UnwindSafe for Ref

impl RefUnwindSafe for Ref

Blanket Implementations

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

type Owned = T

The resulting type after obtaining ownership.

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

impl<T> From<T> for T[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.

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

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

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

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

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

impl<T> Erased for T

impl<'a, T> TryFrom<&'a str> for T where
    T: FromStr

type Err = <T as FromStr>::Err

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

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