pub struct GgufMmapBackend { /* private fields */ }Expand description
Checkpoint over a memory-mapped crate::GgufLayoutMmap.
Callers must not truncate the file while the backend is alive (standard mmap invariant).
Implementations§
Source§impl GgufMmapBackend
impl GgufMmapBackend
Sourcepub fn open(path: impl AsRef<Path>) -> Result<Self>
pub fn open(path: impl AsRef<Path>) -> Result<Self>
Map and parse a .gguf file with ParseLimits::default.
Sourcepub fn open_with_limits(
path: impl AsRef<Path>,
limits: ParseLimits,
) -> Result<Self>
pub fn open_with_limits( path: impl AsRef<Path>, limits: ParseLimits, ) -> Result<Self>
Map and parse a .gguf file with explicit limits.
Sourcepub fn from_layout(layout: GgufLayoutMmap) -> Self
pub fn from_layout(layout: GgufLayoutMmap) -> Self
Wrap an already-mapped layout.
Sourcepub fn layout(&self) -> &GgufLayoutMmap
pub fn layout(&self) -> &GgufLayoutMmap
Format-specific mapped layout (page-aligned views, directory checks).
Sourcepub fn into_layout(self) -> GgufLayoutMmap
pub fn into_layout(self) -> GgufLayoutMmap
Unwrap into the format-specific mapped layout.
Trait Implementations§
Source§impl Checkpoint for GgufMmapBackend
Available on crate feature mmap only.
impl Checkpoint for GgufMmapBackend
Available on crate feature
mmap only.Source§fn source(&self) -> &CheckpointSource
fn source(&self) -> &CheckpointSource
Checkpoint identity: format, input path, root, payload files.
Source§fn tensors(&self) -> &[TensorInfo]
fn tensors(&self) -> &[TensorInfo]
Every tensor, sorted by name.
Source§fn metadata(&self) -> &CheckpointMetadata
fn metadata(&self) -> &CheckpointMetadata
Scalar metadata.
Source§fn tensor_bytes(&self, name: &str) -> Result<Cow<'_, [u8]>>
fn tensor_bytes(&self, name: &str) -> Result<Cow<'_, [u8]>>
Raw payload bytes of
name, length TensorInfo::byte_len.Source§fn format(&self) -> CheckpointFormat
fn format(&self) -> CheckpointFormat
Container format.
Auto Trait Implementations§
impl Forget for GgufMmapBackend
impl Freeze for GgufMmapBackendwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<(String, String)>: Freeze,
PhantomData<(String, u64)>: Freeze,
PhantomData<(String, i64)>: Freeze,
PhantomData<(String, f32)>: Freeze,
PhantomData<(String, f64)>: Freeze,
PhantomData<(String, Tensor)>: Freeze,
*mut c_void: Freeze,
PhantomData<String>: Freeze,
PhantomData<TensorInfo>: Freeze,
*const LeafNode<String, MetadataValue> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(String, MetadataValue)>>: Freeze,
impl Move for GgufMmapBackend
impl RefUnwindSafe for GgufMmapBackend
impl Send for GgufMmapBackendwhere
RawVecInner: Send,
RawTable<(String, String)>: Send,
RawTable<(String, u64)>: Send,
RawTable<(String, i64)>: Send,
RawTable<(String, f32)>: Send,
RawTable<(String, f64)>: Send,
RawTable<(String, Tensor)>: Send,
MmapInner: Send,
NodeRef<Owned, String, MetadataValue, LeafOrInternal>: Send,
BoxRaw<(String, MetadataValue)>: Send,
impl Sync for GgufMmapBackendwhere
RawVecInner: Sync,
RawTable<(String, String)>: Sync,
RawTable<(String, u64)>: Sync,
RawTable<(String, i64)>: Sync,
RawTable<(String, f32)>: Sync,
RawTable<(String, f64)>: Sync,
RawTable<(String, Tensor)>: Sync,
MmapInner: Sync,
NodeRef<Owned, String, MetadataValue, LeafOrInternal>: Sync,
BoxRaw<(String, MetadataValue)>: Sync,
impl Unpin for GgufMmapBackend
impl UnsafeUnpin for GgufMmapBackendwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<(String, String)>: UnsafeUnpin,
PhantomData<(String, u64)>: UnsafeUnpin,
PhantomData<(String, i64)>: UnsafeUnpin,
PhantomData<(String, f32)>: UnsafeUnpin,
PhantomData<(String, f64)>: UnsafeUnpin,
PhantomData<(String, Tensor)>: UnsafeUnpin,
*mut c_void: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
PhantomData<TensorInfo>: UnsafeUnpin,
*const LeafNode<String, MetadataValue> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, MetadataValue)>>: UnsafeUnpin,
impl UnwindSafe for GgufMmapBackendwhere
RawVecInner: UnwindSafe,
HashMap<String, String>: UnwindSafe,
HashMap<String, u64>: UnwindSafe,
HashMap<String, i64>: UnwindSafe,
HashMap<String, f32>: UnwindSafe,
HashMap<String, f64>: UnwindSafe,
HashMap<String, Tensor>: UnwindSafe,
*mut c_void: UnwindSafe,
BTreeMap<String, MetadataValue>: UnwindSafe,
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