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 HARD_MAX_DEPTH: usize = 128
pub const HARD_MAX_DEPTH: usize = 128
Hard maximum nesting depth accepted by the recursive host codec.
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, clamped to
HARD_MAX_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, clamped to
HARD_MAX_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<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
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<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> 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