pub struct CommandResponseTraitMethod<'a> {
pub command: &'a RecordType,
pub response: &'a DiscriminatedUnionType,
pub shapes: &'a [RecordType],
}Expand description
Generates the provided trait method for the ClientApi trait.
The ClientApi trait definition itself must be generated by the client and should look like this
ⓘ
pub trait ClientApi {
type Error;
fn send_raw(&self, command: String) -> impl Future<Output = Result<Arc<{}>, Self::Error>> + Send;
//..
}Then the provided methods could be inserted.
For methods that return multiple kinds a valid responses the additional wrapper type should be
generated. You can get this type definition using the
[CommandResponseTraitMethod::response_wrapper] method.
Fields§
§command: &'a RecordType§response: &'a DiscriminatedUnionType§shapes: &'a [RecordType]Implementations§
Source§impl<'a> CommandResponseTraitMethod<'a>
impl<'a> CommandResponseTraitMethod<'a>
pub fn new( command: &'a RecordType, response: &'a DiscriminatedUnionType, shapes: &'a [RecordType], ) -> Self
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for CommandResponseTraitMethod<'a>
impl<'a> RefUnwindSafe for CommandResponseTraitMethod<'a>
impl<'a> Send for CommandResponseTraitMethod<'a>
impl<'a> Sync for CommandResponseTraitMethod<'a>
impl<'a> Unpin for CommandResponseTraitMethod<'a>
impl<'a> UnsafeUnpin for CommandResponseTraitMethod<'a>
impl<'a> UnwindSafe for CommandResponseTraitMethod<'a>
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