[][src]Struct wordpress::Client

pub struct Client {
    pub client: Client,
    // some fields omitted
}

The Wordpress API client

Fields

client: Client

The inner HTTP Client

You probably shouldn't touch this unless you want to piggyback off of it to send requests.

Implementations

impl Client[src]

pub fn new(base_url: Url) -> Self[src]

Make a new Client from the given base_url.

pub async fn get_type_by_id<T>(&self, type_name: &str, id: u64) -> Result<T> where
    T: DeserializeOwned
[src]

Get a type by id

pub fn get_types_builder<'a, 'b, T>(
    &'a self,
    type_name: &'b str
) -> GetTypesBuilder<'a, 'b, T> where
    T: DeserializeOwned
[src]

Get a builder for a request that fetches objects of the given type.

pub fn get_posts_builder(&self) -> GetTypesBuilder<'_, '_, Post>[src]

Get a builder for a request that fetches posts.

pub async fn get_json<T>(&self, path_fragment: &str) -> Result<(HeaderMap, T)> where
    T: DeserializeOwned
[src]

Get the json at the path_fragment.

pub async fn get_to<W>(&self, url: &str, writer: W) -> Result<()> where
    W: AsyncWrite + Unpin
[src]

Send a GET request to a url and copy the response to the writer.

Trait Implementations

impl Clone for Client[src]

impl Debug for Client[src]

Auto Trait Implementations

impl !RefUnwindSafe for Client[src]

impl Send for Client[src]

impl Sync for Client[src]

impl Unpin for Client[src]

impl !UnwindSafe for Client[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.