Struct hdk::hash_path::anchor::Anchor[][src]

pub struct Anchor {
    pub anchor_type: String,
    pub anchor_text: Option<String>,
}

An anchor can only be 1 or 2 levels deep as “type” and “text”.

The second level is optional and the Strings use the standard TryInto for path Component internally.

Anchors are required to be included in an application’s entry_defs callback and so implement all the standard methods. Technically the Anchor entry definition is the Path definition.

e.g. entry_defs![Anchor::entry_def()]

The methods implemented on anchor follow the patterns that predate the Path module but Path::from(&anchor) is always possible to use the newer APIs.

Fields

anchor_type: Stringanchor_text: Option<String>

Trait Implementations

impl Clone for Anchor[src]

impl Debug for Anchor[src]

impl<'de> Deserialize<'de> for Anchor[src]

impl EntryDefRegistration for Anchor[src]

impl From<&'_ Anchor> for EntryDef where
    Anchor: EntryDefRegistration
[src]

impl From<&'_ Anchor> for EntryDefId where
    Anchor: EntryDefRegistration
[src]

impl From<&'_ Anchor> for EntryVisibility where
    Anchor: EntryDefRegistration
[src]

impl From<&'_ Anchor> for CrdtType where
    Anchor: EntryDefRegistration
[src]

impl From<&'_ Anchor> for RequiredValidations where
    Anchor: EntryDefRegistration
[src]

impl From<&'_ Anchor> for Path[src]

Anchors are just a special case of path, so we can move from anchor to path losslessly. We simply format the anchor structure into a string that works with the path string handling.

impl From<Anchor> for EntryDef where
    Anchor: EntryDefRegistration
[src]

impl From<Anchor> for EntryDefId where
    Anchor: EntryDefRegistration
[src]

impl From<Anchor> for EntryVisibility where
    Anchor: EntryDefRegistration
[src]

impl From<Anchor> for CrdtType where
    Anchor: EntryDefRegistration
[src]

impl From<Anchor> for RequiredValidations where
    Anchor: EntryDefRegistration
[src]

impl PartialEq<Anchor> for Anchor[src]

impl Serialize for Anchor[src]

impl StructuralPartialEq for Anchor[src]

impl TryFrom<&'_ Anchor> for SerializedBytes[src]

type Error = SerializedBytesError

The type returned in the event of a conversion error.

impl TryFrom<&'_ Anchor> for Entry[src]

type Error = WasmError

The type returned in the event of a conversion error.

impl TryFrom<&'_ Anchor> for EntryWithDefId where
    Anchor: EntryDefRegistration
[src]

type Error = WasmError

The type returned in the event of a conversion error.

impl TryFrom<&'_ Entry> for Anchor[src]

type Error = WasmError

The type returned in the event of a conversion error.

impl TryFrom<&'_ Path> for Anchor[src]

Paths are more general than anchors so a path could be represented that is not a valid anchor. The obvious example would be a path of binary data that is not valid utf-8 strings or a path that is more than 2 levels deep.

type Error = SerializedBytesError

The type returned in the event of a conversion error.

impl TryFrom<Anchor> for SerializedBytes[src]

type Error = SerializedBytesError

The type returned in the event of a conversion error.

impl TryFrom<Anchor> for Entry[src]

type Error = WasmError

The type returned in the event of a conversion error.

impl TryFrom<Anchor> for EntryWithDefId[src]

type Error = WasmError

The type returned in the event of a conversion error.

impl TryFrom<Entry> for Anchor[src]

type Error = WasmError

The type returned in the event of a conversion error.

impl TryFrom<SerializedBytes> for Anchor[src]

type Error = SerializedBytesError

The type returned in the event of a conversion error.

Auto Trait Implementations

impl RefUnwindSafe for Anchor

impl Send for Anchor

impl Sync for Anchor

impl Unpin for Anchor

impl UnwindSafe for Anchor

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<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> 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, 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<V, T> VZip<V> for T where
    V: MultiLane<T>,