pub struct Session { /* private fields */ }Expand description
A Kermit connection to a calculator in server mode, over a blocking
Transport with the system clock. For a link driven from outside (a
browser), see machine::Machine.
Implementations§
Source§impl Session
impl Session
Sourcepub fn new(transport: Box<dyn Transport>, options: Options) -> Result<Self>
pub fn new(transport: Box<dyn Transport>, options: Options) -> Result<Self>
Wrap transport, discarding input for options.drain first.
Sourcepub fn into_transport(self) -> Box<dyn Transport>
pub fn into_transport(self) -> Box<dyn Transport>
Give the link back, e.g. for an XModem transfer after
Calculator::prepare_for_xmodem
ended server mode.
Sourcepub fn set_config(&mut self, config: Config)
pub fn set_config(&mut self, config: Config)
Use config from the next transaction on.
Sourcepub fn answered(&self) -> bool
pub fn answered(&self) -> bool
Whether the server sent its parameters (its S, or the ACK to an
I or S) in the last transaction, also when it failed later: for
a host command, whether the C was received and answered.
Sourcepub fn transact(&mut self, command: Command) -> Result<Transcript>
pub fn transact(&mut self, command: Command) -> Result<Transcript>
Run one transaction to completion.
Sourcepub fn transact_with(
&mut self,
command: Command,
progress: &mut dyn FnMut(&Event),
) -> Result<Transcript>
pub fn transact_with( &mut self, command: Command, progress: &mut dyn FnMut(&Event), ) -> Result<Transcript>
Run one transaction, passing every event to progress.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Session
impl !Sync for Session
impl !UnwindSafe for Session
impl Forget for Session
impl Freeze for Session
impl Move for Session
impl Send for Session
impl Unpin for Session
impl UnsafeUnpin for Session
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