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

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

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

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.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.