pub struct GgufMetadata(/* private fields */);Expand description
An ordered key-value metadata bag, with typed getters over GgufValue.
Preserves the order keys were encountered in the source file
(indexmap::IndexMap) purely so that anything that dumps metadata for
a human (a debug CLI command, say) reproduces the file’s own ordering
instead of an arbitrary hash order — lookups themselves are still O(1).
Implementations§
Source§impl GgufMetadata
impl GgufMetadata
pub fn get(&self, key: &str) -> Option<&GgufValue>
pub fn get_u64(&self, key: &str) -> Option<u64>
pub fn get_u32(&self, key: &str) -> Option<u32>
pub fn get_i64(&self, key: &str) -> Option<i64>
pub fn get_i32(&self, key: &str) -> Option<i32>
pub fn get_f32(&self, key: &str) -> Option<f32>
pub fn get_f64(&self, key: &str) -> Option<f64>
pub fn get_bool(&self, key: &str) -> Option<bool>
pub fn get_str(&self, key: &str) -> Option<&str>
pub fn get_array(&self, key: &str) -> Option<&[GgufValue]>
pub fn is_empty(&self) -> bool
Trait Implementations§
Source§impl Clone for GgufMetadata
impl Clone for GgufMetadata
Source§fn clone(&self) -> GgufMetadata
fn clone(&self) -> GgufMetadata
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 GgufMetadata
impl Debug for GgufMetadata
Source§impl Default for GgufMetadata
impl Default for GgufMetadata
Source§fn default() -> GgufMetadata
fn default() -> GgufMetadata
Returns the “default value” for a type. Read more
Source§impl PartialEq for GgufMetadata
impl PartialEq for GgufMetadata
impl StructuralPartialEq for GgufMetadata
Auto Trait Implementations§
impl Freeze for GgufMetadata
impl RefUnwindSafe for GgufMetadata
impl Send for GgufMetadata
impl Sync for GgufMetadata
impl Unpin for GgufMetadata
impl UnsafeUnpin for GgufMetadata
impl UnwindSafe for GgufMetadata
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