Skip to content

Latest commit

 

History

History
29 lines (23 loc) · 2.68 KB

File metadata and controls

29 lines (23 loc) · 2.68 KB

Result Struct

Represents the result of an operation that can either succeed or fail without a return value.

public readonly record struct Result : System.IEquatable<Atypical.VirtualFileSystem.Core.Result>

Implements System.IEquatable<Result>

Properties
Error Gets the error message. Only available when IsFailure is true.
IsFailure Gets a value indicating whether the operation failed.
IsSuccess Gets a value indicating whether the operation was successful.
Methods
Combine(Result) Combines this result with another result.
Failure(string) Creates a failed result with the specified error message.
Failure(Exception) Creates a failed result from an exception.
Map<T>(Func<T>) Transforms the result to a result with a value.
OnFailure(Action<string>) Executes an action if the result is a failure.
OnSuccess(Action) Executes an action if the result is successful.
Success() Creates a successful result.
ToString() Returns a string representation of the result.