[−][src]Struct xmlrpc::Request
A request to call a procedure.
Implementations
impl<'a> Request<'a>
[src]
pub fn new(name: &'a str) -> Self
[src]
Creates a new request to call a function named name
.
By default, no arguments are passed. Use the arg
method to append arguments.
pub fn new_multicall<'r, I>(requests: I) -> Self where
'a: 'r,
I: IntoIterator<Item = &'r Request<'a>>,
[src]
'a: 'r,
I: IntoIterator<Item = &'r Request<'a>>,
Creates a "multicall" request that will perform multiple requests at once.
This requires that the server supports the system.multicall
method.
pub fn arg<T: Into<Value>>(mut self: Self, value: T) -> Self
[src]
Appends an argument to be passed to the current list of arguments.
pub fn call<T: Transport>(&self, transport: T) -> Result<Value, Error>
[src]
Performs the request using a Transport
.
If you want to send the request using an HTTP POST request, you can also use call_url
,
which creates a suitable Transport
internally.
Errors
Any errors that occur while sending the request using the Transport
will be returned to
the caller. Additionally, if the response is malformed (invalid XML), or indicates that the
method call failed, an error will also be returned.
pub fn call_url<U: IntoUrl>(&self, url: U) -> Result<Value, Error>
[src]
Performs the request on a URL.
You can pass a &str
or an already parsed reqwest URL.
This is a convenience method that will internally create a new reqwest::Client
and send an
HTTP POST request to the given URL. If you only use this method to perform requests, you
don't need to depend on reqwest
yourself.
This method is only available when the http
feature is enabled (this is the default).
Errors
Since this is just a convenience wrapper around Request::call
, the same error conditions
apply.
Any reqwest errors will be propagated to the caller.
pub fn write_as_xml<W: Write>(&self, fmt: &mut W) -> Result<()>
[src]
Formats this Request
as a UTF-8 encoded XML document.
Errors
Any errors reported by the writer will be propagated to the caller. If the writer never returns an error, neither will this method.
pub fn into_multicall_struct(self) -> Value
[src]
use Request::multicall
instead
Serialize this Request
into an XML-RPC struct that can be passed to
the system.multicall
XML-RPC method, specifically a struct with two fields:
methodName
: the request nameparams
: the request arguments
Trait Implementations
Auto Trait Implementations
impl<'a> RefUnwindSafe for Request<'a>
[src]
impl<'a> Send for Request<'a>
[src]
impl<'a> Sync for Request<'a>
[src]
impl<'a> Unpin for Request<'a>
[src]
impl<'a> UnwindSafe for Request<'a>
[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> 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>,