diff --git a/main/help.html b/main/help.html index 43d8e18..bf5aebf 100644 --- a/main/help.html +++ b/main/help.html @@ -1,2 +1,2 @@ -Help +Help

Rustdoc help

Back
\ No newline at end of file diff --git a/main/refuse/all.html b/main/refuse/all.html index ad2d63e..d81b76e 100644 --- a/main/refuse/all.html +++ b/main/refuse/all.html @@ -1,2 +1,2 @@ -List of all items in this crate +List of all items in this crate

List of all items

Structs

Traits

Derive Macros

Functions

\ No newline at end of file diff --git a/main/refuse/architecture/index.html b/main/refuse/architecture/index.html index 682651e..431f5e6 100644 --- a/main/refuse/architecture/index.html +++ b/main/refuse/architecture/index.html @@ -1,4 +1,4 @@ -refuse::architecture - Rust +refuse::architecture - Rust

Module refuse::architecture

source ·
Expand description

Architecture overview of the underlying design of Refuse.

§Overview

Refuse is an incremental, tracing garbage collector. Incremental garbage diff --git a/main/refuse/derive.MapAs.html b/main/refuse/derive.MapAs.html index 7a56927..7d063fe 100644 --- a/main/refuse/derive.MapAs.html +++ b/main/refuse/derive.MapAs.html @@ -1,4 +1,4 @@ -MapAs in refuse - Rust

+MapAs in refuse - Rust

Derive Macro refuse::MapAs

