CascStorage

Struct CascStorage 

Source
pub struct CascStorage { /* private fields */ }
Expand description

Main CASC storage implementation

Implementations§

Source§

impl CascStorage

Source

pub fn new(config: CascConfig) -> Result<Self>

Create a new CASC storage instance

Source

pub fn load_indices(&self) -> Result<()>

Load indices from disk

Source

pub async fn new_async(config: CascConfig) -> Result<Self>

Create new CASC storage asynchronously (recommended for async contexts)

Source

pub async fn load_indices_parallel(&self) -> Result<()>

Load indices from disk with parallel processing (3-5x faster)

Source

pub fn load_indices_sequential(&self) -> Result<()>

Load indices from disk (sequential fallback)

Source

pub fn load_archives(&self) -> Result<()>

Load archive files

Source

pub fn read_arc(&self, ekey: &EKey) -> Result<Arc<Vec<u8>>>

Read a file by its encoding key (zero-copy when cached)

Source

pub fn read(&self, ekey: &EKey) -> Result<Vec<u8>>

Read a file by its encoding key (compatibility method, always clones)

Source

pub fn write(&self, ekey: &EKey, data: &[u8]) -> Result<()>

Write a file with the given encoding key

Source

pub fn verify(&self) -> Result<Vec<EKey>>

Verify storage integrity

Source

pub fn rebuild_indices(&self) -> Result<()>

Build indices from scratch by scanning archives

Source

pub fn stats(&self) -> StorageStats

Get storage statistics

Source

pub fn enumerate_files_vec(&self) -> Vec<(EKey, ArchiveLocation)>

Enumerate all files in the storage Returns a vector of (EKey, ArchiveLocation) pairs

Source

pub fn enumerate_files( &self, ) -> impl Iterator<Item = (EKey, ArchiveLocation)> + '_

Enumerate all files in the storage Returns an iterator over (EKey, ArchiveLocation) pairs

Source

pub fn get_all_ekeys(&self) -> Vec<EKey>

Get all EKeys in the storage

Source

pub fn test_ekey_lookup(&self) -> Result<()>

Test function to verify EKey lookup is working

Source

pub fn files_per_archive(&self) -> HashMap<u16, usize>

Count files per archive

Source

pub fn clear_cache(&self)

Clear the cache

Source

pub fn flush(&self) -> Result<()>

Flush any pending writes

Source

pub fn init_tact_manifests(&mut self, config: ManifestConfig)

Initialize TACT manifest support with configuration

Source

pub fn load_root_manifest(&self, data: Vec<u8>) -> Result<()>

Load root manifest from raw data

Source

pub fn load_encoding_manifest(&self, data: Vec<u8>) -> Result<()>

Load encoding manifest from raw data

Source

pub fn load_root_manifest_from_file(&self, path: &Path) -> Result<()>

Load root manifest from file

Source

pub fn load_encoding_manifest_from_file(&self, path: &Path) -> Result<()>

Load encoding manifest from file

Source

pub fn load_listfile(&self, path: &Path) -> Result<usize>

Load a community listfile for filename resolution

Source

pub fn read_by_fdid(&self, fdid: u32) -> Result<Vec<u8>>

Read a file by FileDataID

Source

pub fn read_by_filename(&self, filename: &str) -> Result<Vec<u8>>

Read a file by filename (requires loaded listfile or root manifest)

Source

pub fn get_fdid_for_filename(&self, filename: &str) -> Option<u32>

Get FileDataID for a filename (if known)

Source

pub fn get_all_fdids(&self) -> Result<Vec<u32>>

Get all known FileDataIDs

Source

pub fn tact_manifests_loaded(&self) -> bool

Check if TACT manifests are loaded and ready

Source

pub fn get_file_mapping(&self, fdid: u32) -> Result<FileMapping>

Get file mapping information for a FileDataID

Source

pub fn clear_manifest_cache(&self)

Clear TACT manifest caches

Source

pub async fn init_async_indices(&mut self) -> Result<()>

Initialize async index manager for parallel operations

Source

pub async fn lookup_async(&self, ekey: &EKey) -> Option<ArchiveLocation>

Perform async lookup using the async index manager

Source

pub async fn lookup_batch_async( &self, ekeys: &[EKey], ) -> Vec<Option<ArchiveLocation>>

Batch lookup for multiple keys using async operations

Source

pub async fn start_index_background_updates(&self, interval: Duration)

Start background index updates with specified interval

Source

pub async fn stop_index_background_updates(&self)

Stop background index updates

Source

pub async fn get_async_index_stats(&self) -> Option<AsyncIndexStats>

Get async index statistics

Source

pub async fn clear_async_index_cache(&self)

Clear async index cache

Source

pub fn init_progressive_loading(&mut self, config: ProgressiveConfig)

Initialize progressive file loading with configuration

Source

pub async fn read_progressive( &self, ekey: &EKey, size_hint: SizeHint, ) -> Result<Arc<ProgressiveFile>>

Read a file progressively with size hints

Source

pub async fn read_by_fdid_progressive( &self, fdid: u32, ) -> Result<Arc<ProgressiveFile>>

Read a file by FileDataID progressively with size hints from manifest

Source

pub fn get_size_hint_for_ekey(&self, ekey: &EKey) -> SizeHint

Get size hint for an EKey from archive location

Source

pub fn has_progressive_loading(&self) -> bool

Check if progressive loading is available

Source

pub async fn cleanup_progressive_files(&self)

Cleanup inactive progressive files

Source

pub async fn get_progressive_stats(&self) -> Vec<(EKey, LoadingStats)>

Get progressive loading statistics

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more