#[non_exhaustive]pub struct ResourceInfo {
pub url: CompactString,
pub description: Option<CompactString>,
pub mime_type: Option<CompactString>,
pub service_name: Option<CompactString>,
pub tags: Vec<CompactString>,
pub icon_url: Option<CompactString>,
}Expand description
Human-readable metadata describing the paid resource.
Spec §5.1.2: only url is required.
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.url: CompactStringCanonical URL of the resource.
description: Option<CompactString>Optional human-readable description.
mime_type: Option<CompactString>Optional MIME type.
service_name: Option<CompactString>Human-readable name of the service hosting the resource.
Printable ASCII, max 32 characters per spec §5.1.2.
Topical tags for the service, used for discovery filtering.
Max 5 entries; each printable ASCII, max 32 characters, per spec §5.1.2.
icon_url: Option<CompactString>Absolute https/http URL to an icon representing the service.
Max 2048 characters per spec §5.1.2.
Implementations§
Source§impl ResourceInfo
impl ResourceInfo
Sourcepub fn new(url: impl Into<CompactString>) -> Self
pub fn new(url: impl Into<CompactString>) -> Self
Constructs a ResourceInfo carrying just a URL.
Sourcepub fn with_description(self, description: impl Into<CompactString>) -> Self
pub fn with_description(self, description: impl Into<CompactString>) -> Self
Sets description.
Sourcepub fn with_mime_type(self, mime_type: impl Into<CompactString>) -> Self
pub fn with_mime_type(self, mime_type: impl Into<CompactString>) -> Self
Sets mimeType.
Sourcepub fn with_service_name(self, service_name: impl Into<CompactString>) -> Self
pub fn with_service_name(self, service_name: impl Into<CompactString>) -> Self
Sets serviceName.
Replaces the tags list.
Sourcepub fn with_tag(self, tag: impl Into<CompactString>) -> Self
pub fn with_tag(self, tag: impl Into<CompactString>) -> Self
Appends a single tag.
Sourcepub fn with_icon_url(self, icon_url: impl Into<CompactString>) -> Self
pub fn with_icon_url(self, icon_url: impl Into<CompactString>) -> Self
Sets iconUrl.
Trait Implementations§
Source§impl Clone for ResourceInfo
impl Clone for ResourceInfo
Source§fn clone(&self) -> ResourceInfo
fn clone(&self) -> ResourceInfo
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 ResourceInfo
impl Debug for ResourceInfo
Source§impl<'de> Deserialize<'de> for ResourceInfo
impl<'de> Deserialize<'de> for ResourceInfo
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 ResourceInfo
Source§impl PartialEq for ResourceInfo
impl PartialEq for ResourceInfo
Source§impl Serialize for ResourceInfo
impl Serialize for ResourceInfo
impl StructuralPartialEq for ResourceInfo
Auto Trait Implementations§
impl Freeze for ResourceInfo
impl RefUnwindSafe for ResourceInfo
impl Send for ResourceInfo
impl Sync for ResourceInfo
impl Unpin for ResourceInfo
impl UnsafeUnpin for ResourceInfo
impl UnwindSafe for ResourceInfo
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