Skip to content

WorkspaceResult T

NexusLabs.Needlr.AgentFramework

NexusLabs.Needlr.AgentFramework.Workspace

WorkspaceResult<T> Class

Result of a workspace operation — either a success value of type T or a failure carrying an System.Exception.

public sealed class WorkspaceResult<T>

Type parameters

T

The operation-specific success data type.

Inheritance System.Object 🡒 WorkspaceResult\<T>

Properties

WorkspaceResult<T>.Exception Property

The exception that caused the failure. Only meaningful when Success is false.

public System.Exception? Exception { get; }

Property Value

System.Exception

WorkspaceResult<T>.Success Property

Whether the operation succeeded.

public bool Success { get; }

Property Value

System.Boolean

WorkspaceResult<T>.Value Property

The success value. Only meaningful when Success is true.

public T Value { get; }

Property Value

T

Methods

WorkspaceResult<T>.Fail(Exception) Method

Creates a failure result carrying exception.

public static NexusLabs.Needlr.AgentFramework.Workspace.WorkspaceResult<T> Fail(System.Exception exception);

Parameters

exception System.Exception

Returns

NexusLabs.Needlr.AgentFramework.Workspace.WorkspaceResult<T>

WorkspaceResult<T>.Ok(T) Method

Creates a success result carrying value.

public static NexusLabs.Needlr.AgentFramework.Workspace.WorkspaceResult<T> Ok(T value);

Parameters

value T

Returns

NexusLabs.Needlr.AgentFramework.Workspace.WorkspaceResult<T>