Skip to content

feat(iroh-net): Export the Ticket trait #2765

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions iroh-base/src/ticket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ mod node;
#[cfg(feature = "key")]
pub use self::{blob::BlobTicket, node::NodeTicket};

/// A ticket is a serializable object that combines all information required
/// for an operation. E.g. an iroh blob ticket would contain the hash of the
/// data as well as information about how to reach the provider.
/// A ticket is a serializable object combining information required for an operation.
///
/// Typically tickets contain all information required for an operation, e.g. an iroh blob
/// ticket would contain the hash of the data as well as information about how to reach the
/// provider.
///
/// Tickets support serialization to a string using base32 encoding. The kind of
/// ticket will be prepended to the string to make it somewhat self describing.
Expand Down
4 changes: 3 additions & 1 deletion iroh-base/src/ticket/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ use crate::{
/// This allows establishing a connection to the node in most circumstances where it is
/// possible to do so.
///
/// This [`NodeTicket`] is a single item which can be easily serialized and deserialized.
/// This [`NodeTicket`] is a single item which can be easily serialized and deserialized and
/// implements the [`Ticket`] trait. The [`Display`] and [`FromStr`] traits can also be
/// used to round-trip the ticket to string.
///
/// [`NodeId`]: crate::key::NodeId
#[derive(Debug, Clone, PartialEq, Eq, derive_more::Display)]
Expand Down
1 change: 1 addition & 0 deletions iroh-net/src/ticket.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
//! Tickets supported by iroh-net
pub use iroh_base::ticket::NodeTicket;
pub use iroh_base::ticket::Ticket;
Loading