Struct nostr_types::NostrUrl
source · pub struct NostrUrl(pub NostrBech32);
Expand description
A Nostr URL (starting with ‘nostr:’)
Tuple Fields§
§0: NostrBech32
Implementations§
source§impl NostrUrl
impl NostrUrl
sourcepub fn new(bech32: NostrBech32) -> NostrUrl
pub fn new(bech32: NostrBech32) -> NostrUrl
Create a new NostrUrl from a NostrBech32
sourcepub fn try_from_string(s: &str) -> Option<NostrUrl>
pub fn try_from_string(s: &str) -> Option<NostrUrl>
Try to convert a string into a NostrUrl. Must not have leading or trailing junk for this to work.
sourcepub fn find_all_in_string(s: &str) -> Vec<NostrUrl>
pub fn find_all_in_string(s: &str) -> Vec<NostrUrl>
Find all NostrUrl
s in a string, returned in the order found
(If not prefixed with ‘nostr:’ they will not count, see NostrBech32)
Trait Implementations§
source§impl From<UncheckedUrl> for NostrUrl
impl From<UncheckedUrl> for NostrUrl
source§fn from(u: UncheckedUrl) -> NostrUrl
fn from(u: UncheckedUrl) -> NostrUrl
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for NostrUrl
impl RefUnwindSafe for NostrUrl
impl Send for NostrUrl
impl Sync for NostrUrl
impl Unpin for NostrUrl
impl UnwindSafe for NostrUrl
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