Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

struct System.​Threading.​Tasks.​ValueTask

Assembly: System.Runtime

Provides an awaitable result of an asynchronous operation.

Properties

public bool
IsCanceled
Gets a value that indicates whether this object represents a canceled operation.
public bool
IsCompleted
Gets a value that indicates whether this object represents a completed operation.
public bool
IsCompletedSuccessfully
Gets a value that indicates whether this object represents a successfully completed operation.
public bool
IsFaulted
Gets a value that indicates whether this object represents a failed operation.

Methods

public Task
AsTask​()
Returns The <see cref="T:System.Threading.Tasks.Task" /> object that is wrapped in this <see cref="T:System.Threading.Tasks.ValueTask" /> if one exists, or a new <see cref="T:System.Threading.Tasks.Task" /> object that represents the result.
Retrieves a <see cref="T:System.Threading.Tasks.Task" /> object that represents this <see cref="T:System.Threading.Tasks.ValueTask" /> .
ConfigureAwait​(bool continueOnCapturedContext)
continueOnCapturedContext <see langword="true" /> to attempt to marshal the continuation back to the captured context; otherwise, <see langword="false" /> .
Returns The configured awaiter.
Configures an awaiter for this value.
public bool
Equals​(object obj)
obj The object to compare with the current object.
Returns <see langword="true" /> if the specified object is equal to the current object; otherwise, <see langword="false" /> .
Determines whether the specified object is equal to the current <see cref="T:System.Threading.Tasks.ValueTask" /> instance.
public bool
Equals​(ValueTask other)
other The object to compare with the current object.
Returns <see langword="true" /> if the specified object is equal to the current object; otherwise, <see langword="false" /> .
Determines whether the specified <see cref="T:System.Threading.Tasks.ValueTask" /> object is equal to the current <see cref="T:System.Threading.Tasks.ValueTask" /> object.
GetAwaiter​()
Returns The awaiter.
Creates an awaiter for this value.
public int
GetHashCode​()
Returns The hash code for the current object.
Returns the hash code for this instance.
public ValueTask
Preserve​()
Returns The preserved <see cref="T:System.Threading.Tasks.ValueTask" /> .
Gets a <see cref="T:System.Threading.Tasks.ValueTask" /> that may be used at any point in the future.
public string
ToString​()
Inherited from ValueType
Returns The fully qualified type name.
Returns the fully qualified type name of this instance.
protected void
Finalize​()
Inherited from object
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
public Type
GetType​()
Inherited from object
Returns The exact runtime type of the current instance.
Gets the <see cref="T:System.Type" /> of the current instance.
protected object
MemberwiseClone​()
Inherited from object
Returns A shallow copy of the current <see cref="T:System.Object" /> .
Creates a shallow copy of the current <see cref="T:System.Object" /> .