pub struct PageAlignedTensorBytes<'a> {
pub pages: &'a [u8],
pub tensor_offset: usize,
pub tensor_len: usize,
pub page_size: usize,
}Expand description
Page-aligned view covering a tensor payload inside a mapping.
pages starts at an OS-page boundary and covers the tensor; it may
include bytes before/after the payload (and may be truncated at EOF
when the file is smaller than a page). Self::tensor_bytes returns
the exact payload.
Fields§
§pages: &'a [u8]Page-aligned (or file-start) range covering the tensor.
tensor_offset: usizeOffset of the exact tensor payload within Self::pages.
tensor_len: usizeExact tensor payload length in bytes.
page_size: usizePage size used to compute the range.
Implementations§
Source§impl<'a> PageAlignedTensorBytes<'a>
impl<'a> PageAlignedTensorBytes<'a>
Sourcepub fn tensor_bytes(self) -> &'a [u8] ⓘ
pub fn tensor_bytes(self) -> &'a [u8] ⓘ
Exact tensor payload, equivalent to GgufLayoutMmap::tensor_bytes.
Trait Implementations§
Source§impl<'a> Clone for PageAlignedTensorBytes<'a>
impl<'a> Clone for PageAlignedTensorBytes<'a>
impl<'a> Copy for PageAlignedTensorBytes<'a>
Auto Trait Implementations§
impl<'a> Forget for PageAlignedTensorBytes<'a>
impl<'a> Freeze for PageAlignedTensorBytes<'a>
impl<'a> Move for PageAlignedTensorBytes<'a>
impl<'a> RefUnwindSafe for PageAlignedTensorBytes<'a>
impl<'a> Send for PageAlignedTensorBytes<'a>
impl<'a> Sync for PageAlignedTensorBytes<'a>
impl<'a> Unpin for PageAlignedTensorBytes<'a>
impl<'a> UnsafeUnpin for PageAlignedTensorBytes<'a>where
&'a [u8]: UnsafeUnpin,
impl<'a> UnwindSafe for PageAlignedTensorBytes<'a>where
&'a [u8]: 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