pub trait OdooApiMethodwhere
    Self: Sized + Serialize + Debug + PartialEq,
{ type Response: Sized + Serialize + DeserializeOwned + Debug + PartialEq + TryFrom<String> + TryFrom<Value>; fn describe_odoo_api_method(&self) -> (&'static str, &'static str); fn parse_json_response(
        &self,
        json_data: &str
    ) -> Result<OdooApiResponse<Self>>; }
Expand description

A trait implemented by the “request” structs

This trait serves a few purposes:

  1. Create a link between the request and response structs (e.g., Execute and ExecuteResponse)
  2. Describe the request (e.g. service: object, method: execute)
  3. Provide a response-parsing function

Required Associated Types§

Required Methods§

Describes the Odoo API method (including the service)

The Odoo API is split into “services” and “methods”.

For example, his function is responsible for returning the "common" and "version" below:

{
    "jsonrpc": "2.0",
    "method": "call",
    "params": {
        // the "service"
        "service": "common",

        // the "method"
        "method": "version",

        "args": []
    }
}

Parse some JSON string data into an OdooApiResponse object

Internally, OdooApiResponse uses the Response associated type to decide how to deserialize the JSON data.

Implementors§