Struct windsh_core::history::History[][src]

pub struct History { /* fields omitted */ }

Implementations

impl History[src]

pub fn new(cmd: &str) -> Self[src]

pub fn save(&self, history_file: Option<&str>)[src]

pub fn set_datetime(&mut self, datetime: DateTime<Utc>)[src]

Set the datetime of history

use windsh_core::history::History;
use chrono::prelude::*;

let mut my_history = History::new("print Hello, World!");

my_history.set_datetime(Utc::now());

pub fn set_cmd(&mut self, cmd: &str)[src]

Set the cmd of history

use windsh_core::history::History;
use chrono::prelude::*;

let mut my_history = History::new("ls -lsa");

my_history.set_cmd("exec docker run -ti ubuntu:20.04 bash");

pub fn get_datetime(&self) -> DateTime<Utc>[src]

pub fn get_cmd(&self) -> String[src]

Trait Implementations

impl Clone for History[src]

Auto Trait Implementations

impl RefUnwindSafe for History

impl Send for History

impl Sync for History

impl Unpin for History

impl UnwindSafe for History

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.