pub struct Keyboard {
pub one_time: bool,
pub buttons: Vec<Vec<Button>>,
pub inline: bool,
}Expand description
The keyboard type
Fields§
§one_time: boolWill be it closed after click?
Buttons
inline: boolIs it inline?
Implementations§
Source§impl Keyboard
Methods
impl Keyboard
Methods
Sourcepub fn new(one_time: bool, buttons: Vec<Vec<Button>>, inline: bool) -> Self
pub fn new(one_time: bool, buttons: Vec<Vec<Button>>, inline: bool) -> Self
Create a keyboard from one_time, buttons and inline.
Add a button.
use vk_keyboard::button::*;
use vk_keyboard::keyboard::Keyboard;
let button = Button::new(ButtonColor::Primary, ButtonAction::Text
{
label: "Hello world!".to_owned(),
payload: String::new()
});
let mut keyboard = Keyboard::new(true, vec![], false);
keyboard.add_button(button);
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Keyboard
impl<'de> Deserialize<'de> for Keyboard
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Keyboard
impl RefUnwindSafe for Keyboard
impl Send for Keyboard
impl Sync for Keyboard
impl Unpin for Keyboard
impl UnwindSafe for Keyboard
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