Struct BroadcastTicket
pub struct BroadcastTicket { /* private fields */ }Expand description
A publisher’s endpoint id and the path of one of its broadcasts.
The string form is ilv1:<peer>/<path>. <peer> is the endpoint id in
lowercase base32. Any segment of the path that equals the peer’s own id is
written as ~, and every other byte outside [A-Za-z0-9._-] is
percent-encoded. Parsing accepts the id in base32 of either case, or in
lowercase hex. Serde uses the string form.
A ticket says nothing about layouts: the path is whatever the publisher published at.
§Examples
use iroh_live_node::BroadcastTicket;
use moq_net::Path;
let peer = iroh::SecretKey::generate().public();
let path = Path::new(&format!("live/{peer}/studio"))?;
let ticket = BroadcastTicket::at(peer, path);
assert!(ticket.to_string().ends_with("/live/~/studio"));
let parsed: BroadcastTicket = ticket.to_string().parse()?;
assert_eq!(parsed, ticket);Implementations§
§impl BroadcastTicket
impl BroadcastTicket
pub const MAX_LEN: usize = 4000
pub const MAX_LEN: usize = 4000
The most bytes a ticket string may have.
A media relay mounts the string as one path, and moq allows 4096 bytes in one.
pub const MAX_PARTS: usize = 31
pub const MAX_PARTS: usize = 31
The most path segments a ticket may have.
A media relay mounts the string as one more segment, and moq allows 32.
pub fn at(peer: PublicKey, path: Path) -> BroadcastTicket
pub fn at(peer: PublicKey, path: Path) -> BroadcastTicket
Creates a ticket for the broadcast at path of peer.
A path that is too long for the string form still displays, but does not parse back.
Trait Implementations§
§impl Clone for BroadcastTicket
impl Clone for BroadcastTicket
§fn clone(&self) -> BroadcastTicket
fn clone(&self) -> BroadcastTicket
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for BroadcastTicket
impl Debug for BroadcastTicket
§impl<'de> Deserialize<'de> for BroadcastTicket
impl<'de> Deserialize<'de> for BroadcastTicket
§fn deserialize<D>(
deserializer: D,
) -> Result<BroadcastTicket, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<BroadcastTicket, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
§impl Display for BroadcastTicket
impl Display for BroadcastTicket
impl Eq for BroadcastTicket
§impl FromStr for BroadcastTicket
impl FromStr for BroadcastTicket
§fn from_str(
s: &str,
) -> Result<BroadcastTicket, <BroadcastTicket as FromStr>::Err>
fn from_str( s: &str, ) -> Result<BroadcastTicket, <BroadcastTicket as FromStr>::Err>
§impl Hash for BroadcastTicket
impl Hash for BroadcastTicket
§impl PartialEq for BroadcastTicket
impl PartialEq for BroadcastTicket
§impl Serialize for BroadcastTicket
impl Serialize for BroadcastTicket
§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
impl StructuralPartialEq for BroadcastTicket
Auto Trait Implementations§
impl Freeze for BroadcastTicket
impl RefUnwindSafe for BroadcastTicket
impl Send for BroadcastTicket
impl Sync for BroadcastTicket
impl Unpin for BroadcastTicket
impl UnsafeUnpin for BroadcastTicket
impl UnwindSafe for BroadcastTicket
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<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
key and return true if they are equal.