pub struct Form { /* private fields */ }Implementations§
Source§impl Form
impl Form
pub fn new(mailerlite: MailerLite) -> Self
Sourcepub async fn get(&self, form_type: String, query: Parameter) -> Response
pub async fn get(&self, form_type: String, query: Parameter) -> Response
Examples found in repository?
examples/get_forms.rs (line 13)
4async fn main() {
5 let api_key: String = String::from("Your MailerLite API Key");
6
7 let mailerlite: MailerLite = MailerLite::new(api_key);
8
9 let form_type: String = String::from("Your Form Type");
10
11 let parameter: Parameter = Parameter::new().add("sort", "created_at");
12
13 let response: Response = mailerlite.form().get(form_type, parameter.clone()).await;
14
15 println!("{:#?}", response);
16}Sourcepub async fn update(&self, id: String, form: Data) -> Response
pub async fn update(&self, id: String, form: Data) -> Response
Examples found in repository?
examples/update_form.rs (line 13)
4async fn main() {
5 let api_key: String = String::from("Your MailerLite API Key");
6
7 let mailerlite: MailerLite = MailerLite::new(api_key);
8
9 let id: String = String::from("Your Form ID");
10
11 let data: Data = Data::new().add("name", "Dummy Form");
12
13 let response: Response = mailerlite.form().update(id, data.clone()).await;
14
15 println!("{:#?}", response);
16}Sourcepub async fn get_subscribers(&self, id: String, query: Parameter) -> Response
pub async fn get_subscribers(&self, id: String, query: Parameter) -> Response
Examples found in repository?
examples/get_form_subscribers.rs (line 15)
4async fn main() {
5 let api_key: String = String::from("Your MailerLite API Key");
6
7 let mailerlite: MailerLite = MailerLite::new(api_key);
8
9 let id: String = String::from("Your Form ID");
10
11 let parameter: Parameter = Parameter::new().add("filter[status]", "unsubscribed");
12
13 let response: Response = mailerlite
14 .form()
15 .get_subscribers(id, parameter.clone())
16 .await;
17
18 println!("{:#?}", response);
19}Trait Implementations§
Auto Trait Implementations§
impl Freeze for Form
impl !RefUnwindSafe for Form
impl Send for Form
impl Sync for Form
impl Unpin for Form
impl !UnwindSafe for Form
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