pub struct Nickname(/* private fields */);Expand description
A validated relay nickname.
Nicknames are human-readable identifiers for relays, consisting of 1 to 19 alphanumeric ASCII characters. This type ensures the nickname is valid at construction time.
§Format
- Length: 1 to 19 characters
- Characters: ASCII alphanumeric only (a-z, A-Z, 0-9)
§Example
use stem_rs::types::Nickname;
use std::str::FromStr;
let nick = Nickname::from_str("MyRelay").unwrap();
assert_eq!(nick.as_str(), "MyRelay");
let invalid = Nickname::from_str("my-relay");
assert!(invalid.is_err());Implementations§
Trait Implementations§
impl Eq for Nickname
impl StructuralPartialEq for Nickname
Auto Trait Implementations§
impl Freeze for Nickname
impl RefUnwindSafe for Nickname
impl Send for Nickname
impl Sync for Nickname
impl Unpin for Nickname
impl UnwindSafe for Nickname
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