pub struct CommandBuilder<Cmd> { /* private fields */ }Expand description
Builds MikroTik router commands using a fluid API.
Ensures that only commands with at least one operation can be built and sent.
§Examples
let cmd = CommandBuilder::new()
.command("/system/resource/print")
.attribute("detail", None)
.build();Implementations§
Source§impl CommandBuilder<NoCmd>
impl CommandBuilder<NoCmd>
Sourcepub fn login(username: &str, password: Option<&str>) -> Command
pub fn login(username: &str, password: Option<&str>) -> Command
Builds a login command with the provided username and optional password.
§Arguments
username- The username for the login command.password- An optional password for the login command.
§Returns
A Command which represents the login operation.
§Examples
let login_cmd = CommandBuilder::login("admin", Some("password"));Trait Implementations§
Source§impl<Cmd: Clone> Clone for CommandBuilder<Cmd>
impl<Cmd: Clone> Clone for CommandBuilder<Cmd>
Source§fn clone(&self) -> CommandBuilder<Cmd>
fn clone(&self) -> CommandBuilder<Cmd>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<Cmd> Freeze for CommandBuilder<Cmd>
impl<Cmd> RefUnwindSafe for CommandBuilder<Cmd>where
Cmd: RefUnwindSafe,
impl<Cmd> Send for CommandBuilder<Cmd>where
Cmd: Send,
impl<Cmd> Sync for CommandBuilder<Cmd>where
Cmd: Sync,
impl<Cmd> Unpin for CommandBuilder<Cmd>where
Cmd: Unpin,
impl<Cmd> UnwindSafe for CommandBuilder<Cmd>where
Cmd: 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