Struct IOResult
Holds a result of an IO operation.
Inherited Members
Namespace: Akka.Streams.IO
Assembly: Akka.Streams.dll
Syntax
public readonly struct IOResult
Constructors
| Improve this Doc View SourceIOResult(Int64, Result<NotUsed>)
Creates a new IOResult.
Declaration
public IOResult(long count, Result<NotUsed> status)
Parameters
Type | Name | Description |
---|---|---|
Int64 | count | Numeric value depending on context, for example IO operations performed or bytes processed. |
Result<NotUsed> | status | Status of the result. Can be either NotUsed or an exception. |
Fields
| Improve this Doc View SourceCount
Numeric value depending on context, for example IO operations performed or bytes processed.
Declaration
public readonly long Count
Field Value
Type | Description |
---|---|
Int64 |
Properties
| Improve this Doc View SourceError
If the IO operation resulted in an error, returns the corresponding Exception or throws NotSupportedException otherwise.
Declaration
public readonly Exception Error { get; }
Property Value
Type | Description |
---|---|
Exception |
Exceptions
Type | Condition |
---|---|
NotSupportedException | Is thrown if the property is accessed for a successful IOResult |
WasSuccessful
Indicates whether IO operation completed successfully or not.
Declaration
public readonly bool WasSuccessful { get; }
Property Value
Type | Description |
---|---|
Boolean |
Methods
| Improve this Doc View SourceFailed(Int64, Exception)
Creates failed IOResult, count
should be the number of bytes (or other unit, please document in your APIs) processed before failing
Declaration
public static IOResult Failed(long count, Exception reason)
Parameters
Type | Name | Description |
---|---|---|
Int64 | count | Numeric value depending on context, for example IO operations performed or bytes processed. |
Exception | reason | The corresponding Exception |
Returns
Type | Description |
---|---|
IOResult | Failed IOResult |
Success(Int64)
Creates successful IOResult
Declaration
public static IOResult Success(long count)
Parameters
Type | Name | Description |
---|---|---|
Int64 | count | Numeric value depending on context, for example IO operations performed or bytes processed. |
Returns
Type | Description |
---|---|
IOResult | Successful IOResult |