Skip to main content

SoAStorage

Struct SoAStorage 

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

SoA storage for symbol data

Layout: [id_array][package_id_array][kind_array][visibility_array][name_offset_array]… Each array is contiguous in memory for cache efficiency

Implementations§

Source§

impl SoAStorage

Source

pub fn new( symbol_capacity: usize, string_pool_capacity: usize, package_capacity: usize, ) -> Self

Create new SoA storage with initial capacity

Source

pub fn symbol_count(&self) -> usize

Get symbol count

Source

pub fn package_count(&self) -> usize

Get package count

Source

pub fn insert_symbol(&self, symbol: Symbol) -> Result<SymbolId>

Insert a new symbol

Source

pub fn get_symbol(&self, id: SymbolId) -> Option<Symbol>

Get symbol by ID - O(1) direct indexing

Source

pub fn get_symbol_names<'a>( &self, start: usize, count: usize, string_pool: &'a [u8], ) -> Vec<&'a str>

Batch get symbol names - cache-friendly sequential access

Source

pub fn insert_string(&self, s: &str) -> (u32, u16)

Insert string into pool, return offset

Source

pub fn insert_package(&self, package: Package) -> Result<PackageId>

Insert package

Source

pub fn get_package(&self, id: PackageId) -> Option<Package>

Get package by ID

Source

pub fn iter_symbols(&self) -> impl Iterator<Item = Symbol> + '_

Iterate over all symbols in cache-friendly order

Source

pub fn memory_usage(&self) -> usize

Get memory usage statistics

Trait Implementations§

Source§

impl Drop for SoAStorage

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl Send for SoAStorage

Source§

impl Sync for SoAStorage

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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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