docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct fsResult

    The result of some sort of operation. A result is either successful or not, but if it is successful then there may be a set of warnings/messages associated with it. These warnings describe the performed error recovery operations.

    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    ValueType.ToString()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: Unity.VisualScripting.FullSerializer
    Assembly: Unity.VisualScripting.Core.dll
    Syntax
    public struct fsResult

    Fields

    Success

    A successful result.

    Declaration
    public static fsResult Success
    Field Value
    Type Description
    fsResult

    Properties

    AsException

    Utility method to convert the result to an exception. This method is only defined is Failed returns true.

    Declaration
    public Exception AsException { get; }
    Property Value
    Type Description
    Exception

    Failed

    Did this result fail? If so, you can see the reasons why in RawMessages.

    Declaration
    public bool Failed { get; }
    Property Value
    Type Description
    bool

    FormattedMessages

    Declaration
    public string FormattedMessages { get; }
    Property Value
    Type Description
    string

    HasWarnings

    Does this result have any warnings? This says nothing about if it failed or succeeded, just if it has warning messages associated with it.

    Declaration
    public bool HasWarnings { get; }
    Property Value
    Type Description
    bool

    RawMessages

    Declaration
    public IEnumerable<string> RawMessages { get; }
    Property Value
    Type Description
    IEnumerable<string>

    Succeeded

    Was the result a success? Note that even successful operations may have warning messages (RawMessages) associated with them.

    Declaration
    public bool Succeeded { get; }
    Property Value
    Type Description
    bool

    Methods

    AddMessage(string)

    Adds a new message to this result.

    Declaration
    public void AddMessage(string message)
    Parameters
    Type Name Description
    string message

    The new message to be added.

    AddMessages(fsResult)

    Adds only the messages from the other result into this result, ignoring the success/failure status of the other result.

    Declaration
    public void AddMessages(fsResult result)
    Parameters
    Type Name Description
    fsResult result

    AssertSuccess()

    A simply utility method that will assert that this result is successful. If it is not, then an exception is thrown.

    Declaration
    public fsResult AssertSuccess()
    Returns
    Type Description
    fsResult

    AssertSuccessWithoutWarnings()

    A simple utility method that will assert that this result is successful and that there are no warning messages. This throws an exception if either of those asserts are false.

    Declaration
    public fsResult AssertSuccessWithoutWarnings()
    Returns
    Type Description
    fsResult

    Fail(string)

    Create a result that failed.

    Declaration
    public static fsResult Fail(string warning)
    Parameters
    Type Name Description
    string warning
    Returns
    Type Description
    fsResult

    Merge(fsResult)

    Merges the other result into this one. If the other result failed, then this one too will have failed.

    Declaration
    public fsResult Merge(fsResult other)
    Parameters
    Type Name Description
    fsResult other
    Returns
    Type Description
    fsResult
    Remarks

    Note that you can use += instead of this method so that you don't bury the actual method call that is generating the other fsResult.

    Warn(string)

    Create a result that is successful but contains the given warning message.

    Declaration
    public static fsResult Warn(string warning)
    Parameters
    Type Name Description
    string warning
    Returns
    Type Description
    fsResult

    Operators

    operator +(fsResult, fsResult)

    Only use this as +=!

    Declaration
    public static fsResult operator +(fsResult a, fsResult b)
    Parameters
    Type Name Description
    fsResult a
    fsResult b
    Returns
    Type Description
    fsResult

    Extension Methods

    Cloning.Clone(object, ICloner, bool)
    Cloning.Clone(object, ICloner, bool)
    Cloning.CloneViaFakeSerialization(object)
    Cloning.CloneViaFakeSerialization(object)
    ConversionUtility.ConvertTo(object, Type)
    ConversionUtility.ConvertTo(object, Type)
    ConversionUtility.ConvertTo<T>(object)
    ConversionUtility.ConvertTo<T>(object)
    ConversionUtility.IsConvertibleTo(object, Type, bool)
    ConversionUtility.IsConvertibleTo(object, Type, bool)
    ConversionUtility.IsConvertibleTo<T>(object, bool)
    ConversionUtility.IsConvertibleTo<T>(object, bool)
    Serialization.Serialize(object, bool)
    Serialization.Serialize(object, bool)
    TypeUtility.ToShortString(object, int)
    TypeUtility.ToShortString(object, int)
    UnityObjectUtility.IsUnityNull(object)
    UnityObjectUtility.IsUnityNull(object)
    UnityObjectUtility.ToSafeString(object)
    UnityObjectUtility.ToSafeString(object)
    Cloning.CloneViaFakeSerialization<T>(T)
    Cloning.CloneViaFakeSerialization<T>(T)
    Cloning.Clone<T>(T, ICloner, bool)
    Cloning.Clone<T>(T, ICloner, bool)
    LinqUtility.Yield<T>(T)
    LinqUtility.Yield<T>(T)
    Serialization.CloneViaSerializationInto<TSource, TDestination>(TSource, ref TDestination, bool)
    Serialization.CloneViaSerializationInto<TSource, TDestination>(TSource, ref TDestination, bool)
    Serialization.CloneViaSerialization<T>(T, bool)
    Serialization.CloneViaSerialization<T>(T, bool)
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)