Table of Contents

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

Unit

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

other Unit

The other Unit to compare.

Returns

bool

Always returns true.

Equals(object?)

Determines whether the specified object is equal to this instance.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare.

Returns

bool

True if the object is a Unit; otherwise, false.

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

left Unit

The first instance to compare.

right Unit

The second instance to compare.

Returns

bool

Always returns true since all Unit instances are equal.

operator !=(Unit, Unit)

Determines whether two Unit instances are not equal.

public static bool operator !=(Unit left, Unit right)

Parameters

left Unit

The first instance to compare.

right Unit

The second instance to compare.

Returns

bool

Always returns false since all Unit instances are equal.