#[non_exhaustive]pub struct Software {
pub name: String,
pub version: String,
pub repository: Option<Url>,
pub homepage: Option<Url>,
}Expand description
Metadata about the software powering a server.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringCanonical software name (e.g. mastodon, lemmy, mitra).
Per NodeInfo 2.0/2.1 schemas the name must match a strict regex
(^[a-z0-9-]+$), but this crate preserves the raw string to
interoperate with the relaxed FEP-0151 profile.
version: StringVersion string.
repository: Option<Url>Repository URL (NodeInfo 2.1 only).
homepage: Option<Url>Homepage URL (NodeInfo 2.1 only).
Implementations§
Source§impl Software
impl Software
Sourcepub fn new(name: impl Into<String>, version: impl Into<String>) -> Self
pub fn new(name: impl Into<String>, version: impl Into<String>) -> Self
Constructs a minimal Software description.
Sourcepub fn with_repository(self, repository: Url) -> Self
pub fn with_repository(self, repository: Url) -> Self
Sets the repository URL and returns self for chaining.
Sourcepub fn with_homepage(self, homepage: Url) -> Self
pub fn with_homepage(self, homepage: Url) -> Self
Sets the homepage URL and returns self for chaining.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Software
impl<'de> Deserialize<'de> for Software
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Software
impl StructuralPartialEq for Software
Auto Trait Implementations§
impl Freeze for Software
impl RefUnwindSafe for Software
impl Send for Software
impl Sync for Software
impl Unpin for Software
impl UnsafeUnpin for Software
impl UnwindSafe for Software
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
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>,
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.