pub trait SessionExt: Sized {
// Required methods
fn connect(
endpoint: impl Into<String>,
agent_token: impl Into<String>,
minter: Arc<dyn TokenMinter>,
) -> impl Future<Output = Result<Self, Error>> + Send;
fn attach(
region: Region,
microvm_id: impl Into<String>,
endpoint: impl Into<String>,
agent_token: impl Into<String>,
port: Option<u16>,
request_timeout: Option<Duration>,
) -> impl Future<Output = Result<Self, Error>> + Send;
fn direct(
endpoint: impl Into<String>,
agent_token: impl Into<String>,
) -> Result<Self, Error>;
}Expand description
Session’s constructors over the production HTTP backend.
Required Methods§
Sourcefn connect(
endpoint: impl Into<String>,
agent_token: impl Into<String>,
minter: Arc<dyn TokenMinter>,
) -> impl Future<Output = Result<Self, Error>> + Send
fn connect( endpoint: impl Into<String>, agent_token: impl Into<String>, minter: Arc<dyn TokenMinter>, ) -> impl Future<Output = Result<Self, Error>> + Send
A session against endpoint, minting proxy tokens through minter.
Does not talk to the VM. Constructing a session is free and re-doable, and a constructor that probed would make “do I have a session” mean “is the VM up”, which are different questions with different answers during a launch.
Sourcefn attach(
region: Region,
microvm_id: impl Into<String>,
endpoint: impl Into<String>,
agent_token: impl Into<String>,
port: Option<u16>,
request_timeout: Option<Duration>,
) -> impl Future<Output = Result<Self, Error>> + Send
fn attach( region: Region, microvm_id: impl Into<String>, endpoint: impl Into<String>, agent_token: impl Into<String>, port: Option<u16>, request_timeout: Option<Duration>, ) -> impl Future<Output = Result<Self, Error>> + Send
Reattach to an existing AWS VM using a privately retained agent token.
Resolves AWS credentials but does not probe the guest or bootstrap it again.
The returned session is independent of any sandbox lock: use a separate attach
with a short request timeout for supervisor keepalives during long transfers.
Keep agent_token in private encrypted storage, never in public job status.
Sourcefn direct(
endpoint: impl Into<String>,
agent_token: impl Into<String>,
) -> Result<Self, Error>
fn direct( endpoint: impl Into<String>, agent_token: impl Into<String>, ) -> Result<Self, Error>
A session with no proxy auth, for a daemon reached directly.
The conformance path and every local-binary test go through here. See
crate::session::Transport::proxy on why this is a supported shape rather than a
test-only escape hatch.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".