Result.md

January 20, 2026 ยท View on GitHub

Atypical.VirtualFileSystem.Core

Atypical.VirtualFileSystem.Core

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
ErrorGets the error message. Only available when IsFailure is true.
IsFailureGets a value indicating whether the operation failed.
IsSuccessGets 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.