MCPcopy Index your code
hub / github.com/endbasic/endbasic / async_exec

Method async_exec

client/src/cmds.rs:144–160  ·  view source on GitHub ↗
(&self, scope: Scope<'_>)

Source from the content-addressed store, hash-verified

142 }
143
144 async fn async_exec(&self, scope: Scope<'_>) -> CallResult<()> {
145 if self.service.borrow().is_logged_in() {
146 return Err(CallError::Precondition("Cannot LOGIN again before LOGOUT".to_owned()));
147 }
148
149 let username = scope.get_string(0).to_owned();
150 let password = if scope.nargs() == 1 {
151 read_line_secure(&mut *self.console.borrow_mut(), "Password: ")
152 .await
153 .map_err(CallError::from)?
154 } else {
155 debug_assert_eq!(2, scope.nargs());
156 scope.get_string(1).to_owned()
157 };
158
159 self.do_login(&username, &password).await.map_err(CallError::from)
160 }
161}
162
163/// The `LOGOUT` command.

Callers

nothing calls this directly

Calls 15

read_line_secureFunction · 0.85
refill_and_printFunction · 0.85
read_lineFunction · 0.85
get_stringMethod · 0.80
nargsMethod · 0.80
unmountMethod · 0.80
get_posMethod · 0.80
show_aclsMethod · 0.80
is_logged_inMethod · 0.45
do_loginMethod · 0.45
logoutMethod · 0.45
printMethod · 0.45

Tested by

no test coverage detected