Skip to main content

IntoRequest

Trait IntoRequest 

Source
pub trait IntoRequest {
    // Required method
    fn into_request(self) -> Result<Request, Error>;
}
Expand description

可转换为一次任务请求的参数。

已为以下类型实现:

  • Request / &Request:类型化请求;
  • &str / String:任意 JSON 字符串(透传给 C 边界);
  • ():空请求(等价于 {})。

Required Methods§

Source

fn into_request(self) -> Result<Request, Error>

转换为请求对象。

§Errors

永远成功(各实现均为 infallible),保留 Result 以便后续扩展。

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl IntoRequest for &str

Source§

impl IntoRequest for ()

Source§

impl IntoRequest for String

Implementors§