diff --git a/main/refuse/all.html b/main/refuse/all.html index a2d9c97..d5a3c45 100644 --- a/main/refuse/all.html +++ b/main/refuse/all.html @@ -1 +1 @@ -List of all items in this crate

List of all items

Structs

Traits

Derive Macros

Functions

\ No newline at end of file +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 f07e942..a5d28f7 100644 --- a/main/refuse/architecture/index.html +++ b/main/refuse/architecture/index.html @@ -1,4 +1,4 @@ -refuse::architecture - Rust

Module refuse::architecture

source ·
Expand description

Architecture overview of the underlying design of Refuse.

+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 collectors can only run when it knows no threads are currently accessing diff --git a/main/refuse/derive.MapAs.html b/main/refuse/derive.MapAs.html index bcc0301..2b4bdab 100644 --- a/main/refuse/derive.MapAs.html +++ b/main/refuse/derive.MapAs.html @@ -1,4 +1,4 @@ -MapAs in refuse - Rust

Derive Macro refuse::MapAs

#[derive(MapAs)]
+MapAs in refuse - Rust

Derive Macro refuse::MapAs

#[derive(MapAs)]
 {
     // Attributes available to this derive:
     #[map_as]
diff --git a/main/refuse/derive.Trace.html b/main/refuse/derive.Trace.html
index 76996ab..18e54ae 100644
--- a/main/refuse/derive.Trace.html
+++ b/main/refuse/derive.Trace.html
@@ -1,4 +1,4 @@
-Trace in refuse - Rust

Derive Macro refuse::Trace

#[derive(Trace)]
+Trace in refuse - Rust

Derive Macro refuse::Trace

#[derive(Trace)]
 {
     // Attributes available to this derive:
     #[trace]
diff --git a/main/refuse/fn.collect.html b/main/refuse/fn.collect.html
index 2c36f1b..65bfd23 100644
--- a/main/refuse/fn.collect.html
+++ b/main/refuse/fn.collect.html
@@ -1,4 +1,4 @@
-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 a222a50..3e8fa24 100644 --- a/main/refuse/fn.try_collect.html +++ b/main/refuse/fn.try_collect.html @@ -1,4 +1,4 @@ -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 8869a57..dce800e 100644 --- a/main/refuse/index.html +++ b/main/refuse/index.html @@ -1,4 +1,4 @@ -refuse - Rust

Crate refuse

source ·
Expand description

§Refuse

+refuse - Rust

Crate refuse

source ·
Expand description

§Refuse

An easy-to-use, incremental, multi-threaded garbage collector for Rust.

//! A basic usage example demonstrating the garbage collector.
diff --git a/main/refuse/struct.AnyRef.html b/main/refuse/struct.AnyRef.html
index 698da6f..031190e 100644
--- a/main/refuse/struct.AnyRef.html
+++ b/main/refuse/struct.AnyRef.html
@@ -1,4 +1,4 @@
-AnyRef in refuse - Rust

Struct refuse::AnyRef

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

A type-erased garbage collected reference.

+AnyRef in refuse - Rust

Struct refuse::AnyRef

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

A type-erased garbage collected reference.

Implementations§

source§

impl AnyRef

source

pub const fn downcast_ref<T>(&self) -> Ref<T>
where T: Collectable,

Returns a Ref<T>.

This function does not do any type checking. If T is not the correct diff --git a/main/refuse/struct.AnyRoot.html b/main/refuse/struct.AnyRoot.html index 002e1ad..44e62d7 100644 --- a/main/refuse/struct.AnyRoot.html +++ b/main/refuse/struct.AnyRoot.html @@ -1,4 +1,4 @@ -AnyRoot in refuse - Rust

Struct refuse::AnyRoot

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

A type-erased root garbage collected reference.

+AnyRoot in refuse - Rust

Struct refuse::AnyRoot

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

A type-erased root garbage collected reference.

Implementations§

source§

impl AnyRoot

source

pub fn load<T>(&self) -> Option<&T>
where T: Collectable,

Loads a reference to the underlying data. Returns None if T is not the type of the underlying data.

diff --git a/main/refuse/struct.CollectionGuard.html b/main/refuse/struct.CollectionGuard.html index e0c2335..574928b 100644 --- a/main/refuse/struct.CollectionGuard.html +++ b/main/refuse/struct.CollectionGuard.html @@ -1,4 +1,4 @@ -CollectionGuard in refuse - Rust

Struct refuse::CollectionGuard

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

A guard that prevents garbage collection while held.

+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 ensuring the garbage collector can’t run while it exists.

diff --git a/main/refuse/struct.LocalPool.html b/main/refuse/struct.LocalPool.html index 4c98dcd..635c258 100644 --- a/main/refuse/struct.LocalPool.html +++ b/main/refuse/struct.LocalPool.html @@ -1,4 +1,4 @@ -LocalPool in refuse - Rust

Struct refuse::LocalPool

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

A pool of garbage collected values.

+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 across many threads might be beneficial. However, an individual local pool diff --git a/main/refuse/struct.Ref.html b/main/refuse/struct.Ref.html index cf8fb04..8423ed2 100644 --- a/main/refuse/struct.Ref.html +++ b/main/refuse/struct.Ref.html @@ -1,4 +1,4 @@ -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.

+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 marks this allocation, it will be collected.

diff --git a/main/refuse/struct.Root.html b/main/refuse/struct.Root.html index 6c5a8c7..17addf3 100644 --- a/main/refuse/struct.Root.html +++ b/main/refuse/struct.Root.html @@ -1,4 +1,4 @@ -Root in refuse - Rust

Struct refuse::Root

source ·
pub struct Root<T>
where +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 track the number of root references currently exist to the underlying value.

diff --git a/main/refuse/struct.Tracer.html b/main/refuse/struct.Tracer.html index d823945..6220ed2 100644 --- a/main/refuse/struct.Tracer.html +++ b/main/refuse/struct.Tracer.html @@ -1,4 +1,4 @@ -Tracer in refuse - Rust

Struct refuse::Tracer

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

A tracer for the garbage collector.

+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.

Implementations§

source§

impl<'a> Tracer<'a>

source

pub fn mark(&mut self, collectable: impl Into<AnyRef>)

Marks collectable as being referenced, ensuring it is not garbage diff --git a/main/refuse/struct.WouldDeadlock.html b/main/refuse/struct.WouldDeadlock.html index 25a2fc9..4208dbe 100644 --- a/main/refuse/struct.WouldDeadlock.html +++ b/main/refuse/struct.WouldDeadlock.html @@ -1,4 +1,4 @@ -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 diff --git a/main/refuse/struct.YieldComplete.html b/main/refuse/struct.YieldComplete.html index a1897f3..bb5051f 100644 --- a/main/refuse/struct.YieldComplete.html +++ b/main/refuse/struct.YieldComplete.html @@ -1,4 +1,4 @@ -YieldComplete in refuse - Rust

Struct refuse::YieldComplete

source ·
pub struct YieldComplete;
Expand description

A marker indicating that a coordinated +YieldComplete in refuse - Rust

Struct refuse::YieldComplete

source ·
pub struct YieldComplete;
Expand description

A marker indicating that a coordinated yield has completed.

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 diff --git a/main/refuse/struct.Yielder.html b/main/refuse/struct.Yielder.html index ce8987c..aa99383 100644 --- a/main/refuse/struct.Yielder.html +++ b/main/refuse/struct.Yielder.html @@ -1,4 +1,4 @@ -Yielder in refuse - Rust

Struct refuse::Yielder

source ·
pub struct Yielder<'a>(/* private fields */);
Expand description

A pending yield to the garbage collector.

+Yielder in refuse - Rust

Struct refuse::Yielder

source ·
pub struct Yielder<'a>(/* private fields */);
Expand description

A pending yield to the garbage collector.

Implementations§

source§

impl Yielder<'_>

source

pub fn wait(self) -> YieldComplete

Waits for the garbage collector to finish the current collection.

Auto Trait Implementations§

§

impl<'a> Freeze for Yielder<'a>

§

impl<'a> !RefUnwindSafe for Yielder<'a>

§

impl<'a> Send for Yielder<'a>

§

impl<'a> Sync for Yielder<'a>

§

impl<'a> Unpin for Yielder<'a>

§

impl<'a> !UnwindSafe for Yielder<'a>

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 diff --git a/main/refuse/trait.Collectable.html b/main/refuse/trait.Collectable.html index 1539c49..23d994d 100644 --- a/main/refuse/trait.Collectable.html +++ b/main/refuse/trait.Collectable.html @@ -1,4 +1,4 @@ -Collectable in refuse - Rust

Trait refuse::Collectable

source ·
pub trait Collectable:
+Collectable in refuse - Rust

Trait refuse::Collectable

source ·
pub trait Collectable:
     Trace
     + MapAs
     + Send
diff --git a/main/refuse/trait.ContainsNoRefs.html b/main/refuse/trait.ContainsNoRefs.html
index a536a98..8b1ae93 100644
--- a/main/refuse/trait.ContainsNoRefs.html
+++ b/main/refuse/trait.ContainsNoRefs.html
@@ -1,4 +1,4 @@
-ContainsNoRefs in refuse - Rust

Trait refuse::ContainsNoRefs

source ·
pub trait ContainsNoRefs:
+ContainsNoRefs in refuse - Rust

Trait refuse::ContainsNoRefs

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

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

diff --git a/main/refuse/trait.MapAs.html b/main/refuse/trait.MapAs.html index a704179..b5c2885 100644 --- a/main/refuse/trait.MapAs.html +++ b/main/refuse/trait.MapAs.html @@ -1,4 +1,4 @@ -MapAs in refuse - Rust

Trait refuse::MapAs

source ·
pub trait MapAs:
+MapAs in refuse - Rust

Trait refuse::MapAs

source ·
pub trait MapAs:
     Send
     + Sync
     + 'static {
diff --git a/main/refuse/trait.NoMapping.html b/main/refuse/trait.NoMapping.html
index 53f7df7..4d1bfad 100644
--- a/main/refuse/trait.NoMapping.html
+++ b/main/refuse/trait.NoMapping.html
@@ -1,4 +1,4 @@
-NoMapping in refuse - Rust

Trait refuse::NoMapping

source ·
pub trait NoMapping:
+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.

diff --git a/main/refuse/trait.SimpleType.html b/main/refuse/trait.SimpleType.html index 55838ac..067c546 100644 --- a/main/refuse/trait.SimpleType.html +++ b/main/refuse/trait.SimpleType.html @@ -1,4 +1,4 @@ -SimpleType in refuse - Rust

Trait refuse::SimpleType

source ·
pub trait SimpleType:
+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 diff --git a/main/refuse/trait.Trace.html b/main/refuse/trait.Trace.html index 6b1496a..6c513ba 100644 --- a/main/refuse/trait.Trace.html +++ b/main/refuse/trait.Trace.html @@ -1,4 +1,4 @@ -Trace in refuse - Rust

Trait refuse::Trace

source ·
pub trait Trace:
+Trace in refuse - Rust

Trait refuse::Trace

source ·
pub trait Trace:
     Send
     + Sync
     + 'static {
diff --git a/main/refuse_macros/all.html b/main/refuse_macros/all.html
index 2f82d67..0e6f5d5 100644
--- a/main/refuse_macros/all.html
+++ b/main/refuse_macros/all.html
@@ -1 +1 @@
-List of all items in this crate

List of all items

Derive Macros

\ No newline at end of file +List of all items in this crate

List of all items

Derive Macros

\ No newline at end of file diff --git a/main/refuse_macros/derive.MapAs.html b/main/refuse_macros/derive.MapAs.html index 3ad2a23..a022de0 100644 --- a/main/refuse_macros/derive.MapAs.html +++ b/main/refuse_macros/derive.MapAs.html @@ -1,4 +1,4 @@ -MapAs in refuse_macros - Rust

Derive Macro refuse_macros::MapAs

source ·
#[derive(MapAs)]
+MapAs in refuse_macros - Rust

Derive Macro refuse_macros::MapAs

source ·
#[derive(MapAs)]
 {
     // Attributes available to this derive:
     #[map_as]
diff --git a/main/refuse_macros/derive.Trace.html b/main/refuse_macros/derive.Trace.html
index 0885226..837e74b 100644
--- a/main/refuse_macros/derive.Trace.html
+++ b/main/refuse_macros/derive.Trace.html
@@ -1,4 +1,4 @@
-Trace in refuse_macros - Rust

Derive Macro refuse_macros::Trace

source ·
#[derive(Trace)]
+Trace in refuse_macros - Rust

Derive Macro refuse_macros::Trace

source ·
#[derive(Trace)]
 {
     // Attributes available to this derive:
     #[trace]
diff --git a/main/refuse_macros/index.html b/main/refuse_macros/index.html
index 0db487b..e0fb823 100644
--- a/main/refuse_macros/index.html
+++ b/main/refuse_macros/index.html
@@ -1,3 +1,3 @@
-refuse_macros - Rust

Crate refuse_macros

source ·
Expand description

Macros for the Refuse garbage +refuse_macros - Rust

Crate refuse_macros

source ·
Expand description

Macros for the Refuse garbage collector.

Derive Macros§

\ No newline at end of file diff --git a/main/refuse_pool/all.html b/main/refuse_pool/all.html index 31507e1..d83eeac 100644 --- a/main/refuse_pool/all.html +++ b/main/refuse_pool/all.html @@ -1 +1 @@ -List of all items in this crate

List of all items

Structs

\ No newline at end of file +List of all items in this crate

List of all items

Structs

\ No newline at end of file diff --git a/main/refuse_pool/index.html b/main/refuse_pool/index.html index 25487d3..f843d84 100644 --- a/main/refuse_pool/index.html +++ b/main/refuse_pool/index.html @@ -1,4 +1,4 @@ -refuse_pool - Rust

Crate refuse_pool

source ·
Expand description

Garbage-collected “interned” strings.

+refuse_pool - Rust

Crate refuse_pool

source ·
Expand description

Garbage-collected “interned” strings.

Interning is a process of making many equal things share the same underlying resource. This crate introduces two types that are powered by the Refuse garbage collector:

diff --git a/main/refuse_pool/struct.RefString.html b/main/refuse_pool/struct.RefString.html index c46a8ea..4f3a9b8 100644 --- a/main/refuse_pool/struct.RefString.html +++ b/main/refuse_pool/struct.RefString.html @@ -1,16 +1,16 @@ -RefString in refuse_pool - Rust

Struct refuse_pool::RefString

source ·
pub struct RefString(/* private fields */);
Expand description

A weak reference to a garbage collected, interned string.

+RefString in refuse_pool - Rust

Struct refuse_pool::RefString

source ·
pub struct RefString(/* private fields */);
Expand description

A weak reference to a garbage collected, interned string.

Implementations§

source§

impl RefString

source

pub fn new<'a>(s: impl Into<Cow<'a, str>>) -> Self

Returns a reference to a garbage collected string that contains s.

If another RootString or RefString exists already with the same contents as s, it will be returned and s will be dropped.

-
source

pub fn from_any(any: AnyRef) -> Option<Self>

Upgrades a typeless reference to a pooled string reference.

+
source

pub fn from_any(any: AnyRef) -> Option<Self>

Upgrades a typeless reference to a pooled string reference.

Returns None if any is not a pooled string.

source

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

Loads a reference to the underlying string, if the string hasn’t been freed.

-
source

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

Loads this string as a root, if the string hasn’t been freed.

-
source

pub fn as_any(&self) -> AnyRef

Returns a typeless reference to this string.

+
source

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

Loads this string as a root, if the string hasn’t been freed.

+
source

pub fn as_any(&self) -> AnyRef

Returns a typeless reference to this string.

Trait Implementations§

source§

impl Clone for RefString

source§

fn clone(&self) -> RefString

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 RefString

source§

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

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

impl From<&String> for RefString

source§

fn from(value: &String) -> Self

Converts to this type from the input type.
source§

impl From<&str> for RefString

source§

fn from(value: &str) -> Self

Converts to this type from the input type.
source§

impl From<String> for RefString

source§

fn from(value: String) -> Self

Converts to this type from the input type.
source§

impl Hash for RefString

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 Ord for RefString

source§

fn cmp(&self, other: &RefString) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where @@ -22,8 +22,8 @@ and should not be overridden without very good reason.

source§

impl PartialOrd for RefString

source§

fn partial_cmp(&self, other: &RefString) -> 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

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

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

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

Tests greater than or equal to (for self and other) and is used by -the >= operator. Read more
source§

impl Trace for RefString

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 RefString

source§

impl Eq for RefString

source§

impl StructuralPartialEq for RefString

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +the >= operator. Read more

source§

impl Trace for RefString

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 RefString

source§

impl Eq for RefString

source§

impl StructuralPartialEq for RefString

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_pool/struct.RootString.html b/main/refuse_pool/struct.RootString.html index f3fc160..0a3bf1e 100644 --- a/main/refuse_pool/struct.RootString.html +++ b/main/refuse_pool/struct.RootString.html @@ -1,20 +1,20 @@ -RootString in refuse_pool - Rust

Struct refuse_pool::RootString

source ·
pub struct RootString(/* private fields */);
Expand description

A “root” reference to a garbage collected, interned string.

+RootString in refuse_pool - Rust

Struct refuse_pool::RootString

source ·
pub struct RootString(/* private fields */);
Expand description

A “root” reference to a garbage collected, interned string.

This type is cheap to check equality because it ensures each unique string is allocated only once, and references are reused automatically.

Implementations§

source§

impl RootString

source

pub fn new<'a>( s: impl Into<Cow<'a, str>>, - guard: impl AsRef<CollectionGuard<'a>>, + guard: impl AsRef<CollectionGuard<'a>>, ) -> Self

Returns a root reference to a garbage collected string that contains s.

If another RootString or RefString exists already with the same contents as s, it will be returned and s will be dropped.

source

pub const fn downgrade(&self) -> RefString

Returns a reference to this root string.

-
source

pub const fn downgrade_any(&self) -> AnyRef

Returns a typeless reference to this string.

+
source

pub const fn downgrade_any(&self) -> AnyRef

Returns a typeless reference to this string.

source

pub fn root_count(&self) -> u64

Returns the number of root references to this string, self included.

source

pub fn try_from_any<'a>( - root: AnyRoot, - guard: impl AsRef<CollectionGuard<'a>>, -) -> Result<Self, AnyRoot>

Try to convert a typeless root reference to a root string reference.

+ root: AnyRoot, + guard: impl AsRef<CollectionGuard<'a>>, +) -> Result<Self, AnyRoot>

Try to convert a typeless root reference to a root string reference.

§Errors

Returns Err(root) if root does not contain a pooled string.

Methods from Deref<Target = str>§

1.0.0 · source

pub fn len(&self) -> usize

Returns the length of self.

@@ -1272,8 +1272,8 @@
§Examples
source§

impl PartialOrd for RootString

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

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

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

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

Tests greater than or equal to (for self and other) and is used by -the >= operator. Read more
source§

impl Trace for RootString

source§

const MAY_CONTAIN_REFERENCES: bool = false

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 Eq for RootString

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +the >= operator. Read more

source§

impl Trace for RootString

source§

const MAY_CONTAIN_REFERENCES: bool = false

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 Eq for RootString

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/trait.impl/refuse/trait.Trace.js b/main/trait.impl/refuse/trait.Trace.js index 0d13a7c..1d207bc 100644 --- a/main/trait.impl/refuse/trait.Trace.js +++ b/main/trait.impl/refuse/trait.Trace.js @@ -1,4 +1,4 @@ (function() {var implementors = { "refuse":[], -"refuse_pool":[["impl Trace for RefString"],["impl Trace for RootString"]] +"refuse_pool":[["impl Trace for RefString"],["impl Trace for RootString"]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file