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

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

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 JsObject has been visited before in the graph, but not in the current branch.

live: bool

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

Implementations

Determines if the specified JsObject 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 JsObject values that have been visited. The first JsObject visited will clear the hashset, while any others will check if they are contained by the hashset.

Trait Implementations

Formats the value using the given formatter. Read more

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.