[−][src]Struct tower_web_protobuf::Proto
A wrapper struct for a protobuf message type.
This has to exist because impl<T> Trait for T
requires T to be 'covered'
by a local type (i.e. Proto
impl<M, B: BufStream> Extract<B> for M where M: 'static + Message + MessageWrapper<M> { type Future = Immediate<M>; }
doesn't work.
Niko's excellent blog post has a full writeup.
The effect of this is that you'll have to specify Protoimpl_web!()
. This, in turn hurts
testability (you have to wrap your Messages to pass them into the endpoint
functions) and kind of works counter to the PORTs (plain old Rust types)
philosophy. But, I'm pretty sure it's the best we can do without using
macros or modifying tower-web.
Into
Deref is also implemented it should be possible to use Proto
Implementations
impl<M: MessagePlus> Proto<M>
[src]
pub fn move_inner(self) -> M
[src]
Unwraps the message (of type M) from it's Proto
pub fn new(message: M) -> Self
[src]
Creates a new Proto
Trait Implementations
impl<M: MessagePlus> AsRef<M> for Proto<M>
[src]
impl<M: MessagePlus + Clone> Clone for Proto<M>
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<M: MessagePlus + Debug> Debug for Proto<M>
[src]
impl<M: MessagePlus> Default for Proto<M>
[src]
impl<M: MessagePlus> Deref for Proto<M>
[src]
impl<B, M> Extract<B> for Proto<M> where
B: BufStream,
M: 'static + MessagePlus,
[src]
B: BufStream,
M: 'static + MessagePlus,
type Future = MessageFuture<B, M>
The future representing the completion of the extraction logic.
fn extract(_ctx: &Context) -> Self::Future
[src]
fn extract_body(ctx: &Context, body: B) -> Self::Future
[src]
fn requires_body(_: &CallSite) -> bool
[src]
impl<M: MessagePlus> From<M> for Proto<M>
[src]
impl<M> Response for Proto<M> where
M: MessagePlus,
[src]
M: MessagePlus,
Auto Trait Implementations
impl<M> RefUnwindSafe for Proto<M> where
M: RefUnwindSafe,
M: RefUnwindSafe,
impl<M> Send for Proto<M>
impl<M> Sync for Proto<M>
impl<M> Unpin for Proto<M> where
M: Unpin,
M: Unpin,
impl<M> UnwindSafe for Proto<M> where
M: UnwindSafe,
M: UnwindSafe,
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<!> for 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> Same<T> for T
type Output = T
Should always be Self
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>,