Struct AsyncOp | Project Tiny | 0.21.0-preview.3
docs.unity3d.com
    Show / Hide Table of Contents

    Struct AsyncOp

    Asynchronous handle to be held while dealing with file operations. Users should use the provided member functions to poll for status of the operation before fetching data.

    Namespace: Unity.Tiny.IO
    Syntax
    public struct AsyncOp : IDisposable

    Properties

    IsCreated

    Returns true if the AsyncOp is valid and needs to be Dispose()'d

    Declaration
    public bool IsCreated { get; }
    Property Value
    Type Description
    Boolean

    Methods

    Dispose()

    Closes file handles are frees any other resources associated with the AsyncOp

    Declaration
    public void Dispose()

    GetData(out Byte*, out Int32)

    Provides a pointer to the requested IO data in memory once the AsyncOp.GetRequestState() == RequestState.Complete otherwise null and a size of 0 is returned. Users should treat memory returned as read-only and to only be valid until the AsynOp is Dispose()'d

    Declaration
    public void GetData(out byte *data, out int sizeInBytes)
    Parameters
    Type Name Description
    Byte* data
    Int32 sizeInBytes

    GetErrorStatus()

    Provides best-effort information as to why an AsyncOp has failed, otherwise returns ErrorStatus.None

    Declaration
    public AsyncOp.ErrorStatus GetErrorStatus()
    Returns
    Type Description
    AsyncOp.ErrorStatus

    GetStatus()

    Returns the current state of the AsyncOp

    Declaration
    public AsyncOp.Status GetStatus()
    Returns
    Type Description
    AsyncOp.Status

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    String
    Overrides
    ValueType.ToString()
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023