Skip to main content

ZipExtractor

Struct ZipExtractor 

Source
pub struct ZipExtractor<R: Read + Seek> { /* private fields */ }
Expand description

A ULS ZIP archive that can stream DAT files.

Implementations§

Source§

impl ZipExtractor<BufReader<File>>

Source

pub fn open<P: AsRef<Path>>(path: P) -> Result<Self, ZipError>

Open a ULS ZIP file.

Source

pub fn stats(&mut self) -> Result<ArchiveStats, ZipError>

Get statistics about the archive.

Source

pub fn count_all_records( &mut self, ) -> Result<HashMap<String, usize>, ParseError>

Count records in all DAT files in the archive.

Source§

impl<R: Read + Seek> ZipExtractor<R>

Source

pub fn new(archive: ZipArchive<R>) -> Self

Create from an existing archive reader.

Source

pub fn list_dat_files(&mut self) -> Vec<String>

List all DAT files in the archive.

Source

pub fn list_files(&mut self) -> Vec<String>

List all files in the archive.

Source

pub fn file_size(&mut self, name: &str) -> Result<u64, ZipError>

Get the size of a file in the archive.

Source

pub fn stream_dat(&mut self, name: &str) -> Result<impl Read + '_, ZipError>

Stream a DAT file from the archive without extracting to disk. Returns a reader that can be used with DatReader.

Source

pub fn process_dat_streaming<F>( &mut self, dat_name: &str, callback: F, ) -> Result<usize, ParseError>
where F: FnMut(ParsedLine) -> bool,

Process a DAT file streaming from the archive, calling a callback for each record. This is the most memory-efficient way to process large ULS archives.

Source

pub fn get_file_creation_date(&mut self) -> Option<String>

Extract the canonical file creation date from the counts file in the archive.

FCC data files contain a counts file with a line like: File Creation Date: Sun Jan 18 12:01:25 EST 2026

This is the authoritative date for when the FCC generated the data file. Returns None if the counts file doesn’t exist or can’t be parsed.

Auto Trait Implementations§

§

impl<R> Freeze for ZipExtractor<R>
where R: Freeze,

§

impl<R> RefUnwindSafe for ZipExtractor<R>
where R: RefUnwindSafe,

§

impl<R> Send for ZipExtractor<R>
where R: Send,

§

impl<R> Sync for ZipExtractor<R>
where R: Sync,

§

impl<R> Unpin for ZipExtractor<R>
where R: Unpin,

§

impl<R> UnsafeUnpin for ZipExtractor<R>
where R: UnsafeUnpin,

§

impl<R> UnwindSafe for ZipExtractor<R>
where R: UnwindSafe,

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, 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.