Skip to main content

Ipv4IndexReader

Struct Ipv4IndexReader 

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

Memory-resident sparse index + sharded LRU block cache for Section 5: Ipv4Index.

Implementations§

Source§

impl Ipv4IndexReader

Source

pub fn parse( backing: &Backing<'_>, section_offset: u64, section_len: u64, cache_blocks: usize, ) -> Result<Self>

Source

pub fn entry_count(&self) -> u64

Source

pub fn block_count(&self) -> u32

Source

pub fn header(&self) -> &IndexHeader

Source

pub fn clear_cache(&self)

Source

pub fn collect_transitions( &self, backing: &Backing<'_>, zstd_dicts: &[(u32, Vec<u8>)], ) -> Result<Vec<(u32, u64)>>

Sequentially decode all IPv4 transitions (start_u32, record_id) without polluting the LRU cache.

Source

pub fn lookup( &self, backing: &Backing<'_>, zstd_dicts: &[(u32, Vec<u8>)], key: u32, ) -> Result<u64>

Look up big-endian numeric IPv4 key, returning record_id (0 = NotFound).

Auto Trait Implementations§

§

impl !Freeze for Ipv4IndexReader

§

impl Forget for Ipv4IndexReader

§

impl Move for Ipv4IndexReader

§

impl RefUnwindSafe for Ipv4IndexReader
where Mutex<LruCache<u32, Arc<DecodedBlockU32>>>: RefUnwindSafe,

§

impl Send for Ipv4IndexReader
where RawVecInner: Send, Mutex<LruCache<u32, Arc<DecodedBlockU32>>>: Send,

§

impl Sync for Ipv4IndexReader
where RawVecInner: Sync, Mutex<LruCache<u32, Arc<DecodedBlockU32>>>: Sync,

§

impl Unpin for Ipv4IndexReader
where *const u8 is !null: Unpin, Align4<u32>: Unpin, Align1<u8>: Unpin, *const u32: Unpin, *const LruEntry<u32, Arc<DecodedBlockU32>> is !null: Unpin, NonZero<usize>: Unpin, *mut LruEntry<u32, Arc<DecodedBlockU32>>: Unpin,

§

impl UnsafeUnpin for Ipv4IndexReader
where *const u8 is !null: UnsafeUnpin, PhantomData<u32>: UnsafeUnpin, PhantomData<u64>: UnsafeUnpin, Align4<u32>: UnsafeUnpin, Align1<u8>: UnsafeUnpin, PhantomData<(KeyRef<u32>, NonNull<LruEntry<u32, Arc<DecodedBlockU32>>>)>: UnsafeUnpin, NonZeroUsizeInner: UnsafeUnpin, *mut LruEntry<u32, Arc<DecodedBlockU32>>: UnsafeUnpin,

§

impl UnwindSafe for Ipv4IndexReader
where RawVecInner: UnwindSafe, Mutex<LruCache<u32, Arc<DecodedBlockU32>>>: 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.