pub struct TensogramFile { /* private fields */ }Expand description
A handle for reading/writing Tensogram message files.
Supports local files, memory-mapped files (mmap feature), and
remote object stores (remote feature) via a unified API.
Implementations§
Source§impl TensogramFile
impl TensogramFile
pub fn open(path: impl AsRef<Path>) -> Result<TensogramFile, TensogramError>
Sourcepub fn open_source(
source: impl AsRef<str>,
) -> Result<TensogramFile, TensogramError>
pub fn open_source( source: impl AsRef<str>, ) -> Result<TensogramFile, TensogramError>
Open a local file or remote URL.
Auto-detects remote URLs (s3://, s3a://, gs://, az://, azure://, http://, https://)
when the remote feature is enabled; otherwise treats the source
as a local path.
Sourcepub fn create(path: impl AsRef<Path>) -> Result<TensogramFile, TensogramError>
pub fn create(path: impl AsRef<Path>) -> Result<TensogramFile, TensogramError>
Create a new local file for writing (truncates if exists).
pub fn message_count(&self) -> Result<usize, TensogramError>
pub fn append( &mut self, global_metadata: &GlobalMetadata, descriptors: &[(&DataObjectDescriptor, &[u8])], options: &EncodeOptions, ) -> Result<(), TensogramError>
pub fn read_message(&self, index: usize) -> Result<Vec<u8>, TensogramError>
pub fn messages(&self) -> Result<Vec<Vec<u8>>, TensogramError>
👎Deprecated:
Use message_count() + read_message(index) for lazy access
pub fn decode_message( &self, index: usize, options: &DecodeOptions, ) -> Result<(GlobalMetadata, Vec<(DataObjectDescriptor, Vec<u8>)>), TensogramError>
pub fn iter(&self) -> Result<FileMessageIter, TensogramError>
pub fn path(&self) -> Option<&Path>
pub fn source(&self) -> String
pub fn invalidate_offsets(&mut self)
pub fn decode_metadata( &self, msg_idx: usize, ) -> Result<GlobalMetadata, TensogramError>
pub fn decode_descriptors( &self, msg_idx: usize, ) -> Result<(GlobalMetadata, Vec<DataObjectDescriptor>), TensogramError>
pub fn decode_object( &self, msg_idx: usize, obj_idx: usize, options: &DecodeOptions, ) -> Result<(GlobalMetadata, DataObjectDescriptor, Vec<u8>), TensogramError>
pub fn decode_range( &self, msg_idx: usize, obj_idx: usize, ranges: &[(u64, u64)], options: &DecodeOptions, ) -> Result<(DataObjectDescriptor, Vec<Vec<u8>>), TensogramError>
pub fn is_remote(&self) -> bool
Auto Trait Implementations§
impl !Freeze for TensogramFile
impl RefUnwindSafe for TensogramFile
impl Send for TensogramFile
impl Sync for TensogramFile
impl Unpin for TensogramFile
impl UnsafeUnpin for TensogramFile
impl UnwindSafe for TensogramFile
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> 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