Struct nostr_sdk::nips::nip94::FileMetadata
source · pub struct FileMetadata {
pub url: Url,
pub mime_type: String,
pub hash: Hash,
pub aes_256_gcm: Option<(String, String)>,
pub size: Option<usize>,
pub dim: Option<ImageDimensions>,
pub magnet: Option<String>,
pub blurhash: Option<String>,
}
Expand description
File Metadata
Fields§
§url: Url
Url
mime_type: String
MIME type
hash: Hash
SHA256 of file
aes_256_gcm: Option<(String, String)>
AES 256 GCM
size: Option<usize>
Size in bytes
dim: Option<ImageDimensions>
Size in pixels
magnet: Option<String>
Magnet
blurhash: Option<String>
Blurhash
Implementations§
source§impl FileMetadata
impl FileMetadata
sourcepub fn new<S>(url: Url, mime_type: S, hash: Hash) -> FileMetadatawhere
S: Into<String>,
pub fn new<S>(url: Url, mime_type: S, hash: Hash) -> FileMetadatawhere S: Into<String>,
New FileMetadata
sourcepub fn aes_256_gcm<S>(self, key: S, iv: S) -> FileMetadatawhere
S: Into<String>,
pub fn aes_256_gcm<S>(self, key: S, iv: S) -> FileMetadatawhere S: Into<String>,
Add AES 256 GCM
sourcepub fn size(self, size: usize) -> FileMetadata
pub fn size(self, size: usize) -> FileMetadata
Add file size (bytes)
sourcepub fn dimensions(self, dim: ImageDimensions) -> FileMetadata
pub fn dimensions(self, dim: ImageDimensions) -> FileMetadata
Add file size (pixels)
sourcepub fn magnet<S>(self, magnet: S) -> FileMetadatawhere
S: Into<String>,
pub fn magnet<S>(self, magnet: S) -> FileMetadatawhere S: Into<String>,
Add magnet
sourcepub fn blurhash<S>(self, blurhash: S) -> FileMetadatawhere
S: Into<String>,
pub fn blurhash<S>(self, blurhash: S) -> FileMetadatawhere S: Into<String>,
Add blurhash
Trait Implementations§
source§impl Clone for FileMetadata
impl Clone for FileMetadata
source§fn clone(&self) -> FileMetadata
fn clone(&self) -> FileMetadata
Returns a copy of the value. Read more
1.0.0 · 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 FileMetadata
impl Debug for FileMetadata
source§impl PartialEq<FileMetadata> for FileMetadata
impl PartialEq<FileMetadata> for FileMetadata
source§fn eq(&self, other: &FileMetadata) -> bool
fn eq(&self, other: &FileMetadata) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for FileMetadata
impl StructuralEq for FileMetadata
impl StructuralPartialEq for FileMetadata
Auto Trait Implementations§
impl RefUnwindSafe for FileMetadata
impl Send for FileMetadata
impl Sync for FileMetadata
impl Unpin for FileMetadata
impl UnwindSafe for FileMetadata
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<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.