Skip to main content

GeneratedCodeArena

Struct GeneratedCodeArena 

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

An arena designed for the specific case of reading messages from single-segment Word arrays in generated code, including constants and raw schema nodes. Performs bounds checking, so its constructor does not need to be marked unsafe. Does not enforce a read limit or a nesting limit.

Implementations§

Source§

impl GeneratedCodeArena

Source

pub const fn new(words: &'static [Word]) -> Self

Trait Implementations§

Source§

impl ReaderArena for GeneratedCodeArena

Source§

fn get_segment(&self, id: u32) -> Result<(*const u8, u32)>

Source§

fn contains_interval( &self, id: u32, start: *const u8, size_in_words: usize, ) -> Result<()>

Source§

fn amplified_read(&self, _virtual_amount: u64) -> Result<()>

Source§

fn nesting_limit(&self) -> i32

Source§

fn size_in_words(&self) -> usize

Source§

unsafe fn check_offset( &self, segment_id: u32, start: *const u8, offset_in_words: i32, ) -> Result<*const u8>

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