pub struct DeviceLoginFlow { /* private fields */ }Expand description
An in-flight muse login OAuth device-code flow.
Plain stdout, no pseudo-terminal: the CLI prints the verification URL and code, then blocks polling for browser approval. Dropping the flow cancels the login (the child is killed).
Implementations§
Source§impl DeviceLoginFlow
impl DeviceLoginFlow
Sourcepub async fn start_with_binary(binary: &str) -> Result<Self>
pub async fn start_with_binary(binary: &str) -> Result<Self>
start with a specific CLI binary.
Sourcepub async fn device_code(&mut self, timeout: Duration) -> Result<DeviceCode>
pub async fn device_code(&mut self, timeout: Duration) -> Result<DeviceCode>
Read output until the verification URL and code are both seen.
Show them to your user; the flow keeps polling in the background
until wait_approved resolves.
Sourcepub async fn wait_approved(self, timeout: Duration) -> Result<()>
pub async fn wait_approved(self, timeout: Duration) -> Result<()>
Wait for the user to approve in the browser: resolves when the CLI exits successfully (credential saved) or errors on failure/timeout.
Auto Trait Implementations§
impl !RefUnwindSafe for DeviceLoginFlow
impl !UnwindSafe for DeviceLoginFlow
impl Freeze for DeviceLoginFlow
impl Send for DeviceLoginFlow
impl Sync for DeviceLoginFlow
impl Unpin for DeviceLoginFlow
impl UnsafeUnpin for DeviceLoginFlow
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