Struct SaveResult

Namespace
CodeSmile.AnyMotion.Core.SaveLoad
/
Assembly
ApiSource.dll

Outcome of a save. Never throws — check Success instead, per serialization-format-decision.md's "must never fail to load" requirement applied to saving too.

public readonly struct SaveResult
Expand Details ...

Properties

Contents

Text that was written. Default when Success is false.

public string Contents { get; }

Property Value

string

Exception

Reason the save failed. Null when Success is true.

public SaveException Exception { get; }

Property Value

SaveException

Success

public bool Success { get; }

Property Value

bool

Methods

Failed(SaveException)

public static SaveResult Failed(SaveException exception)

Parameters

Type Name Description
SaveException
exception

Returns

SaveResult

Succeeded(string)

public static SaveResult Succeeded(string contents)

Parameters

Type Name Description
string
contents

Returns

SaveResult