[−][src]Struct wordpress::Client
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]
T: DeserializeOwned,
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]
&'a self,
type_name: &'b str
) -> GetTypesBuilder<'a, 'b, T> where
T: DeserializeOwned,
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]
T: DeserializeOwned,
Get the json at the path_fragment
.
pub async fn get_to<W>(&self, url: &str, writer: W) -> Result<()> where
W: AsyncWrite + Unpin,
[src]
W: AsyncWrite + Unpin,
Send a GET request to a url and copy the response to the writer.
Trait Implementations
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,