pub struct FileServerList {
pub servers: Vec<Url>,
}Expand description
Typed bundle for the kind: 10096 user file-server preference
list.
Identical wire shape to the NIP-B7 crate::nips::nipb7::BlossomServerList:
one server tag per URL, no .content. Servers are listed in
the user’s preference order so clients SHOULD try the head of
the list first.
Fields§
§servers: Vec<Url>File-storage server URLs the user trusts.
Implementations§
Source§impl FileServerList
impl FileServerList
Sourcepub fn new<I>(servers: I) -> Selfwhere
I: IntoIterator<Item = Url>,
pub fn new<I>(servers: I) -> Selfwhere
I: IntoIterator<Item = Url>,
Construct a server list.
Render the typed bundle to the public tag list.
Sourcepub fn from_event(event: &Event) -> Result<Self, Nip96Error>
pub fn from_event(event: &Event) -> Result<Self, Nip96Error>
Parse a signed kind:10096 event back into a typed bundle.
§Errors
Returns Nip96Error::WrongKind when the event’s kind is
not 10096; forwards URL parse errors for each server
tag.
Trait Implementations§
Source§impl Clone for FileServerList
impl Clone for FileServerList
Source§fn clone(&self) -> FileServerList
fn clone(&self) -> FileServerList
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FileServerList
impl Debug for FileServerList
impl Eq for FileServerList
Source§impl PartialEq for FileServerList
impl PartialEq for FileServerList
impl StructuralPartialEq for FileServerList
Auto Trait Implementations§
impl Freeze for FileServerList
impl RefUnwindSafe for FileServerList
impl Send for FileServerList
impl Sync for FileServerList
impl Unpin for FileServerList
impl UnsafeUnpin for FileServerList
impl UnwindSafe for FileServerList
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
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,
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
Compare self to
key and return true if they are equal.