|
faio
faio 公共 C++ 接口参考
|
携带错误来源、原生错误码和已完成传输进度的错误值。 更多...
Public 类型 | |
| enum | ErrorCode { EmptySqe = 1000 , InvalidAddresses , ClosedChannel , UnexpectedEOF , WriteZero , TooLongTime , PassedTime , InvalidSocketType , ReuniteFailed } |
| faio 自定义错误码;具体数值与系统错误域分开解释。 更多... | |
Public 成员函数 | |
| Error (int err_code, std::uint64_t transferred=0, error_domain domain=error_domain::posix) | |
| 构造Error对象。 | |
| std::uint64_t | transferred () const noexcept |
| 读取错误发生前已经生效的传输量。 | |
| std::uint64_t | progress () const noexcept |
| 读取已完成传输量。 | |
| error_domain | domain () const noexcept |
| 读取错误所属来源。 | |
| std::int64_t | native_code () const noexcept |
| 读取原生错误码。 | |
| const std::shared_ptr< const error_context > & | context () const noexcept |
| 借用错误持有的诊断上下文。 | |
| Error | with_context (std::shared_ptr< const error_context > details) const |
| 复制错误并附加共享诊断。 | |
| Error | with_progress (std::uint64_t bytes) const |
| 复制错误并更新累计进度。 | |
| int | value () const noexcept |
| 读取错误码或权限数值。 | |
| std::string_view | message () const noexcept |
| 读取可读错误说明。 | |
携带错误来源、原生错误码和已完成传输进度的错误值。
|
explicit |
构造Error对象。
| err_code | 错误码;与 domain 一起解释,不能把所有来源都视为 errno。 |
| transferred | 错误发生前已经生效的字节数。 默认值:0。 |
| domain | 原生错误的来源标识。 默认值:error_domain::posix。 |
|
noexcept |
读取错误发生前已经生效的传输量。
|
noexcept |
读取已完成传输量。
|
noexcept |
读取错误所属来源。
|
noexcept |
读取原生错误码。
|
noexcept |
借用错误持有的诊断上下文。
| Error faio::Error::with_context | ( | std::shared_ptr< const error_context > | details | ) | const |
复制错误并附加共享诊断。
| details | 与错误副本共享的不可变诊断上下文。 |
| Error faio::Error::with_progress | ( | std::uint64_t | bytes | ) | const |
复制错误并更新累计进度。
| bytes | 可写字节缓冲区;在操作完成前保持内存与地址有效,不能被其他任务无序修改。 |
|
noexcept |
读取错误码或权限数值。
|
noexcept |
读取可读错误说明。