pub struct EnclaveManager {
pub enclave_id: String,
pub enclave_name: String,
/* private fields */
}Expand description
The structure which manages an enclave in a thread-safe manner.
Fields§
§enclave_id: StringThe full ID of the managed enclave.
enclave_name: StringName of the managed enclave.
Implementations§
Source§impl EnclaveManager
impl EnclaveManager
Sourcepub fn new(
enclave_cid: Option<u64>,
memory_mib: u64,
cpu_ids: EnclaveCpuConfig,
eif_file: File,
debug_mode: bool,
enclave_name: String,
) -> NitroCliResult<Self>
pub fn new( enclave_cid: Option<u64>, memory_mib: u64, cpu_ids: EnclaveCpuConfig, eif_file: File, debug_mode: bool, enclave_name: String, ) -> NitroCliResult<Self>
Create a new EnclaveManager instance.
Sourcepub fn run_enclave(
&mut self,
connection: Option<&Connection>,
) -> NitroCliResult<()>
pub fn run_enclave( &mut self, connection: Option<&Connection>, ) -> NitroCliResult<()>
Launch an enclave using the previously-set configuration.
The enclave handle is locked throughout enclave creation. This is fine, since the socket for receiving commands is exposed only after creation has completed.
Sourcepub fn set_measurements(
&mut self,
measurements: BTreeMap<String, String>,
) -> NitroCliResult<()>
pub fn set_measurements( &mut self, measurements: BTreeMap<String, String>, ) -> NitroCliResult<()>
Set measurements field inside EnclaveHandle
Sourcepub fn set_metadata(&mut self, metadata: EifIdentityInfo) -> NitroCliResult<()>
pub fn set_metadata(&mut self, metadata: EifIdentityInfo) -> NitroCliResult<()>
Set metadata field inside EnclaveHandle
Sourcepub fn get_description_resources(
&self,
) -> NitroCliResult<(u64, u64, u64, Vec<u32>, u64, u64, EnclaveState)>
pub fn get_description_resources( &self, ) -> NitroCliResult<(u64, u64, u64, Vec<u32>, u64, u64, EnclaveState)>
Get the resources needed for describing an enclave.
The enclave handle is locked during this operation.
Sourcepub fn get_measurements(&self) -> NitroCliResult<EnclaveBuildInfo>
pub fn get_measurements(&self) -> NitroCliResult<EnclaveBuildInfo>
Get measurements from enclave handle
Sourcepub fn get_metadata(&self) -> NitroCliResult<Option<EifIdentityInfo>>
pub fn get_metadata(&self) -> NitroCliResult<Option<EifIdentityInfo>>
Get metadata from enclave handle
Sourcepub fn get_console_resources_enclave_cid(&self) -> NitroCliResult<u64>
pub fn get_console_resources_enclave_cid(&self) -> NitroCliResult<u64>
Get the resources (enclave CID) needed for connecting to the enclave console.
The enclave handle is locked during this operation.
Sourcepub fn get_console_resources_enclave_flags(&self) -> NitroCliResult<u64>
pub fn get_console_resources_enclave_flags(&self) -> NitroCliResult<u64>
Get the resources (enclave flags) needed for connecting to the enclave console.
The enclave handle is locked during this operation.
Sourcepub fn get_enclave_descriptor(&self) -> NitroCliResult<RawFd>
pub fn get_enclave_descriptor(&self) -> NitroCliResult<RawFd>
Get the enclave descriptor.
The enclave handle is locked during this operation.
Sourcepub fn update_state(&mut self, state: EnclaveState) -> NitroCliResult<()>
pub fn update_state(&mut self, state: EnclaveState) -> NitroCliResult<()>
Update the state the enclave is in.
The enclave handle is locked during this operation.
Sourcepub fn terminate_enclave(&mut self) -> NitroCliResult<()>
pub fn terminate_enclave(&mut self) -> NitroCliResult<()>
Terminate the owned enclave.
The enclave handle is locked only when getting the resources needed for termination. This will allow the enclave process to execute other commands while termination is taking place.
Trait Implementations§
Source§impl Clone for EnclaveManager
impl Clone for EnclaveManager
Auto Trait Implementations§
impl Freeze for EnclaveManager
impl RefUnwindSafe for EnclaveManager
impl Send for EnclaveManager
impl Sync for EnclaveManager
impl Unpin for EnclaveManager
impl UnsafeUnpin for EnclaveManager
impl UnwindSafe for EnclaveManager
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more