pub struct BlobTicket { /* private fields */ }
Expand description
A token containing everything to get a file from the provider.
It is a single item which can be easily serialized and deserialized.
Implementations§
Source§impl BlobTicket
impl BlobTicket
Sourcepub fn new(node: NodeAddr, hash: Hash, format: BlobFormat) -> Self
pub fn new(node: NodeAddr, hash: Hash, format: BlobFormat) -> Self
Creates a new ticket.
Sourcepub fn format(&self) -> BlobFormat
pub fn format(&self) -> BlobFormat
The BlobFormat
for this ticket.
pub fn hash_and_format(&self) -> HashAndFormat
Sourcepub fn recursive(&self) -> bool
pub fn recursive(&self) -> bool
True if the ticket is for a collection and should retrieve all blobs in it.
Sourcepub fn into_parts(self) -> (NodeAddr, Hash, BlobFormat)
pub fn into_parts(self) -> (NodeAddr, Hash, BlobFormat)
Get the contents of the ticket, consuming it.
Trait Implementations§
Source§impl Clone for BlobTicket
impl Clone for BlobTicket
Source§fn clone(&self) -> BlobTicket
fn clone(&self) -> BlobTicket
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for BlobTicket
impl Debug for BlobTicket
Source§impl<'de> Deserialize<'de> for BlobTicket
impl<'de> Deserialize<'de> for BlobTicket
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for BlobTicket
impl Display for BlobTicket
Source§impl From<BlobTicket> for HashAndFormat
impl From<BlobTicket> for HashAndFormat
Source§fn from(val: BlobTicket) -> Self
fn from(val: BlobTicket) -> Self
Converts to this type from the input type.
Source§impl FromStr for BlobTicket
impl FromStr for BlobTicket
Source§impl PartialEq for BlobTicket
impl PartialEq for BlobTicket
Source§impl Serialize for BlobTicket
impl Serialize for BlobTicket
Source§impl Ticket for BlobTicket
impl Ticket for BlobTicket
Source§fn from_bytes(bytes: &[u8]) -> Result<Self, ParseError>
fn from_bytes(bytes: &[u8]) -> Result<Self, ParseError>
Deserialize from the base32 string representation bytes.
Source§fn deserialize(str: &str) -> Result<Self, ParseError>
fn deserialize(str: &str) -> Result<Self, ParseError>
Deserialize from a string.
impl Eq for BlobTicket
impl StructuralPartialEq for BlobTicket
Auto Trait Implementations§
impl Freeze for BlobTicket
impl RefUnwindSafe for BlobTicket
impl Send for BlobTicket
impl Sync for BlobTicket
impl Unpin for BlobTicket
impl UnwindSafe for BlobTicket
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> 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<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.