Struct Unit
- Namespace
- CivitaiSharp.Core.Response
- Assembly
- CivitaiSharp.Core.dll
Represents a void result type for API operations that return no data. Use this as the type parameter for Result<T> when the operation succeeds but returns no meaningful response body.
public readonly struct Unit : IEquatable<Unit>
- Implements
- Inherited Members
Remarks
This type is useful for DELETE and PUT operations where success is indicated by the HTTP status code alone, without a response body.
Properties
Value
Gets the singleton instance of Unit.
public static Unit Value { get; }
Property Value
Methods
Equals(Unit)
Determines whether the specified Unit is equal to this instance. All Unit instances are considered equal.
public bool Equals(Unit other)
Parameters
Returns
- bool
Always returns true.
Equals(object?)
Determines whether the specified object is equal to this instance.
public override bool Equals(object? obj)
Parameters
objobjectThe object to compare.
Returns
GetHashCode()
Returns a hash code for this instance.
public override int GetHashCode()
Returns
- int
A constant hash code value.
ToString()
Returns a string representation of this instance.
public override string ToString()
Returns
- string
The string "()".
Operators
operator ==(Unit, Unit)
Determines whether two Unit instances are equal.
public static bool operator ==(Unit left, Unit right)
Parameters
Returns
operator !=(Unit, Unit)
Determines whether two Unit instances are not equal.
public static bool operator !=(Unit left, Unit right)