pub struct BlobMetadata {
pub name: Option<String>,
pub content_type: Option<String>,
pub custom: HashMap<String, String>,
}Expand description
Metadata attached to blobs
Metadata travels with the blob token and is available before fetching the blob content. Use this for display names, MIME types, and application-specific key-value pairs.
Fields§
§name: Option<String>Human-readable name (e.g., “yolov8_fp16.onnx”)
content_type: Option<String>MIME type (e.g., “application/onnx”, “application/octet-stream”)
custom: HashMap<String, String>Custom key-value pairs for application-specific data
Examples:
- “model_id” -> “target_recognition”
- “version” -> “4.2.1”
- “precision” -> “fp16”
Implementations§
Source§impl BlobMetadata
impl BlobMetadata
Sourcepub fn with_name(name: impl Into<String>) -> BlobMetadata
pub fn with_name(name: impl Into<String>) -> BlobMetadata
Create metadata with just a name
Sourcepub fn with_name_and_type(
name: impl Into<String>,
content_type: impl Into<String>,
) -> BlobMetadata
pub fn with_name_and_type( name: impl Into<String>, content_type: impl Into<String>, ) -> BlobMetadata
Create metadata with name and content type
Sourcepub fn with_custom(
self,
key: impl Into<String>,
value: impl Into<String>,
) -> BlobMetadata
pub fn with_custom( self, key: impl Into<String>, value: impl Into<String>, ) -> BlobMetadata
Add a custom metadata field
Trait Implementations§
Source§impl Clone for BlobMetadata
impl Clone for BlobMetadata
Source§fn clone(&self) -> BlobMetadata
fn clone(&self) -> BlobMetadata
Returns a duplicate 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 BlobMetadata
impl Debug for BlobMetadata
Source§impl Default for BlobMetadata
impl Default for BlobMetadata
Source§fn default() -> BlobMetadata
fn default() -> BlobMetadata
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for BlobMetadata
impl<'de> Deserialize<'de> for BlobMetadata
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<BlobMetadata, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<BlobMetadata, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for BlobMetadata
impl Serialize for BlobMetadata
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for BlobMetadata
impl RefUnwindSafe for BlobMetadata
impl Send for BlobMetadata
impl Sync for BlobMetadata
impl Unpin for BlobMetadata
impl UnsafeUnpin for BlobMetadata
impl UnwindSafe for BlobMetadata
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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more