pub struct Data {
pub data: Vec<(&'static str, &'static str)>,
}Fields§
§data: Vec<(&'static str, &'static str)>Implementations§
Source§impl Data
impl Data
Sourcepub fn new() -> Self
pub fn new() -> Self
Examples found in repository?
More examples
examples/update_form.rs (line 11)
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}examples/update_field.rs (line 11)
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 Field ID");
10
11 let data: Data = Data::new().add("name", "Dummy Field");
12
13 let response: Response = mailerlite.field().update(id, data.clone()).await;
14
15 println!("{:#?}", response);
16}examples/update_group.rs (line 11)
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 Group ID");
10
11 let data: Data = Data::new().add("name", "Dummy Group");
12
13 let response: Response = mailerlite.group().update(id, data.clone()).await;
14
15 println!("{:#?}", response);
16}Sourcepub fn add(self, key: &'static str, value: &'static str) -> Self
pub fn add(self, key: &'static str, value: &'static str) -> Self
Examples found in repository?
More examples
examples/update_form.rs (line 11)
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}examples/update_field.rs (line 11)
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 Field ID");
10
11 let data: Data = Data::new().add("name", "Dummy Field");
12
13 let response: Response = mailerlite.field().update(id, data.clone()).await;
14
15 println!("{:#?}", response);
16}examples/update_group.rs (line 11)
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 Group ID");
10
11 let data: Data = Data::new().add("name", "Dummy Group");
12
13 let response: Response = mailerlite.group().update(id, data.clone()).await;
14
15 println!("{:#?}", response);
16}pub fn get(&self, key: &'static str) -> Option<&'static str>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Data
impl RefUnwindSafe for Data
impl Send for Data
impl Sync for Data
impl Unpin for Data
impl UnwindSafe for Data
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