docs.unity3d.com
    目次を表示する/隠す

    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.

    Namespace: Unity.VisualScripting.FullSerializer
    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 readonly 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 readonly bool Failed { get; }
    Property Value
    Type Description
    Boolean

    FormattedMessages

    Declaration
    public readonly 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 readonly bool HasWarnings { get; }
    Property Value
    Type Description
    Boolean

    RawMessages

    Declaration
    public readonly 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 readonly bool Succeeded { get; }
    Property Value
    Type Description
    Boolean

    Methods

    AddMessage(String)

    Adds a new message to this result.

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

    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

    Addition(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

    XAnalyserProvider.Analyser(Object, IGraphContext)
    XAnalyserProvider.Analyser<TAnalyser>(Object, IGraphContext)
    XAnalyserProvider.Analysis(Object, IGraphContext)
    XAnalyserProvider.Analysis<TAnalysis>(Object, IGraphContext)
    XAnalyserProvider.Analyser(Object, GraphReference)
    XAnalyserProvider.Analyser<TAnalyser>(Object, GraphReference)
    XAnalyserProvider.Analysis(Object, GraphReference)
    XAnalyserProvider.Analysis<TAnalysis>(Object, GraphReference)
    XDescriptorProvider.Describe(Object)
    XDescriptorProvider.HasDescriptor(Object)
    XDescriptorProvider.Descriptor(Object)
    XDescriptorProvider.Descriptor<TDescriptor>(Object)
    XDescriptorProvider.Description(Object)
    XDescriptorProvider.Description<TDescription>(Object)
    Cloning.Clone(Object, ICloner, Boolean)
    Cloning.Clone<T>(T, ICloner, Boolean)
    Cloning.CloneViaFakeSerialization(Object)
    Cloning.CloneViaFakeSerialization<T>(T)
    ConversionUtility.IsConvertibleTo(Object, Type, Boolean)
    ConversionUtility.IsConvertibleTo<T>(Object, Boolean)
    ConversionUtility.ConvertTo(Object, Type)
    ConversionUtility.ConvertTo<T>(Object)
    TypeUtility.ToShortString(Object, Int32)
    Serialization.CloneViaSerialization<T>(T, Boolean)
    Serialization.CloneViaSerializationInto<TSource, TDestination>(TSource, ref TDestination, Boolean)
    Serialization.Serialize(Object, Boolean)
    LinqUtility.Yield<T>(T)
    UnityObjectUtility.IsUnityNull(Object)
    UnityObjectUtility.ToSafeString(Object)
    トップに戻る
    Copyright © 2023 Unity Technologies — 商標と利用規約
    • 法律関連
    • プライバシーポリシー
    • クッキー
    • 私の個人情報を販売または共有しない
    • Your Privacy Choices (Cookie Settings)