Struct JsSnapshotLimits
pub struct JsSnapshotLimits { /* private fields */ }js and std only.Expand description
Resource limits applied while copying values out of the JavaScript engine.
These limits cover evaluation results, function results, thrown values, and arguments passed from JavaScript into host functions. They bound the Rust-side work performed after (or during) script execution, which is separate from the JavaScript runtime’s loop, recursion, and stack limits.
Implementations§
§impl JsSnapshotLimits
impl JsSnapshotLimits
pub const DEFAULT_MAX_DEPTH: usize = 64
pub const DEFAULT_MAX_DEPTH: usize = 64
Default maximum nesting depth.
pub const DEFAULT_MAX_NODES: usize = 100_000
pub const DEFAULT_MAX_NODES: usize = 100_000
Default maximum number of values and container edges visited.
pub const DEFAULT_MAX_ARRAY_LENGTH: usize = 65_536
pub const DEFAULT_MAX_ARRAY_LENGTH: usize = 65_536
Default maximum number of entries in one array.
pub const DEFAULT_MAX_OBJECT_PROPERTIES: usize = 16_384
pub const DEFAULT_MAX_OBJECT_PROPERTIES: usize = 16_384
Default maximum number of own properties in one object.
pub const DEFAULT_MAX_STRING_BYTES: usize
pub const DEFAULT_MAX_STRING_BYTES: usize
Default maximum cumulative UTF-8 bytes copied for strings and keys.
pub const fn max_depth(&self) -> usize
pub const fn max_depth(&self) -> usize
Maximum nesting depth, where the top-level value has depth zero.
pub const fn max_nodes(&self) -> usize
pub const fn max_nodes(&self) -> usize
Maximum number of values and container edges visited in one conversion.
pub const fn max_array_length(&self) -> usize
pub const fn max_array_length(&self) -> usize
Maximum number of entries accepted from one array.
pub const fn max_object_properties(&self) -> usize
pub const fn max_object_properties(&self) -> usize
Maximum number of own properties accepted from one object.
pub const fn max_string_bytes(&self) -> usize
pub const fn max_string_bytes(&self) -> usize
Maximum cumulative UTF-8 bytes copied for strings and property keys.
pub fn with_max_depth(self, max_depth: usize) -> JsSnapshotLimits
pub fn with_max_depth(self, max_depth: usize) -> JsSnapshotLimits
Set the maximum nesting depth.
pub fn set_max_depth(&mut self, max_depth: usize) -> &mut JsSnapshotLimits
pub fn set_max_depth(&mut self, max_depth: usize) -> &mut JsSnapshotLimits
Set the maximum nesting depth.
pub fn with_max_nodes(self, max_nodes: usize) -> JsSnapshotLimits
pub fn with_max_nodes(self, max_nodes: usize) -> JsSnapshotLimits
Set the maximum number of values and container edges visited.
pub fn set_max_nodes(&mut self, max_nodes: usize) -> &mut JsSnapshotLimits
pub fn set_max_nodes(&mut self, max_nodes: usize) -> &mut JsSnapshotLimits
Set the maximum number of values and container edges visited.
pub fn with_max_array_length(self, max_array_length: usize) -> JsSnapshotLimits
pub fn with_max_array_length(self, max_array_length: usize) -> JsSnapshotLimits
Set the maximum number of entries accepted from one array.
pub fn set_max_array_length(
&mut self,
max_array_length: usize,
) -> &mut JsSnapshotLimits
pub fn set_max_array_length( &mut self, max_array_length: usize, ) -> &mut JsSnapshotLimits
Set the maximum number of entries accepted from one array.
pub fn with_max_object_properties(
self,
max_object_properties: usize,
) -> JsSnapshotLimits
pub fn with_max_object_properties( self, max_object_properties: usize, ) -> JsSnapshotLimits
Set the maximum number of own properties accepted from one object.
pub fn set_max_object_properties(
&mut self,
max_object_properties: usize,
) -> &mut JsSnapshotLimits
pub fn set_max_object_properties( &mut self, max_object_properties: usize, ) -> &mut JsSnapshotLimits
Set the maximum number of own properties accepted from one object.
pub fn with_max_string_bytes(self, max_string_bytes: usize) -> JsSnapshotLimits
pub fn with_max_string_bytes(self, max_string_bytes: usize) -> JsSnapshotLimits
Set the maximum cumulative UTF-8 bytes copied for strings and keys.
pub fn set_max_string_bytes(
&mut self,
max_string_bytes: usize,
) -> &mut JsSnapshotLimits
pub fn set_max_string_bytes( &mut self, max_string_bytes: usize, ) -> &mut JsSnapshotLimits
Set the maximum cumulative UTF-8 bytes copied for strings and keys.
Trait Implementations§
§impl Clone for JsSnapshotLimits
impl Clone for JsSnapshotLimits
§fn clone(&self) -> JsSnapshotLimits
fn clone(&self) -> JsSnapshotLimits
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for JsSnapshotLimits
§impl Debug for JsSnapshotLimits
impl Debug for JsSnapshotLimits
§impl Default for JsSnapshotLimits
impl Default for JsSnapshotLimits
§fn default() -> JsSnapshotLimits
fn default() -> JsSnapshotLimits
impl Eq for JsSnapshotLimits
§impl PartialEq for JsSnapshotLimits
impl PartialEq for JsSnapshotLimits
impl StructuralPartialEq for JsSnapshotLimits
Auto Trait Implementations§
impl Freeze for JsSnapshotLimits
impl RefUnwindSafe for JsSnapshotLimits
impl Send for JsSnapshotLimits
impl Sync for JsSnapshotLimits
impl Unpin for JsSnapshotLimits
impl UnsafeUnpin for JsSnapshotLimits
impl UnwindSafe for JsSnapshotLimits
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Conv for T
impl<T> Conv for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a rama_grpc::Request§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more§impl<T, U> RamaTryFrom<T> for Uwhere
U: TryFrom<T>,
impl<T, U> RamaTryFrom<T> for Uwhere
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
fn rama_try_from(value: T) -> Result<U, <U as RamaTryFrom<T>>::Error>
§impl<T, U, CrateMarker> RamaTryInto<U, CrateMarker> for Twhere
U: RamaTryFrom<T, CrateMarker>,
impl<T, U, CrateMarker> RamaTryInto<U, CrateMarker> for Twhere
U: RamaTryFrom<T, CrateMarker>,
type Error = <U as RamaTryFrom<T, CrateMarker>>::Error
fn rama_try_into(self) -> Result<U, <U as RamaTryFrom<T, CrateMarker>>::Error>
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.