oxsearch-core 0.1.0

The core of oxsearch: the transport and endpoint traits, errors, and the common types, query DSL, retrievers and kNN generated from the Elasticsearch specification
Documentation
// Generated by `cargo run -p xtask -- generate` from elastic/elasticsearch-specification 9.5 at
// 84bf510a907bae62ffe29af35f516af287a79eab. Don't edit it: change the generator.

/// Ping the cluster.
///
/// Get information about whether the cluster is running.
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub struct Request {}

impl Request {
    /// A `Request` with its required properties set.
    pub fn new() -> Self {
        Self {}
    }
}

impl Request {}

#[derive(Clone, Debug, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
#[non_exhaustive]
pub struct Response {}

impl Response {
    /// A `Response` with its required properties set.
    pub fn new() -> Self {
        Self {}
    }
}

impl Response {}

impl ::oxsearch_core::Endpoint for Request {
    type Response = crate::ping::Response;

    fn name(&self) -> &'static str {
        "ping"
    }

    fn route(&self) -> ::core::result::Result<::oxsearch_core::Route, ::oxsearch_core::Error> {
        ::core::result::Result::Ok(::oxsearch_core::Route::new(
            ::oxsearch_core::Method::Head,
            "/",
        ))
    }

    fn query(
        &self,
    ) -> ::core::result::Result<
        ::std::vec::Vec<(&'static str, ::std::string::String)>,
        ::oxsearch_core::Error,
    > {
        ::core::result::Result::Ok(::std::vec::Vec::new())
    }

    fn body(
        &self,
    ) -> ::core::result::Result<::core::option::Option<::oxsearch_core::Body>, ::oxsearch_core::Error>
    {
        ::core::result::Result::Ok(::core::option::Option::None)
    }
}