pub struct AttachmentMetadata {Show 18 fields
pub url: String,
pub mime_type: Option<String>,
pub sha256: Option<String>,
pub original_sha256: Option<String>,
pub byte_size: Option<u64>,
pub dimensions: Option<String>,
pub name: Option<String>,
pub magnet: Option<String>,
pub infohash: Option<String>,
pub blurhash: Option<String>,
pub thumbnail_url: Option<String>,
pub image_url: Option<String>,
pub summary: Option<String>,
pub alt: Option<String>,
pub fallback_urls: Vec<String>,
pub service: Option<String>,
pub encryption: Option<String>,
pub unknown_fields: Vec<String>,
}Expand description
Parsed canonical Softchat imeta metadata.
Fields§
§url: StringRequired absolute HTTPS URL.
mime_type: Option<String>Optional lowercase MIME type.
sha256: Option<String>Optional SHA-256 hash of the referenced object.
original_sha256: Option<String>Optional SHA-256 hash of the pre-transform object.
byte_size: Option<u64>Optional byte size.
dimensions: Option<String>Optional positive <width>x<height> dimensions.
name: Option<String>Optional display name.
magnet: Option<String>Optional magnet URI.
infohash: Option<String>Optional torrent info hash.
blurhash: Option<String>Optional blurhash.
thumbnail_url: Option<String>Optional absolute HTTPS thumbnail URL.
image_url: Option<String>Optional absolute HTTPS preview URL.
summary: Option<String>Optional summary.
alt: Option<String>Optional accessibility text.
fallback_urls: Vec<String>Sorted absolute HTTPS fallback URLs.
service: Option<String>Optional storage service identifier.
encryption: Option<String>Opaque versioned encryption metadata. Never include it in diagnostics.
unknown_fields: Vec<String>Unknown raw key value fields retained in received order.
Implementations§
Source§impl AttachmentMetadata
impl AttachmentMetadata
Sourcepub fn from_tag(values: &[String]) -> Result<Self, SoftchatError>
pub fn from_tag(values: &[String]) -> Result<Self, SoftchatError>
Parse a complete raw imeta tag.
§Errors
Returns SoftchatError::InvalidAttachmentMetadata for duplicate
singleton fields, missing required values, or invalid typed values.
Sourcepub fn to_tag(&self) -> Result<NostrTag, SoftchatError>
pub fn to_tag(&self) -> Result<NostrTag, SoftchatError>
Emit the canonical field order from the accepted Softchat profile.
§Errors
Returns SoftchatError::InvalidAttachmentMetadata if the value is
malformed or contains a duplicate known field through unknown_fields.
Trait Implementations§
Source§impl Clone for AttachmentMetadata
impl Clone for AttachmentMetadata
Source§fn clone(&self) -> AttachmentMetadata
fn clone(&self) -> AttachmentMetadata
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<UT> ConvertError<UT> for AttachmentMetadata
impl<UT> ConvertError<UT> for AttachmentMetadata
fn try_convert_unexpected_callback_error( e: UnexpectedUniFFICallbackError, ) -> Result<Self>
Source§impl Debug for AttachmentMetadata
impl Debug for AttachmentMetadata
Source§impl Default for AttachmentMetadata
impl Default for AttachmentMetadata
Source§fn default() -> AttachmentMetadata
fn default() -> AttachmentMetadata
Source§impl<'de> Deserialize<'de> for AttachmentMetadata
impl<'de> Deserialize<'de> for AttachmentMetadata
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>,
Source§impl<UT> FfiConverter<UT> for AttachmentMetadata
impl<UT> FfiConverter<UT> for AttachmentMetadata
Source§const TYPE_ID_META: MetadataBuffer
const TYPE_ID_META: MetadataBuffer
Source§type FfiType = RustBuffer
type FfiType = RustBuffer
Source§fn lower(v: Self) -> RustBuffer
fn lower(v: Self) -> RustBuffer
Source§fn try_lift(buf: RustBuffer) -> Result<Self>
fn try_lift(buf: RustBuffer) -> Result<Self>
Source§impl<UT> Lift<UT> for AttachmentMetadata
impl<UT> Lift<UT> for AttachmentMetadata
Source§impl<UT> LiftRef<UT> for AttachmentMetadata
impl<UT> LiftRef<UT> for AttachmentMetadata
Source§impl<UT> LiftReturn<UT> for AttachmentMetadata
impl<UT> LiftReturn<UT> for AttachmentMetadata
Source§type ReturnType = <AttachmentMetadata as Lift<UT>>::FfiType
type ReturnType = <AttachmentMetadata as Lift<UT>>::FfiType
Source§fn try_lift_successful_return(v: Self::ReturnType) -> Result<Self>
fn try_lift_successful_return(v: Self::ReturnType) -> Result<Self>
§fn lift_foreign_return(
ffi_return: Self::ReturnType,
call_status: RustCallStatus,
) -> Self
fn lift_foreign_return( ffi_return: Self::ReturnType, call_status: RustCallStatus, ) -> Self
§fn lift_error(_buf: RustBuffer) -> Self
fn lift_error(_buf: RustBuffer) -> Self
§fn handle_callback_unexpected_error(e: UnexpectedUniFFICallbackError) -> Self
fn handle_callback_unexpected_error(e: UnexpectedUniFFICallbackError) -> Self
Source§impl<UT> Lower<UT> for AttachmentMetadata
impl<UT> Lower<UT> for AttachmentMetadata
Source§impl<UT> LowerError<UT> for AttachmentMetadata
impl<UT> LowerError<UT> for AttachmentMetadata
Source§fn lower_error(obj: Self) -> RustBuffer
fn lower_error(obj: Self) -> RustBuffer
Source§impl<UT> LowerReturn<UT> for AttachmentMetadata
impl<UT> LowerReturn<UT> for AttachmentMetadata
Source§type ReturnType = <AttachmentMetadata as Lower<UT>>::FfiType
type ReturnType = <AttachmentMetadata as Lower<UT>>::FfiType
Source§fn lower_return(v: Self) -> Result<Self::ReturnType, RustCallError>
fn lower_return(v: Self) -> Result<Self::ReturnType, RustCallError>
§fn handle_failed_lift(
error: LiftArgsError,
) -> Result<Self::ReturnType, RustCallError>
fn handle_failed_lift( error: LiftArgsError, ) -> Result<Self::ReturnType, RustCallError>
Source§impl PartialEq for AttachmentMetadata
impl PartialEq for AttachmentMetadata
Source§fn eq(&self, other: &AttachmentMetadata) -> bool
fn eq(&self, other: &AttachmentMetadata) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for AttachmentMetadata
impl Serialize for AttachmentMetadata
Source§impl<UT> TypeId<UT> for AttachmentMetadata
impl<UT> TypeId<UT> for AttachmentMetadata
const TYPE_ID_META: MetadataBuffer
impl Eq for AttachmentMetadata
impl StructuralPartialEq for AttachmentMetadata
Auto Trait Implementations§
impl Freeze for AttachmentMetadata
impl RefUnwindSafe for AttachmentMetadata
impl Send for AttachmentMetadata
impl Sync for AttachmentMetadata
impl Unpin for AttachmentMetadata
impl UnsafeUnpin for AttachmentMetadata
impl UnwindSafe for AttachmentMetadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
Arc<> Read more