<PackageReference Include="System.Reactive" Version="6.1.0" />

System.Reactive.Disposables.SingleAssignmentDisposableValue

Represents a disposable resource which only allows a single assignment of its underlying disposable resource. If an underlying disposable resource has already been set, future attempts to set the underlying disposable resource will throw an InvalidOperationException.
namespace System.Reactive.Disposables { public struct SingleAssignmentDisposableValue { public bool IsDisposed { get; } public IDisposable Disposable { get; set; } public void Dispose(); public static bool operator ==(SingleAssignmentDisposableValue left, SingleAssignmentDisposableValue right); public static bool operator !=(SingleAssignmentDisposableValue left, SingleAssignmentDisposableValue right); } }