#[derive(MapAs)]
 {
     // Attributes available to this derive:
diff --git a/main/refuse/derive.Trace.html b/main/refuse/derive.Trace.html
index 4f0a3af..8fd53b5 100644
--- a/main/refuse/derive.Trace.html
+++ b/main/refuse/derive.Trace.html
@@ -1,2 +1,2 @@
-Trace in refuse - Rust
+Trace in refuse - Rust
     

Derive Macro refuse::Trace

#[derive(Trace)]
\ No newline at end of file diff --git a/main/refuse/fn.collect.html b/main/refuse/fn.collect.html index 624e2bb..919a58c 100644 --- a/main/refuse/fn.collect.html +++ b/main/refuse/fn.collect.html @@ -1,5 +1,5 @@ -collect in refuse - Rust -

Function refuse::collect

source ·
pub fn collect()
Expand description

Invokes the garbage collector.

+collect in refuse - Rust +

Function refuse::collect

source ·
pub fn collect()
Expand description

Invokes the garbage collector.

§Panics

This function will panic if any CollectionGuards are held and not yielding by the current thread when invoked. If a guard is held, consider diff --git a/main/refuse/fn.try_collect.html b/main/refuse/fn.try_collect.html index 1549296..5546cba 100644 --- a/main/refuse/fn.try_collect.html +++ b/main/refuse/fn.try_collect.html @@ -1,5 +1,5 @@ -try_collect in refuse - Rust

-

Function refuse::try_collect

source ·
pub fn try_collect() -> Result<(), WouldDeadlock>
Expand description

Invokes the garbage collector.

+try_collect in refuse - Rust +

Function refuse::try_collect

source ·
pub fn try_collect() -> Result<(), WouldDeadlock>
Expand description

Invokes the garbage collector.

§Errors

If any CollectionGuards are held by this thread when this function is invoked, WouldDeadlock is returned.

diff --git a/main/refuse/index.html b/main/refuse/index.html index 92ee651..e5cdbed 100644 --- a/main/refuse/index.html +++ b/main/refuse/index.html @@ -1,6 +1,6 @@ -refuse - Rust
source§

impl PartialEq for AnyRef

source§

fn eq(&self, other: &AnyRef) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Trace for AnyRef

source§

const MAY_CONTAIN_REFERENCES: bool = true

If true, this type may contain references and should have its trace() +function invoked during the collector’s “mark” phase.
source§

fn trace(&self, tracer: &mut Tracer<'_>)

Traces all refrences that this value references. Read more
source§

impl Copy for AnyRef

source§

impl Eq for AnyRef

source§

impl StructuralPartialEq for AnyRef

Auto Trait Implementations§

§

impl Freeze for AnyRef

§

impl RefUnwindSafe for AnyRef

§

impl Send for AnyRef

§

impl Sync for AnyRef

§

impl Unpin for AnyRef

§

impl UnwindSafe for AnyRef

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<A> Cast for A

§

fn cast<To>(self) -> To
where diff --git a/main/refuse/struct.CollectionGuard.html b/main/refuse/struct.CollectionGuard.html index 45c0155..7f1d8c5 100644 --- a/main/refuse/struct.CollectionGuard.html +++ b/main/refuse/struct.CollectionGuard.html @@ -1,4 +1,4 @@ -CollectionGuard in refuse - Rust +CollectionGuard in refuse - Rust

Struct refuse::CollectionGuard

source ·
pub struct CollectionGuard<'a> { /* private fields */ }
Expand description

A guard that prevents garbage collection while held.

To perform garbage collection, all threads must be paused to be traced. A CollectionGuard allows the ability to read garbage-collectable data by diff --git a/main/refuse/struct.LocalPool.html b/main/refuse/struct.LocalPool.html index 696ccd0..90f46c0 100644 --- a/main/refuse/struct.LocalPool.html +++ b/main/refuse/struct.LocalPool.html @@ -1,4 +1,4 @@ -LocalPool in refuse - Rust

+LocalPool in refuse - Rust

Struct refuse::LocalPool

source ·
pub struct LocalPool { /* private fields */ }
Expand description

A pool of garbage collected values.

Values from any pool can be read using any CollectionGuard. Using independent pools for specific types of data that are meant to be shared diff --git a/main/refuse/struct.Ref.html b/main/refuse/struct.Ref.html index c58cbdb..4f91612 100644 --- a/main/refuse/struct.Ref.html +++ b/main/refuse/struct.Ref.html @@ -1,4 +1,4 @@ -Ref in refuse - Rust

+Ref in refuse - Rust

Struct refuse::Ref

source ·
pub struct Ref<T> { /* private fields */ }
Expand description

A reference to data stored in a garbage collector.

Unlike a Root<T>, this type is not guaranteed to have access to its underlying data. If no Collectable reachable via all active Roots @@ -37,46 +37,46 @@

// error[E0502]: cannot borrow `guard` as mutable because it is also borrowed as immutable assert_eq!(reference, &42);

-

Implementations§

source§

impl<T> Ref<T>
where +

Implementations§

source§

impl<T> Ref<T>
where T: Collectable,

source

pub fn new<'a>(value: T, guard: impl AsRef<CollectionGuard<'a>>) -> Self

Stores value in the garbage collector, returning a “weak” reference to it.

source

pub fn as_any(self) -> AnyRef

Returns this reference as an untyped reference.

-
source

pub fn load<'guard>( +

source

pub fn load<'guard>( &self, guard: &'guard CollectionGuard<'_> ) -> Option<&'guard T>

Loads a reference to the underlying data. Returns None if the data has been collected and is no longer available.

-
source

pub fn as_root(&self, guard: &CollectionGuard<'_>) -> Option<Root<T>>

Loads a root reference to the underlying data. Returns None if the +

source

pub fn as_root(&self, guard: &CollectionGuard<'_>) -> Option<Root<T>>

Loads a root reference to the underlying data. Returns None if the data has been collected and is no longer available.

-

Trait Implementations§

source§

impl<T> AsRef<Ref<T>> for Ref<T>

source§

fn as_ref(&self) -> &Ref<T>

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<T> AsRef<Ref<T>> for Root<T>
where - T: Collectable,

source§

fn as_ref(&self) -> &Ref<T>

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<T> Clone for Ref<T>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T> From<&Ref<T>> for AnyRef
where - T: Collectable,

source§

fn from(value: &Ref<T>) -> Self

Converts to this type from the input type.
source§

impl<T> From<Ref<T>> for AnyRef
where - T: Collectable,

source§

fn from(value: Ref<T>) -> Self

Converts to this type from the input type.
source§

impl<T> Hash for Ref<T>

source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where +

Trait Implementations§

source§

impl<T> AsRef<Ref<T>> for Ref<T>

source§

fn as_ref(&self) -> &Ref<T>

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<T> AsRef<Ref<T>> for Root<T>
where + T: Collectable,

source§

fn as_ref(&self) -> &Ref<T>

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<T> Clone for Ref<T>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T> From<&Ref<T>> for AnyRef
where + T: Collectable,

source§

fn from(value: &Ref<T>) -> Self

Converts to this type from the input type.
source§

impl<T> From<Ref<T>> for AnyRef
where + T: Collectable,

source§

fn from(value: Ref<T>) -> Self

Converts to this type from the input type.
source§

impl<T> Hash for Ref<T>

source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, - Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<T> PartialEq<&AnyRef> for Ref<T>
where - T: Collectable,

source§

fn eq(&self, other: &&AnyRef) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl<T> PartialEq<&Ref<T>> for Root<T>
where - T: Collectable,

source§

fn eq(&self, other: &&Ref<T>) -> bool

This method tests for self and other values to be equal, and is used + Self: Sized,
Feeds a slice of this type into the given Hasher. Read more
source§

impl<T> PartialEq<&AnyRef> for Ref<T>
where + T: Collectable,

source§

fn eq(&self, other: &&AnyRef) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl<T> PartialEq<&Root<T>> for Ref<T>
where - T: Collectable,

source§

fn eq(&self, other: &&Root<T>) -> bool

This method tests for self and other values to be equal, and is used +sufficient, and should not be overridden without very good reason.
source§

impl<T> PartialEq<&Ref<T>> for Root<T>
where + T: Collectable,

source§

fn eq(&self, other: &&Ref<T>) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl<T> PartialEq<&Root<T>> for Ref<T>
where + T: Collectable,

source§

fn eq(&self, other: &&Root<T>) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl<T> PartialEq<AnyRef> for Ref<T>
where + T: Collectable,

source§

fn eq(&self, other: &AnyRef) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl<T> PartialEq<Ref<T>> for Root<T>
where + T: Collectable,

source§

fn eq(&self, other: &Ref<T>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl<T> PartialEq<AnyRef> for Ref<T>
where - T: Collectable,

source§

fn eq(&self, other: &AnyRef) -> bool

This method tests for self and other values to be equal, and is used +sufficient, and should not be overridden without very good reason.
source§

impl<T> PartialEq<Root<T>> for Ref<T>
where + T: Collectable,

source§

fn eq(&self, other: &Root<T>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl<T> PartialEq<Ref<T>> for Root<T>
where - T: Collectable,

source§

fn eq(&self, other: &Ref<T>) -> bool

This method tests for self and other values to be equal, and is used +sufficient, and should not be overridden without very good reason.
source§

impl<T> PartialEq for Ref<T>

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl<T> PartialEq<Root<T>> for Ref<T>
where - T: Collectable,

source§

fn eq(&self, other: &Root<T>) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl<T> PartialEq for Ref<T>

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T> Trace for Ref<T>
where T: Collectable,

source§

const MAY_CONTAIN_REFERENCES: bool = true

If true, this type may contain references and should have its trace() -function invoked during the collector’s “mark” phase.
source§

fn trace(&self, tracer: &mut Tracer<'_>)

Traces all refrences that this value references. Read more
source§

impl<T> Copy for Ref<T>

source§

impl<T> Eq for Ref<T>

source§

impl<T> Send for Ref<T>
where - T: Send,

source§

impl<T> Sync for Ref<T>
where +function invoked during the collector’s “mark” phase.
source§

fn trace(&self, tracer: &mut Tracer<'_>)

Traces all refrences that this value references. Read more
source§

impl<T> Copy for Ref<T>

source§

impl<T> Eq for Ref<T>

source§

impl<T> Send for Ref<T>
where + T: Send,

source§

impl<T> Sync for Ref<T>
where T: Sync,

Auto Trait Implementations§

§

impl<T> Freeze for Ref<T>

§

impl<T> RefUnwindSafe for Ref<T>

§

impl<T> Unpin for Ref<T>

§

impl<T> UnwindSafe for Ref<T>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where diff --git a/main/refuse/struct.Root.html b/main/refuse/struct.Root.html index 6d13cdb..b72bfb1 100644 --- a/main/refuse/struct.Root.html +++ b/main/refuse/struct.Root.html @@ -1,4 +1,4 @@ -Root in refuse - Rust +Root in refuse - Rust

Struct refuse::Root

source ·
pub struct Root<T>
where T: Collectable,
{ /* private fields */ }
Expand description

A root reference to a T that has been allocated in the garbage collector.

This type behaves very similarly to Arc<T>. It implements Deref<Target = T>, and it is also cheap-to-clone, utilizing atomic reference counting to @@ -19,8 +19,8 @@ T: Collectable,

source§

fn as_ref(&self) -> &Ref<T>

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<T> Clone for Root<T>
where T: Collectable,

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T> Deref for Root<T>
where T: Collectable,

§

type Target = T

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl<T> Drop for Root<T>
where - T: Collectable,

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl<T> From<&Root<T>> for AnyRef
where - T: Collectable,

source§

fn from(value: &Root<T>) -> Self

Converts to this type from the input type.
source§

impl<T> Hash for Root<T>
where + T: Collectable,

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl<T> From<&Root<T>> for AnyRef
where + T: Collectable,

source§

fn from(value: &Root<T>) -> Self

Converts to this type from the input type.
source§

impl<T> Hash for Root<T>
where T: Collectable + Hash,

source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<T> Ord for Root<T>
where @@ -31,23 +31,23 @@ T: Collectable,

source§

fn eq(&self, other: &&AnyRef) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T> PartialEq<&Ref<T>> for Root<T>
where - T: Collectable,

source§

fn eq(&self, other: &&Ref<T>) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl<T> PartialEq<&Root<T>> for Ref<T>
where - T: Collectable,

source§

fn eq(&self, other: &&Root<T>) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl<T> PartialEq<AnyRef> for Root<T>
where - T: Collectable,

source§

fn eq(&self, other: &AnyRef) -> bool

This method tests for self and other values to be equal, and is used + T: Collectable,
source§

fn eq(&self, other: &&Ref<T>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl<T> PartialEq<Ref<T>> for Root<T>
where - T: Collectable,

source§

fn eq(&self, other: &Ref<T>) -> bool

This method tests for self and other values to be equal, and is used +sufficient, and should not be overridden without very good reason.
source§

impl<T> PartialEq<&Root<T>> for Ref<T>
where + T: Collectable,

source§

fn eq(&self, other: &&Root<T>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl<T> PartialEq<Root<T>> for Ref<T>
where - T: Collectable,

source§

fn eq(&self, other: &Root<T>) -> bool

This method tests for self and other values to be equal, and is used +sufficient, and should not be overridden without very good reason.
source§

impl<T> PartialEq<AnyRef> for Root<T>
where + T: Collectable,

source§

fn eq(&self, other: &AnyRef) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl<T> PartialEq for Root<T>
where - T: Collectable + PartialEq,

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used +sufficient, and should not be overridden without very good reason.
source§

impl<T> PartialEq<Ref<T>> for Root<T>
where + T: Collectable,

source§

fn eq(&self, other: &Ref<T>) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl<T> PartialEq<Root<T>> for Ref<T>
where + T: Collectable,

source§

fn eq(&self, other: &Root<T>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl<T> PartialEq for Root<T>
where + T: Collectable + PartialEq,

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T> PartialOrd for Root<T>

source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= diff --git a/main/refuse/struct.Tracer.html b/main/refuse/struct.Tracer.html index 3ef4b9c..7beb935 100644 --- a/main/refuse/struct.Tracer.html +++ b/main/refuse/struct.Tracer.html @@ -1,4 +1,4 @@ -Tracer in refuse - Rust +Tracer in refuse - Rust

Struct refuse::Tracer

source ·
pub struct Tracer<'a> { /* private fields */ }
Expand description

A tracer for the garbage collector.

This type allows Collectable values to mark() any Ref<T>s they contain.

diff --git a/main/refuse/struct.WouldDeadlock.html b/main/refuse/struct.WouldDeadlock.html index 0ce8ff8..cbdae28 100644 --- a/main/refuse/struct.WouldDeadlock.html +++ b/main/refuse/struct.WouldDeadlock.html @@ -1,5 +1,5 @@ -WouldDeadlock in refuse - Rust -

Struct refuse::WouldDeadlock

source ·
pub struct WouldDeadlock;
Expand description

An error indicating an operation would deadlock.

+WouldDeadlock in refuse - Rust +

Struct refuse::WouldDeadlock

source ·
pub struct WouldDeadlock;
Expand description

An error indicating an operation would deadlock.

CollectionGuard::acquire can be called multiple times from the same thread, but some operations require that all guards for the current thread have been released before performing. This error signals when an operation @@ -16,9 +16,9 @@ drop(guard2); assert_eq!(guard1.try_collect(), Ok(()));

-

Trait Implementations§

source§

impl Clone for WouldDeadlock

source§

fn clone(&self) -> WouldDeadlock

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WouldDeadlock

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for WouldDeadlock

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq for WouldDeadlock

source§

fn eq(&self, other: &WouldDeadlock) -> bool

This method tests for self and other values to be equal, and is used +

Trait Implementations§

source§

impl Clone for WouldDeadlock

source§

fn clone(&self) -> WouldDeadlock

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WouldDeadlock

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for WouldDeadlock

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq for WouldDeadlock

source§

fn eq(&self, other: &WouldDeadlock) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl Copy for WouldDeadlock

source§

impl Eq for WouldDeadlock

source§

impl StructuralPartialEq for WouldDeadlock

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +sufficient, and should not be overridden without very good reason.

source§

impl Copy for WouldDeadlock

source§

impl Eq for WouldDeadlock

source§

impl StructuralPartialEq for WouldDeadlock

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<A> Cast for A

§

fn cast<To>(self) -> To
where diff --git a/main/refuse/trait.Collectable.html b/main/refuse/trait.Collectable.html index 5c01c9f..ab62dc9 100644 --- a/main/refuse/trait.Collectable.html +++ b/main/refuse/trait.Collectable.html @@ -1,4 +1,4 @@ -Collectable in refuse - Rust +Collectable in refuse - Rust

Trait refuse::Collectable

source ·
pub trait Collectable: Trace + MapAs + Send + Sync + 'static { }
Expand description

A type that can be garbage collected.

A type needs to implement both Trace and MapAs to be collectable.

If a type can’t contain any Ref<T>s and no mapping functionality is diff --git a/main/refuse/trait.ContainsNoRefs.html b/main/refuse/trait.ContainsNoRefs.html index c9cc5a9..8e9d3c5 100644 --- a/main/refuse/trait.ContainsNoRefs.html +++ b/main/refuse/trait.ContainsNoRefs.html @@ -1,4 +1,4 @@ -ContainsNoRefs in refuse - Rust

+ContainsNoRefs in refuse - Rust
pub trait ContainsNoRefs: Send + Sync + 'static { }
Expand description

A type that can be garbage collected that cannot contain any Ref<T>s.

Types that implement this trait automatically implement Collectable. This trait reduces the boilerplate for implementing Collectable for diff --git a/main/refuse/trait.MapAs.html b/main/refuse/trait.MapAs.html index 19969b3..73ca5c5 100644 --- a/main/refuse/trait.MapAs.html +++ b/main/refuse/trait.MapAs.html @@ -1,4 +1,4 @@ -MapAs in refuse - Rust

+MapAs in refuse - Rust

Trait refuse::MapAs

source ·
pub trait MapAs: Send + Sync + 'static {
     type Target: ?Sized + 'static;
 
diff --git a/main/refuse/trait.NoMapping.html b/main/refuse/trait.NoMapping.html
index 9f4b479..5656642 100644
--- a/main/refuse/trait.NoMapping.html
+++ b/main/refuse/trait.NoMapping.html
@@ -1,4 +1,4 @@
-NoMapping in refuse - Rust
+NoMapping in refuse - Rust
     

Trait refuse::NoMapping

source ·
pub trait NoMapping: Send + Sync + 'static { }
Expand description

A type that implements MapAs with an empty implementation.

Implementations on Foreign Types§

source§

impl<K> NoMapping for BTreeSet<K>
where K: Send + Sync + 'static,

source§

impl<K> NoMapping for Set<K>
where diff --git a/main/refuse/trait.SimpleType.html b/main/refuse/trait.SimpleType.html index cff4b0c..28ca71c 100644 --- a/main/refuse/trait.SimpleType.html +++ b/main/refuse/trait.SimpleType.html @@ -1,4 +1,4 @@ -SimpleType in refuse - Rust +SimpleType in refuse - Rust

Trait refuse::SimpleType

source ·
pub trait SimpleType: Send + Sync + 'static { }
Expand description

A type that can contain no Ref<T>s and has an empty MapAs implementation.

Implementing this trait for a type automatically implements NoMapping diff --git a/main/refuse/trait.Trace.html b/main/refuse/trait.Trace.html index ffe9066..9db1abf 100644 --- a/main/refuse/trait.Trace.html +++ b/main/refuse/trait.Trace.html @@ -1,4 +1,4 @@ -Trace in refuse - Rust

+Trace in refuse - Rust

Trait refuse::Trace

source ·
pub trait Trace: Send + Sync + 'static {
     const MAY_CONTAIN_REFERENCES: bool;
 
@@ -28,7 +28,7 @@
     T: Trace,

source§

const MAY_CONTAIN_REFERENCES: bool = T::MAY_CONTAIN_REFERENCES

source§

fn trace(&self, tracer: &mut Tracer<'_>)

source§

impl<T> Trace for VecDeque<T>
where T: Trace,

source§

const MAY_CONTAIN_REFERENCES: bool = T::MAY_CONTAIN_REFERENCES

source§

fn trace(&self, tracer: &mut Tracer<'_>)

source§

impl<T> Trace for Vec<T>
where T: Trace,

source§

const MAY_CONTAIN_REFERENCES: bool = T::MAY_CONTAIN_REFERENCES

source§

fn trace(&self, tracer: &mut Tracer<'_>)

source§

impl<T, const N: usize> Trace for [T; N]
where - T: Trace,

source§

const MAY_CONTAIN_REFERENCES: bool = T::MAY_CONTAIN_REFERENCES

source§

fn trace(&self, tracer: &mut Tracer<'_>)

Implementors§

source§

impl Trace for AnyRef

source§

impl<T> Trace for Ref<T>
where + T: Trace,

source§

const MAY_CONTAIN_REFERENCES: bool = T::MAY_CONTAIN_REFERENCES

source§

fn trace(&self, tracer: &mut Tracer<'_>)

Implementors§

\ No newline at end of file diff --git a/main/search-index.js b/main/search-index.js index 678337c..3703364 100644 --- a/main/search-index.js +++ b/main/search-index.js @@ -1,5 +1,5 @@ var searchIndex = new Map(JSON.parse('[\ -["refuse",{"doc":"Refuse","t":"FKFKFTKYKFFKRKYFFNNCNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNHNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNMNNNNNNNNNNNMNNNHNNNNNNNNNNNNNNNNNNNNNNNNN","n":["AnyRef","Collectable","CollectionGuard","ContainsNoRefs","LocalPool","MAY_CONTAIN_REFERENCES","MapAs","MapAs","NoMapping","Ref","Root","SimpleType","Target","Trace","Trace","Tracer","WouldDeadlock","acquire","allocating_in","architecture","as_any","as_any","as_mut","as_ref","as_ref","as_ref","as_root","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","cast","cast","cast","cast","cast","cast","cast","cast_into","cast_into","cast_into","cast_into","cast_into","cast_into","cast_into","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","cmp","collect","collect","compare","default","deref","downcast_ref","downcast_root","downgrade","downgrade_any","drop","drop","drop","enter","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from_cast","from_cast","from_cast","from_cast","from_cast","from_cast","from_cast","hash","hash","hash","into","into","into","into","into","into","into","load","load","load_mapped","map_as","mark","new","new","partial_cmp","ptr_eq","root_count","to_owned","to_owned","to_owned","to_owned","to_string","trace","trace","trace","trace","try_collect","try_collect","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_while_unlocked","type_id","type_id","type_id","type_id","type_id","type_id","type_id","while_unlocked","yield_to_collector"],"q":[[0,"refuse"],[164,"core::option"],[165,"intentional::cast"],[166,"core::cmp"],[167,"core::cmp"],[168,"core::fmt"],[169,"core::hash"],[170,"core::convert"],[171,"core::convert"],[172,"core::result"],[173,"core::ops::function"],[174,"core::any"]],"d":["A type-erased garbage collected reference.","A type that can be garbage collected.","A guard that prevents garbage collection while held.","A type that can be garbage collected that cannot contain …","A pool of garbage collected values.","If true, this type may contain references and should have …","A mapping from one type to another.","","A type that implements MapAs with an empty implementation.","A reference to data stored in a garbage collector.","A root reference to a T that has been allocated in the …","A type that can contain no Ref<T>s and has an empty MapAs …","The target type of the mapping.","A type that can find and mark any references it has.","","A tracer for the garbage collector.","An error indicating an operation would deadlock.","Acquires a lock that prevents the garbage collector from …","Returns a guard that allocates from pool.","Architecture overview of the underlying design of Refuse.","Returns this reference as an untyped reference.","Returns this reference as an untyped reference.","","","","","Loads a root reference to the underlying data. Returns None…","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Invokes the garbage collector.","Manually invokes the garbage collector.","","","","Returns a Ref<T> if the underlying reference points to a T.","Returns a Root<T> if the underlying reference points to a T…","Returns a “weak” reference to this root.","Returns an untyped “weak” reference erased to this …","","","","Acquires a collection guard for this pool.","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","","","Returns the argument unchanged.","","","","","","","","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Loads a reference to the underlying data. Returns None if …","Loads a reference to the underlying data. Returns None if …","Returns a reference to the result of MapAs::map_as(), if …","Maps self to target type.","Marks collectable as being referenced, ensuring it is not …","Stores value in the garbage collector, returning a root …","Stores value in the garbage collector, returning a “weak…","","Returns true if these two references point to the same …","Returns the current number of root references to this …","","","","","","Traces all refrences that this value references.","","","","Invokes the garbage collector.","Manually invokes the garbage collector.","","","","","","","","","","","","","","","Executes unlocked while this guard is temporarily released.","","","","","","","","Executes unlocked while this guard is temporarily released.","Yield to the garbage collector, if needed."],"i":[0,0,0,0,0,28,0,0,0,0,0,0,21,0,0,0,0,1,1,0,3,6,1,1,3,6,6,2,1,22,3,6,9,4,2,1,22,3,6,9,4,2,1,22,3,6,9,4,2,1,22,3,6,9,4,3,6,9,4,3,6,9,4,3,0,1,3,2,3,4,4,3,3,2,1,3,2,3,3,3,3,3,6,6,6,6,6,9,4,9,9,2,1,22,3,6,9,4,4,4,4,4,2,1,22,3,6,9,4,3,6,4,2,1,22,3,6,9,4,6,4,4,21,22,3,6,3,3,3,3,6,9,4,9,28,3,6,4,0,1,2,1,22,3,6,9,4,2,1,22,3,6,9,4,1,2,1,22,3,6,9,4,1,1],"f":"`````````````````{{}b}{{bd}b}`{{{f{c}}}hj}{{{l{c}}}hj}{bb}0{{{f{c}}}{{l{c}}}j}{{{l{c}}}{{l{c}}}{}}{{{l{c}}b}{{n{{f{c}}}}}j}{ce{}{}}0000000000000{cg{}{}{{A`{e}}}}0000001111111{{{f{c}}}{{f{c}}}j}4{AbAb}{hh}{{ce}Ad{}{}}000{{{f{c}}{f{c}}}Af{jAh}}{{}Ad}{bAd}{{ce}Af{}{}}{{}d}{{{f{c}}}ej{}}{h{{n{{l{c}}}}}j}{{hb}{{n{{f{c}}}}}j}{{{f{c}}}{{l{c}}}j}{{{f{c}}}hj}{dAd}8{{{f{c}}}Adj}{db}{{{f{c}}{l{c}}}Ajj}{{{f{c}}h}Ajj}10{{{f{c}}{f{c}}}Aj{jAl}}{{{l{c}}{f{c}}}Ajj}{{{l{c}}{l{c}}}Aj{}}1{{{l{c}}h}Ajj}0{{AbAb}Aj}{{hh}Aj}{{AbAn}B`}0{cc{}}00000{hh}{{{l{c}}}hj}0?22222222{{{f{c}}e}Ad{jBb}Bd}{{{l{c}}e}Ad{}Bd}{{hc}AdBd}{ce{}{}}000000{{{l{c}}b}{{n{c}}}j}{{hb}{{n{c}}}j}{{hb}{{n{c}}}Bf}{{{Bj{}{{Bh{c}}}}}cBf}{{Blc}Ad{{Bn{h}}}}{{ce}{{f{c}}}j{{C`{b}}}}{{ce}{{l{c}}}j{{C`{b}}}}{{{f{c}}{f{c}}}{{n{Af}}}{jCb}}{{{f{c}}{f{c}}}Ajj}{{{f{c}}}Cdj}::::{cCf{}}{{ChBl}Ad}{{{f{c}}Bl}Adj}{{{l{c}}Bl}Adj}{{hBl}Ad}{{}{{Cj{AdAb}}}}{b{{Cj{AdAb}}}}{c{{Cj{e}}}{}{}}0000000000000{{be}{{Cj{cAb}}}{}{{Cn{}{{Cl{c}}}}}}{cD`{}}000000{{be}c{}{{Cn{}{{Cl{c}}}}}}{bAd}","c":[],"p":[[5,"CollectionGuard",0],[5,"LocalPool",0],[5,"Root",0],[5,"AnyRef",0],[10,"Collectable",0],[5,"Ref",0],[6,"Option",164],[10,"CastFrom",165],[5,"WouldDeadlock",0],[1,"unit"],[6,"Ordering",166],[10,"Ord",166],[1,"bool"],[10,"PartialEq",166],[5,"Formatter",167],[8,"Result",167],[10,"Hash",168],[10,"Hasher",168],[10,"Sized",169],[17,"Target"],[10,"MapAs",0],[5,"Tracer",0],[10,"Into",170],[10,"AsRef",170],[10,"PartialOrd",166],[1,"u64"],[5,"String",171],[10,"Trace",0],[6,"Result",172],[17,"Output"],[10,"FnOnce",173],[5,"TypeId",174]],"b":[[77,"impl-PartialEq%3C%26Ref%3CT%3E%3E-for-Root%3CT%3E"],[78,"impl-PartialEq%3C%26AnyRef%3E-for-Root%3CT%3E"],[79,"impl-PartialEq%3CRef%3CT%3E%3E-for-Root%3CT%3E"],[80,"impl-PartialEq%3CAnyRef%3E-for-Root%3CT%3E"],[81,"impl-PartialEq-for-Root%3CT%3E"],[82,"impl-PartialEq%3CRoot%3CT%3E%3E-for-Ref%3CT%3E"],[83,"impl-PartialEq-for-Ref%3CT%3E"],[84,"impl-PartialEq%3C%26Root%3CT%3E%3E-for-Ref%3CT%3E"],[85,"impl-PartialEq%3CAnyRef%3E-for-Ref%3CT%3E"],[86,"impl-PartialEq%3C%26AnyRef%3E-for-Ref%3CT%3E"],[89,"impl-Display-for-WouldDeadlock"],[90,"impl-Debug-for-WouldDeadlock"],[97,"impl-From%3C%26AnyRef%3E-for-AnyRef"],[98,"impl-From%3C%26Ref%3CT%3E%3E-for-AnyRef"],[99,"impl-From%3CRef%3CT%3E%3E-for-AnyRef"],[100,"impl-From%3C%26Root%3CT%3E%3E-for-AnyRef"]]}]\ +["refuse",{"doc":"Refuse","t":"FKFKFTKYKFFKRKYFFNNCNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNHNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNMNNNNNNNNNNNMNNNHNNNNNNNNNNNNNNNNNNNNNNNNN","n":["AnyRef","Collectable","CollectionGuard","ContainsNoRefs","LocalPool","MAY_CONTAIN_REFERENCES","MapAs","MapAs","NoMapping","Ref","Root","SimpleType","Target","Trace","Trace","Tracer","WouldDeadlock","acquire","allocating_in","architecture","as_any","as_any","as_mut","as_ref","as_ref","as_ref","as_root","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","cast","cast","cast","cast","cast","cast","cast","cast_into","cast_into","cast_into","cast_into","cast_into","cast_into","cast_into","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","cmp","collect","collect","compare","default","deref","downcast_ref","downcast_root","downgrade","downgrade_any","drop","drop","drop","enter","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from_cast","from_cast","from_cast","from_cast","from_cast","from_cast","from_cast","hash","hash","hash","into","into","into","into","into","into","into","load","load","load_mapped","map_as","mark","new","new","partial_cmp","ptr_eq","root_count","to_owned","to_owned","to_owned","to_owned","to_string","trace","trace","trace","trace","try_collect","try_collect","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_while_unlocked","type_id","type_id","type_id","type_id","type_id","type_id","type_id","while_unlocked","yield_to_collector"],"q":[[0,"refuse"],[164,"core::option"],[165,"intentional::cast"],[166,"core::cmp"],[167,"core::cmp"],[168,"core::fmt"],[169,"core::hash"],[170,"core::convert"],[171,"core::convert"],[172,"core::result"],[173,"core::ops::function"],[174,"core::any"]],"d":["A type-erased garbage collected reference.","A type that can be garbage collected.","A guard that prevents garbage collection while held.","A type that can be garbage collected that cannot contain …","A pool of garbage collected values.","If true, this type may contain references and should have …","A mapping from one type to another.","","A type that implements MapAs with an empty implementation.","A reference to data stored in a garbage collector.","A root reference to a T that has been allocated in the …","A type that can contain no Ref<T>s and has an empty MapAs …","The target type of the mapping.","A type that can find and mark any references it has.","","A tracer for the garbage collector.","An error indicating an operation would deadlock.","Acquires a lock that prevents the garbage collector from …","Returns a guard that allocates from pool.","Architecture overview of the underlying design of Refuse.","Returns this reference as an untyped reference.","Returns this reference as an untyped reference.","","","","","Loads a root reference to the underlying data. Returns None…","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Invokes the garbage collector.","Manually invokes the garbage collector.","","","","Returns a Ref<T>.","Returns a Root<T> if the underlying reference points to a T…","Returns a “weak” reference to this root.","Returns an untyped “weak” reference erased to this …","","","","Acquires a collection guard for this pool.","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","","","Returns the argument unchanged.","","","","","","","","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Loads a reference to the underlying data. Returns None if …","Loads a reference to the underlying data. Returns None if …","Returns a reference to the result of MapAs::map_as(), if …","Maps self to target type.","Marks collectable as being referenced, ensuring it is not …","Stores value in the garbage collector, returning a root …","Stores value in the garbage collector, returning a “weak…","","Returns true if these two references point to the same …","Returns the current number of root references to this …","","","","","","Traces all refrences that this value references.","","","","Invokes the garbage collector.","Manually invokes the garbage collector.","","","","","","","","","","","","","","","Executes unlocked while this guard is temporarily released.","","","","","","","","Executes unlocked while this guard is temporarily released.","Yield to the garbage collector, if needed."],"i":[0,0,0,0,0,28,0,0,0,0,0,0,21,0,0,0,0,1,1,0,3,6,1,1,3,6,6,2,1,22,3,6,9,4,2,1,22,3,6,9,4,2,1,22,3,6,9,4,2,1,22,3,6,9,4,3,6,9,4,3,6,9,4,3,0,1,3,2,3,4,4,3,3,2,1,3,2,3,3,3,3,3,6,6,6,6,6,9,4,9,9,2,1,22,3,6,9,4,4,4,4,4,2,1,22,3,6,9,4,3,6,4,2,1,22,3,6,9,4,6,4,4,21,22,3,6,3,3,3,3,6,9,4,9,28,3,6,4,0,1,2,1,22,3,6,9,4,2,1,22,3,6,9,4,1,2,1,22,3,6,9,4,1,1],"f":"`````````````````{{}b}{{bd}b}`{{{f{c}}}hj}{{{l{c}}}hj}{bb}0{{{f{c}}}{{l{c}}}j}{{{l{c}}}{{l{c}}}{}}{{{l{c}}b}{{n{{f{c}}}}}j}{ce{}{}}0000000000000{cg{}{}{{A`{e}}}}0000001111111{{{f{c}}}{{f{c}}}j}4{AbAb}{hh}{{ce}Ad{}{}}000{{{f{c}}{f{c}}}Af{jAh}}{{}Ad}{bAd}{{ce}Af{}{}}{{}d}{{{f{c}}}ej{}}{h{{l{c}}}j}{{hb}{{n{{f{c}}}}}j}{{{f{c}}}{{l{c}}}j}{{{f{c}}}hj}{dAd}8{{{f{c}}}Adj}{db}{{{f{c}}{f{c}}}Aj{jAl}}{{{f{c}}{l{c}}}Ajj}{{{f{c}}h}Ajj}10{{{l{c}}h}Ajj}0{{{l{c}}{l{c}}}Aj{}}{{{l{c}}{f{c}}}Ajj}0{{AbAb}Aj}{{hh}Aj}{{AbAn}B`}0{cc{}}00000{hh}>{{{l{c}}}hj}022222222{{{f{c}}e}Ad{jBb}Bd}{{{l{c}}e}Ad{}Bd}{{hc}AdBd}{ce{}{}}000000{{{l{c}}b}{{n{c}}}j}{{hb}{{n{c}}}j}{{hb}{{n{c}}}Bf}{{{Bj{}{{Bh{c}}}}}cBf}{{Blc}Ad{{Bn{h}}}}{{ce}{{f{c}}}j{{C`{b}}}}{{ce}{{l{c}}}j{{C`{b}}}}{{{f{c}}{f{c}}}{{n{Af}}}{jCb}}{{{f{c}}{f{c}}}Ajj}{{{f{c}}}Cdj}::::{cCf{}}{{ChBl}Ad}{{{f{c}}Bl}Adj}{{{l{c}}Bl}Adj}{{hBl}Ad}{{}{{Cj{AdAb}}}}{b{{Cj{AdAb}}}}{c{{Cj{e}}}{}{}}0000000000000{{be}{{Cj{cAb}}}{}{{Cn{}{{Cl{c}}}}}}{cD`{}}000000{{be}c{}{{Cn{}{{Cl{c}}}}}}{bAd}","c":[],"p":[[5,"CollectionGuard",0],[5,"LocalPool",0],[5,"Root",0],[5,"AnyRef",0],[10,"Collectable",0],[5,"Ref",0],[6,"Option",164],[10,"CastFrom",165],[5,"WouldDeadlock",0],[1,"unit"],[6,"Ordering",166],[10,"Ord",166],[1,"bool"],[10,"PartialEq",166],[5,"Formatter",167],[8,"Result",167],[10,"Hash",168],[10,"Hasher",168],[10,"Sized",169],[17,"Target"],[10,"MapAs",0],[5,"Tracer",0],[10,"Into",170],[10,"AsRef",170],[10,"PartialOrd",166],[1,"u64"],[5,"String",171],[10,"Trace",0],[6,"Result",172],[17,"Output"],[10,"FnOnce",173],[5,"TypeId",174]],"b":[[77,"impl-PartialEq-for-Root%3CT%3E"],[78,"impl-PartialEq%3CRef%3CT%3E%3E-for-Root%3CT%3E"],[79,"impl-PartialEq%3C%26AnyRef%3E-for-Root%3CT%3E"],[80,"impl-PartialEq%3C%26Ref%3CT%3E%3E-for-Root%3CT%3E"],[81,"impl-PartialEq%3CAnyRef%3E-for-Root%3CT%3E"],[82,"impl-PartialEq%3CAnyRef%3E-for-Ref%3CT%3E"],[83,"impl-PartialEq%3C%26AnyRef%3E-for-Ref%3CT%3E"],[84,"impl-PartialEq-for-Ref%3CT%3E"],[85,"impl-PartialEq%3CRoot%3CT%3E%3E-for-Ref%3CT%3E"],[86,"impl-PartialEq%3C%26Root%3CT%3E%3E-for-Ref%3CT%3E"],[89,"impl-Debug-for-WouldDeadlock"],[90,"impl-Display-for-WouldDeadlock"],[97,"impl-From%3C%26AnyRef%3E-for-AnyRef"],[98,"impl-From%3C%26Root%3CT%3E%3E-for-AnyRef"],[99,"impl-From%3CRef%3CT%3E%3E-for-AnyRef"],[100,"impl-From%3C%26Ref%3CT%3E%3E-for-AnyRef"]]}]\ ]')); if (typeof exports !== 'undefined') exports.searchIndex = searchIndex; else if (window.initSearch) window.initSearch(searchIndex); diff --git a/main/settings.html b/main/settings.html index 76a3ada..94c4132 100644 --- a/main/settings.html +++ b/main/settings.html @@ -1,2 +1,2 @@ -Settings +Settings

Rustdoc settings

Back
\ No newline at end of file diff --git a/main/src/refuse/lib.rs.html b/main/src/refuse/lib.rs.html index 834bf10..3584cc4 100644 --- a/main/src/refuse/lib.rs.html +++ b/main/src/refuse/lib.rs.html @@ -1,4 +1,4 @@ -lib.rs - source 2726 2727 2728 -2729 -2730 -2731
#![doc = include_str!("../README.md")]
 
 use core::slice;
@@ -4486,9 +4483,8 @@ 

Files

) -> Option<&'guard Rooted<T>> { bins.get(&self.any.type_index)? .as_any() - .downcast_ref::<Bin<T>>() - .assert("type mismatch") - .load(self.any.bin_id, self.any.slot_generation, guard) + .downcast_ref::<Bin<T>>()? + .load(self.any.bin_id, self.any.slot_generation, guard) } fn load_slot<'guard>(&self, guard: &'guard CollectionGuard<'_>) -> Option<&'guard Rooted<T>> { @@ -4875,11 +4871,10 @@

Files

bin: &dyn AnyBin, guard: &'guard CollectionGuard<'_>, ) -> Option<&'guard C::Target> { - let ref_counted = bin - .as_any() - .downcast_ref::<Bin<C>>() - .expect("type mismatch") - .load(id, slot_generation, guard)?; + let ref_counted = + bin.as_any() + .downcast_ref::<Bin<C>>()? + .load(id, slot_generation, guard)?; Some(ref_counted.value.map_as()) } @@ -5334,23 +5329,19 @@

Files

} impl AnyRef { - /// Returns a [`Ref<T>`] if the underlying reference points to a `T`. + /// Returns a [`Ref<T>`]. + /// + /// This function does not do any type checking. If `T` is not the correct + /// type, attempting to load the underyling value will fail. #[must_use] - pub fn downcast_ref<T>(&self) -> Option<Ref<T>> + pub const fn downcast_ref<T>(&self) -> Ref<T> where T: Collectable, { - let correct_type = GlobalCollector::get() - .info - .type_indexes - .read() - .get(&TypeId::of::<T>()) - == Some(&self.type_index); - - correct_type.then_some(Ref { + Ref { any: *self, _t: PhantomData, - }) + } } /// Returns a [`Root<T>`] if the underlying reference points to a `T` that @@ -5360,7 +5351,7 @@

Files

where T: Collectable, { - self.downcast_ref().and_then(|r| r.as_root(guard)) + self.downcast_ref().as_root(guard) } /// Loads a reference to the underlying data. Returns `None` if the data has @@ -5370,7 +5361,7 @@

Files

where T: Collectable, { - self.downcast_ref().and_then(|r| r.load(guard)) + self.downcast_ref().load(guard) } /// Returns a reference to the result of [`MapAs::map_as()`], if the value @@ -5462,4 +5453,7 @@

Files

self.bin_id.hash(state); } } + +#[cfg(test)] +mod tests;
\ No newline at end of file