pub struct Link(/* private fields */);Expand description
A Link is a wrapper around a CID (Content Identifier) representing a reference to content stored via the iroh-blobs protocol.
Implementations§
Source§impl Link
impl Link
Sourcepub fn ticket(
&self,
source: PublicKey,
format: Option<BlobFormat>,
) -> BlobTicket
pub fn ticket( &self, source: PublicKey, format: Option<BlobFormat>, ) -> BlobTicket
Create a ticket for this link with an optional blob format
By default uses BlobFormat::Raw. For HashSeq collections, pass BlobFormat::HashSeq.
Trait Implementations§
Source§impl Default for Link
§Links
A Link is a reference to a block of data stored
by the iroh-blobs protocol.
Links are implemented as Blake3 only multihashes wrapped in CIDs.
CIDs encoding is used to communicate the expected encoding of
the referenced content, while HashAndFormat is used for the
retrieval of data over the iroh_blobs protocol.
For our purposes, we keep the following assumptions:
impl Default for Link
§Links
A Link is a reference to a block of data stored by the iroh-blobs protocol. Links are implemented as Blake3 only multihashes wrapped in CIDs. CIDs encoding is used to communicate the expected encoding of the referenced content, while HashAndFormat is used for the retrieval of data over the iroh_blobs protocol. For our purposes, we keep the following assumptions:
- hashes are always blake3, and usually generated by iroh-blobs
- links may either be RAW or DAG-CBOR encoded depending on whether they
point to:
- public raw data (RAW)
- private raw data (RAW)
- private structured data (RAW, but underlying format is DAG-CBOR)
- public structured data (DAG-CBOR)
Source§impl<'de> Deserialize<'de> for Link
impl<'de> Deserialize<'de> for Link
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<Link> for HashAndFormat
impl From<Link> for HashAndFormat
Source§impl From<Link> for LinkedData
impl From<Link> for LinkedData
Source§impl Ord for Link
impl Ord for Link
Source§impl PartialOrd for Link
impl PartialOrd for Link
impl Eq for Link
impl StructuralPartialEq for Link
Auto Trait Implementations§
impl Freeze for Link
impl RefUnwindSafe for Link
impl Send for Link
impl Sync for Link
impl Unpin for Link
impl UnwindSafe for Link
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.