Skip to main content

JsRef

Struct JsRef 

Source
pub struct JsRef<'e> { /* private fields */ }
Expand description

A live JavaScript value, walked in place on the JavaScript thread.

Implementations§

Source§

impl<'e> JsRef<'e>

Source

pub fn new(value: Unknown<'e>) -> Self

The value to walk, as the root of the structure.

Source

pub fn to_frame(self) -> Result<Protected<Vec<u8>>>

Snapshot the value as a frame, on the JavaScript thread, so it can be encrypted on a worker with no JavaScript access. The frame is plaintext and comes back wiped on drop.

Trait Implementations§

Source§

impl Encrypt for JsRef<'_>

Source§

fn visit<S: Sink>(self, sink: S) -> Result<S::Ok, S::Error>

Describe self to sink, consuming it.
Source§

const DEPTH: Option<usize> = None

How deep a value of this type can nest below its own root, when the type alone fixes it: Some(0) for a scalar, one more than its deepest child for a sequence or map (see depth). None, the default, when it depends on the value: a recursive type, a frame, a live host value. Read more
Source§

const FIXED: Option<FixedType> = None

The fixed-width scalar type every value of this type has, if it has one: an int, a float, a date, a timestamp, a decimal. None, the default, for everything else: a bool (whose leaf is already as short as a null’s), text, bytes, a container, a value whose type depends on the value. Read more

Auto Trait Implementations§

§

impl<'e> !Send for JsRef<'e>

§

impl<'e> !Sync for JsRef<'e>

§

impl<'e> Freeze for JsRef<'e>

§

impl<'e> RefUnwindSafe for JsRef<'e>

§

impl<'e> Unpin for JsRef<'e>

§

impl<'e> UnsafeUnpin for JsRef<'e>

§

impl<'e> UnwindSafe for JsRef<'e>

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

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 = !

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.