pub struct DatabaseTicket { /* private fields */ }Expand description
A shareable link containing a database ID and optional transport address hints.
DatabaseTicket can be serialized to and parsed from a magnet-style URI:
eidetica:?db=sha256:abc...&pr=http:192.168.1.1:8080&pr=iroh:endpointABC...The database ID is passed through as an opaque string. Peer addresses use the transport’s native encoding, prefixed by the transport name and a colon if the encoding doesn’t already include it.
Implementations§
Source§impl DatabaseTicket
impl DatabaseTicket
Sourcepub fn with_addresses(database_id: ID, addresses: Vec<Address>) -> Self
pub fn with_addresses(database_id: ID, addresses: Vec<Address>) -> Self
Create a ticket with a database ID and address hints.
Sourcepub fn database_id(&self) -> &ID
pub fn database_id(&self) -> &ID
Get the database ID.
Sourcepub fn add_address(&mut self, address: Address)
pub fn add_address(&mut self, address: Address)
Add a transport address hint.
Trait Implementations§
Source§impl Clone for DatabaseTicket
impl Clone for DatabaseTicket
Source§fn clone(&self) -> DatabaseTicket
fn clone(&self) -> DatabaseTicket
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DatabaseTicket
impl Debug for DatabaseTicket
Source§impl<'de> Deserialize<'de> for DatabaseTicket
impl<'de> Deserialize<'de> for DatabaseTicket
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 Display for DatabaseTicket
impl Display for DatabaseTicket
Source§impl From<DatabaseTicket> for String
impl From<DatabaseTicket> for String
Source§fn from(ticket: DatabaseTicket) -> Self
fn from(ticket: DatabaseTicket) -> Self
Converts to this type from the input type.
Source§impl FromStr for DatabaseTicket
impl FromStr for DatabaseTicket
Source§impl PartialEq for DatabaseTicket
impl PartialEq for DatabaseTicket
Source§impl Serialize for DatabaseTicket
impl Serialize for DatabaseTicket
Source§impl TryFrom<String> for DatabaseTicket
impl TryFrom<String> for DatabaseTicket
impl Eq for DatabaseTicket
impl StructuralPartialEq for DatabaseTicket
Auto Trait Implementations§
impl Freeze for DatabaseTicket
impl RefUnwindSafe for DatabaseTicket
impl Send for DatabaseTicket
impl Sync for DatabaseTicket
impl Unpin for DatabaseTicket
impl UnwindSafe for DatabaseTicket
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,
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.