Struct SLazyNoLockNoCatch<T>
Provides support for lazy initialization.
Implements
Namespace: Towel
Assembly: Towel.dll
Syntax
public struct SLazyNoLockNoCatch<T> : ILazy<T>
Type Parameters
Name | Description |
---|---|
T | The type of value that is being lazily initialized. |
Constructors
| Improve this Doc View SourceSLazyNoLockNoCatch(T)
Constructs a new SLazyNoLockNoCatch<T> from a T
.
Declaration
public SLazyNoLockNoCatch(T value)
Parameters
Type | Name | Description |
---|---|---|
T | value | The value to initialize Value with. |
SLazyNoLockNoCatch(Func<T>)
Constructs a new SLazyNoLockNoCatch<T> from a
Declaration
public SLazyNoLockNoCatch(Func<T> func)
Parameters
Type | Name | Description |
---|---|---|
Func<T> | func | The method used to initialize Value. |
Properties
| Improve this Doc View SourceIsCachingExceptions
True if exceptions thrown by the factory delegate are being cached.
Declaration
public bool IsCachingExceptions { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsStructCopySafe
True if the lazy is safe from struct copies.
Declaration
public bool IsStructCopySafe { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsValueCreated
True if Value has been initialized.
Declaration
public bool IsValueCreated { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
ThreadSafety
The pattern of thread safety this lazy is using.
Declaration
public LazyThreadSafetyMode ThreadSafety { get; }
Property Value
Type | Description |
---|---|
LazyThreadSafetyMode |
Value
Gets the lazily initialized value.
Declaration
public T Value { get; }
Property Value
Type | Description |
---|---|
T |
Methods
| Improve this Doc View SourceEquals(Nullable<Object>)
Checks for equality between Value and obj
.
Declaration
public override bool Equals(object? obj)
Parameters
Type | Name | Description |
---|---|---|
System.Nullable<System.Object> | obj | The value to compare to Value. |
Returns
Type | Description |
---|---|
System.Boolean | True if Value and |
GetHashCode()
Gets the hash code of Value.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | The hash code of Value. |
ToString()
Returns a string that represents Value.
Declaration
public override string? ToString()
Returns
Type | Description |
---|---|
System.Nullable<System.String> | A string that represents Value |
Operators
| Improve this Doc View SourceEquality(SLazyNoLockNoCatch<T>, SLazyNoLockNoCatch<T>)
Checks for equality between left
and right
.
Declaration
public static bool operator ==(SLazyNoLockNoCatch<T> left, SLazyNoLockNoCatch<T> right)
Parameters
Type | Name | Description |
---|---|---|
SLazyNoLockNoCatch<T> | left | The first value of the equality check. |
SLazyNoLockNoCatch<T> | right | The second value of the equality check. |
Returns
Type | Description |
---|---|
System.Boolean | True if |
Implicit(T to SLazyNoLockNoCatch<T>)
Constructs a new SLazyNoCatch<T> from a T
.
Declaration
public static implicit operator SLazyNoLockNoCatch<T>(T value)
Parameters
Type | Name | Description |
---|---|---|
T | value | The value to initialize Value with. |
Returns
Type | Description |
---|---|
SLazyNoLockNoCatch<T> |
Implicit(Func<T> to SLazyNoLockNoCatch<T>)
Constructs a new SLazyNoLockNoCatch<T> from a
Declaration
public static implicit operator SLazyNoLockNoCatch<T>(Func<T> func)
Parameters
Type | Name | Description |
---|---|---|
Func<T> | func | The method used to initialize Value. |
Returns
Type | Description |
---|---|
SLazyNoLockNoCatch<T> |
Inequality(SLazyNoLockNoCatch<T>, SLazyNoLockNoCatch<T>)
Checks for inequality between left
and right
.
Declaration
public static bool operator !=(SLazyNoLockNoCatch<T> left, SLazyNoLockNoCatch<T> right)
Parameters
Type | Name | Description |
---|---|---|
SLazyNoLockNoCatch<T> | left | The first value of the inequality check. |
SLazyNoLockNoCatch<T> | right | The second value of the inequality check. |
Returns
Type | Description |
---|---|
System.Boolean | True if |