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 |
---|---|
System.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 |
---|---|---|
System.Byte* | data | |
System.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 |
---|---|
System.String |
Overrides
System.ValueType.ToString()