Struct UserData
pub struct UserData(/* private fields */);
Expand description
Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH
bytes.
Iroh does not keep track of or examine the user-defined data.
UserData
implements FromStr
and TryFrom<String>
, so you can
convert &str
and String
into UserData
easily.
Implementations§
§impl UserData
impl UserData
pub const MAX_LENGTH: usize = 245usize
pub const MAX_LENGTH: usize = 245usize
The max byte length allowed for user-defined data.
In DNS discovery services, the user-defined data is stored in a TXT record character string,
which has a max length of 255 bytes. We need to subtract the user-data=
prefix,
which leaves 245 bytes for the actual user-defined data.
Trait Implementations§
§impl Ord for UserData
impl Ord for UserData
§impl PartialOrd for UserData
impl PartialOrd for UserData
impl Eq for UserData
impl StructuralPartialEq for UserData
Auto Trait Implementations§
impl Freeze for UserData
impl RefUnwindSafe for UserData
impl Send for UserData
impl Sync for UserData
impl Unpin for UserData
impl UnwindSafe for UserData
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§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