Skip to main content

FieldCache

Struct FieldCache 

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

One validated property lookup.

Covers both own-property hits and prototype hits. The second kind was deliberately left uncached at first (“a prototype hit depends on more than the object and the name”), and that is true — but it is checkable. What it costs is array:push: a.push lives on Array.prototype, so get_field2 push walked the chain and string-compared ~40 property names on every iteration (measured: 100 ns per call over an empty loop).

Auto Trait Implementations§

§

impl !RefUnwindSafe for FieldCache

§

impl !Send for FieldCache

§

impl !Sync for FieldCache

§

impl !UnwindSafe for FieldCache

§

impl Forget for FieldCache

§

impl Freeze for FieldCache
where *const RcInner<[u8]> is !null: Freeze, PhantomData<RcInner<[u8]>>: Freeze, *const RcInner<Vec<u8>> is !null: Freeze, PhantomData<RcInner<Vec<u8>>>: Freeze, *const GcBox<JsSymbol> is !null: Freeze, *const GcBox<JsObject> is !null: Freeze,

§

impl Move for FieldCache

§

impl Unpin for FieldCache
where Rc<[u8]>: Unpin, Rc<Vec<u8>>: Unpin, *const GcBox<JsSymbol> is !null: Unpin, *const GcBox<JsObject> is !null: Unpin,

§

impl UnsafeUnpin for FieldCache
where *const RcInner<[u8]> is !null: UnsafeUnpin, PhantomData<RcInner<[u8]>>: UnsafeUnpin, *const RcInner<Vec<u8>> is !null: UnsafeUnpin, PhantomData<RcInner<Vec<u8>>>: UnsafeUnpin, *const GcBox<JsSymbol> is !null: UnsafeUnpin, *const GcBox<JsObject> is !null: UnsafeUnpin,

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.