[−][src]Struct boa::object::RecursionLimiter
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
impl RefUnwindSafe for RecursionLimiter
[src]
impl Send for RecursionLimiter
[src]
impl Sync for RecursionLimiter
[src]
impl Unpin for RecursionLimiter
[src]
impl UnwindSafe for RecursionLimiter
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,