Struct ObjectRecyclerToken<T>
A lightweight container for an underlying ObjectRecycler<T> object.
public readonly struct ObjectRecyclerToken<T> : IDisposable where T : class
Type Parameters
T
Object type.
- Implements
- Inherited Members
- Extension Methods
Properties
Owner
ObjectRecycler<T> instance that owns this token.
public ObjectRecycler<T>? Owner { get; }
Property Value
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
Remarks
Frees the underlying object and returns it to the recycler for future use.
GetObject()
Extracts the underlying object from this token.
[Pure]
public T GetObject()
Returns
- T
Underlying object.
Exceptions
- ObjectDisposedException
When this token has been disposed.
ToString()
Returns a string representation of this ObjectRecyclerToken<T> instance.
[Pure]
public override string ToString()
Returns
- string
String representation.