[][src]Struct boa::object::RecursionLimiter

pub struct RecursionLimiter {
    pub visited: bool,
    pub live: bool,
    // some fields omitted
}

Prevents infinite recursion during Debug::fmt, JSON.stringify, and other conversions. This uses a thread local, so is not safe to use where the object graph will be traversed by multiple threads!

Fields

visited: bool

If this GcObject has been visited before in the graph, but not in the current branch.

live: bool

If this GcObject has been visited in the current branch of the graph.

Implementations

impl RecursionLimiter[src]

pub fn new(o: &GcObject) -> Self[src]

Determines if the specified GcObject has been visited, and returns a struct that will free it when dropped.

This is done by maintaining a thread-local hashset containing the pointers of GcObject values that have been visited. The first GcObject visited will clear the hashset, while any others will check if they are contained by the hashset.

Trait Implementations

impl Debug for RecursionLimiter[src]

impl Drop for RecursionLimiter[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,