pub struct ClientGenerator<'a, S> { /* private fields */ }Implementations§
Source§impl<'a, S> ClientGenerator<'a, S>
impl<'a, S> ClientGenerator<'a, S>
pub fn with_mocks(self, mocks_feature_name: &'a str) -> Self
pub fn with_sails_crate(self, sails_path: &'a str) -> Self
Sourcepub fn with_external_type(self, name: &'a str, path: &'a str) -> Self
pub fn with_external_type(self, name: &'a str, path: &'a str) -> Self
Add an map from IDL type to crate path
Instead of generating type in client code, use type path from external crate
§Example
Following code generates use my_crate::MyParam as MyFuncParam;
let code = sails_client_gen::ClientGenerator::from_idl("<idl>")
.with_external_type("MyFuncParam", "my_crate::MyParam");Sourcepub fn with_no_derive_traits(self) -> Self
pub fn with_no_derive_traits(self) -> Self
Derive only nessessary parity_scale_codec::Encode, parity_scale_codec::Decode and [scale_info::TypeInfo] traits for the generated types
By default, types additionally derive PartialEq, Clone and Debug
Source§impl<'a> ClientGenerator<'a, IdlPath<'a>>
impl<'a> ClientGenerator<'a, IdlPath<'a>>
pub fn from_idl_path(idl_path: &'a Path) -> Self
pub fn generate_to(self, out_path: impl AsRef<Path>) -> Result<()>
Auto Trait Implementations§
impl<'a, S> Freeze for ClientGenerator<'a, S>where
S: Freeze,
impl<'a, S> RefUnwindSafe for ClientGenerator<'a, S>where
S: RefUnwindSafe,
impl<'a, S> Send for ClientGenerator<'a, S>where
S: Send,
impl<'a, S> Sync for ClientGenerator<'a, S>where
S: Sync,
impl<'a, S> Unpin for ClientGenerator<'a, S>where
S: Unpin,
impl<'a, S> UnwindSafe for ClientGenerator<'a, S>where
S: UnwindSafe,
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