pub struct InstanceInfo { /* private fields */ }Expand description
Information on the EC2 instance from the IMDS client. The client is queried lazily and only if
the AWS_EC2_METADATA_DISABLED environment variable is not set.
Implementations§
Source§impl InstanceInfo
impl InstanceInfo
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new instance. The IMDS client will only be queried when a method on the instance is
called, and only if the AWS_EC2_METADATA_DISABLED environment variable is not set.
Sourcepub fn region(&self) -> Result<&str, &InstanceInfoError>
pub fn region(&self) -> Result<&str, &InstanceInfoError>
The region for the current instance, if it can be retrieved using the IMDS client.
Sourcepub fn instance_type(&self) -> Result<&str, &InstanceInfoError>
pub fn instance_type(&self) -> Result<&str, &InstanceInfoError>
The instance type for the current instance, if it can be retrieved using the IMDS client.
Trait Implementations§
Source§impl Debug for InstanceInfo
impl Debug for InstanceInfo
Auto Trait Implementations§
impl !Freeze for InstanceInfo
impl !RefUnwindSafe for InstanceInfo
impl Send for InstanceInfo
impl !Sync for InstanceInfo
impl Unpin for InstanceInfo
impl UnsafeUnpin for InstanceInfo
impl !UnwindSafe for InstanceInfo
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