pub struct RpcSelection { /* private fields */ }Expand description
The RPCs transcoded to REST: every one with a google.api.http rule, or
only the services and methods named.
§Examples
use structured_proxy::transcode::RpcSelection;
let pool = prost_reflect::DescriptorPool::new();
// An empty list selects every annotated RPC.
let all = RpcSelection::new(&pool, Vec::<String>::new()).unwrap();
// A name the descriptors do not hold is an error.
assert!(RpcSelection::new(&pool, ["acme.v1.Orders"]).is_err());Implementations§
Source§impl RpcSelection
impl RpcSelection
Sourcepub fn new(
pool: &DescriptorPool,
names: impl IntoIterator<Item = impl AsRef<str>>,
) -> Result<Self, String>
pub fn new( pool: &DescriptorPool, names: impl IntoIterator<Item = impl AsRef<str>>, ) -> Result<Self, String>
names out of pool: package.Service for every RPC of a service,
package.Service/Method for one; none selects every annotated RPC.
§Errors
A name that is not a service, or a method of a service, of pool: a
typo would otherwise leave its routes silently unmounted.
Trait Implementations§
Source§impl Clone for RpcSelection
impl Clone for RpcSelection
Source§impl Debug for RpcSelection
impl Debug for RpcSelection
Auto Trait Implementations§
impl Freeze for RpcSelection
impl RefUnwindSafe for RpcSelection
impl Send for RpcSelection
impl Sync for RpcSelection
impl Unpin for RpcSelection
impl UnsafeUnpin for RpcSelection
impl UnwindSafe for RpcSelection
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request