[−][src]Struct exonum_rust_runtime::api::ServiceApiScope
Exonum API builder for the concrete service API scope.
Methods
impl ServiceApiScope
[src]
pub fn endpoint<Q, I, F, R>(
&mut self,
name: &'static str,
handler: F
) -> &mut Self where
Q: DeserializeOwned + 'static + Send,
I: Serialize + 'static,
F: Fn(ServiceApiState, Q) -> R + 'static + Clone + Send + Sync,
R: Future<Output = Result<I>>,
[src]
&mut self,
name: &'static str,
handler: F
) -> &mut Self where
Q: DeserializeOwned + 'static + Send,
I: Serialize + 'static,
F: Fn(ServiceApiState, Q) -> R + 'static + Clone + Send + Sync,
R: Future<Output = Result<I>>,
Adds a readonly endpoint handler to the service API scope.
In HTTP backends this type of endpoint corresponds to GET
requests.
pub fn endpoint_mut<Q, I, F, R>(
&mut self,
name: &'static str,
handler: F
) -> &mut Self where
Q: DeserializeOwned + 'static,
I: Serialize + 'static,
F: Fn(ServiceApiState, Q) -> R + 'static + Clone + Send + Sync,
R: Future<Output = Result<I>>,
[src]
&mut self,
name: &'static str,
handler: F
) -> &mut Self where
Q: DeserializeOwned + 'static,
I: Serialize + 'static,
F: Fn(ServiceApiState, Q) -> R + 'static + Clone + Send + Sync,
R: Future<Output = Result<I>>,
Adds an endpoint handler to the service API scope.
In HTTP backends this type of endpoint corresponds to POST
requests.
pub fn pb_endpoint_mut<Q, I, F, R>(
&mut self,
name: &'static str,
handler: F
) -> &mut Self where
Q: DeserializeOwned + ProtobufConvert + 'static,
Q::ProtoStruct: Message,
I: Serialize + 'static,
F: Fn(ServiceApiState, Q) -> R + 'static + Clone + Send + Sync,
R: Future<Output = Result<I>>,
[src]
&mut self,
name: &'static str,
handler: F
) -> &mut Self where
Q: DeserializeOwned + ProtobufConvert + 'static,
Q::ProtoStruct: Message,
I: Serialize + 'static,
F: Fn(ServiceApiState, Q) -> R + 'static + Clone + Send + Sync,
R: Future<Output = Result<I>>,
Adds an endpoint handler to the service API scope.
In HTTP backends this type of endpoint corresponds to POST
requests.
Unlike [endpoint_mut
], this method supports deserializing the payload both from JSON
(if Content-Type
of the request is application/json
) or from Protobuf
(if Content-Type
is application/octet-stream
). This comes at the cost
of more requirements to the response type.
pub fn deprecated_endpoint<Q, I, F, R>(
&mut self,
name: &'static str,
deprecated: Deprecated<Q, I, R, F>
) -> &mut Self where
Q: DeserializeOwned + 'static,
I: Serialize + 'static,
F: Fn(ServiceApiState, Q) -> R + 'static + Clone + Send + Sync,
R: Future<Output = Result<I>>,
[src]
&mut self,
name: &'static str,
deprecated: Deprecated<Q, I, R, F>
) -> &mut Self where
Q: DeserializeOwned + 'static,
I: Serialize + 'static,
F: Fn(ServiceApiState, Q) -> R + 'static + Clone + Send + Sync,
R: Future<Output = Result<I>>,
Same as endpoint
, but the response will contain a warning about the endpoint
being deprecated. The endpoint expiration date and deprecation-related information
(e.g., a link to documentation for a new API) can be included in the warning.
pub fn deprecated_endpoint_mut<Q, I, F, R>(
&mut self,
name: &'static str,
deprecated: Deprecated<Q, I, R, F>
) -> &mut Self where
Q: DeserializeOwned + 'static,
I: Serialize + 'static,
F: Fn(ServiceApiState, Q) -> R + 'static + Clone + Send + Sync,
R: Future<Output = Result<I>>,
[src]
&mut self,
name: &'static str,
deprecated: Deprecated<Q, I, R, F>
) -> &mut Self where
Q: DeserializeOwned + 'static,
I: Serialize + 'static,
F: Fn(ServiceApiState, Q) -> R + 'static + Clone + Send + Sync,
R: Future<Output = Result<I>>,
Same as endpoint_mut
, but the response will contain a warning about the endpoint
being deprecated. The endpoint expiration date and deprecation-related information
(e.g., a link to documentation for a new API) can be included in the warning.
pub fn web_backend(&mut self) -> &mut ApiBuilder
[src]
Return a mutable reference to the underlying web backend.
Trait Implementations
impl Clone for ServiceApiScope
[src]
fn clone(&self) -> ServiceApiScope
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for ServiceApiScope
[src]
Auto Trait Implementations
impl !RefUnwindSafe for ServiceApiScope
impl Send for ServiceApiScope
impl Sync for ServiceApiScope
impl Unpin for ServiceApiScope
impl !UnwindSafe for ServiceApiScope
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,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[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.
fn to_owned(&self) -> T
[src]
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.
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,