pub struct Eliza { /* private fields */ }
Expand description
An ELIZA instance.
This struct is created by the new()
method. See its documentation for more.
Implementations§
source§impl Eliza
impl Eliza
sourcepub fn from_file(location: &str) -> Result<Eliza, Box<dyn Error>>
pub fn from_file(location: &str) -> Result<Eliza, Box<dyn Error>>
Initialise ELIZA with a script.
Will return Err
if the script at the specified location is invalid.
pub fn from_str(script: &str) -> Result<Eliza, Box<dyn Error>>
sourcepub fn greet(&self) -> String
pub fn greet(&self) -> String
Randomly selects a greeting statement from the greetings
list in the script.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Eliza
impl Send for Eliza
impl Sync for Eliza
impl Unpin for Eliza
impl UnwindSafe for Eliza
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