async fn do_api<I: serde::Serialize, O: serde::de::DeserializeOwned>(
    url: Option<Url2>,
    op: &str,
    input: I,
) -> crate::types::actor::KitsuneP2pResult<Option<O>> {
    let mut body_data = Vec::new();
    kitsune_p2p_types::codec::rmp_encode(&mut body_data, &input)?;
    match url {
        Some(url) => {
            let res = CLIENT
                .post(url.as_str())
                .body(body_data)
                .header(OP_HEADER, op)
                .header(reqwest::header::CONTENT_TYPE, "application/octet")
                .send()
                .await?;
            if res.status().is_success() {
                Ok(Some(kitsune_p2p_types::codec::rmp_decode(
                    &mut res.bytes().await?.as_ref(),
                )?))
            } else {
                Err(crate::KitsuneP2pError::Bootstrap(
                    res.text().await?.into_boxed_str(),
                ))
            }
        }
        None => Ok(None),
    }
}
/// Standard interface to the remote bootstrap service.
///
/// - url: the url of the bootstrap service or None to short circuit and not send a request
/// - op: the header op for the remote service
/// - input: op-specific struct that will be messagepack encoded and sent as binary data in the
///          body of the POST
///
/// Output type O is op specific and needs to be messagepack decodeable.
Standard interface to the remote bootstrap service.
url: the url of the bootstrap service or None to short circuit and not send a request
op: the header op for the remote service
input: op-specific struct that will be messagepack encoded and sent as binary data in the
body of the POST

Output type O is op specific and needs to be messagepack decodeable.
Standard interface to the remote bootstrap service . url : the url of the bootstrap service or None to short circuit and not send a request op : the header op for the remote service input : op - specific struct that will be messagepack encoded and sent as binary data in the body of the POST Output type O is op specific and needs to be messagepack decodeable .
async fn do_api<I: serde::Serialize, O: serde::de::DeserializeOwned>(
    url: Option<Url2>,
    op: &str,
    input: I,
) -> crate::types::actor::KitsuneP2pResult<Option<O>> {
    let mut body_data = Vec::new();
    kitsune_p2p_types::codec::rmp_encode(&mut body_data, &input)?;
    match url {
        Some(url) => {
            let res = CLIENT
                .post(url.as_str())
                .body(body_data)
                .header(OP_HEADER, op)
                .header(reqwest::header::CONTENT_TYPE, "application/octet")
                .send()
                .await?;
            if res.status().is_success() {
                Ok(Some(kitsune_p2p_types::codec::rmp_decode(
                    &mut res.bytes().await?.as_ref(),
                )?))
            } else {
                Err(crate::KitsuneP2pError::Bootstrap(
                    res.text().await?.into_boxed_str(),
                ))
            }
        }
        None => Ok(None),
    }
}
async fn do_api < I : serde :: Serialize , O : serde :: de :: DeserializeOwned > ( url : Option < Url2 > , op : & str , input : I , ) -> crate :: types :: actor :: KitsuneP2pResult < Option < O > > { let mut body_data = Vec :: new ( ) ; kitsune_p2p_types :: codec :: rmp_encode ( & mut body_data , & input ) ? ; match url { Some ( url ) => { let res = CLIENT . post ( url . as_str ( ) ) . body ( body_data ) . header ( OP_HEADER , op ) . header ( reqwest :: header :: CONTENT_TYPE , " " ) . send ( ) . await ? ; if res . status ( ) . is_success ( ) { Ok ( Some ( kitsune_p2p_types :: codec :: rmp_decode ( & mut res . bytes ( ) . await ? . as_ref ( ) , ) ? ) ) } else { Err ( crate :: KitsuneP2pError :: Bootstrap ( res . text ( ) . await ? . into_boxed_str ( ) , ) ) } } None => Ok ( None ) , } }
Standard interface to the remote bootstrap service.
Standard interface to the remote bootstrap service .
url
Option<Url2>
op
&str
input
I
url
Option<Url2>
op
&str
input
I