pub struct RustClrEnv {
pub runtime_version: RuntimeVersion,
pub meta_host: ICLRMetaHost,
pub runtime_info: ICLRRuntimeInfo,
pub cor_runtime_host: ICorRuntimeHost,
pub app_domain: _AppDomain,
}
Expand description
Represents a simplified interface to the CLR components without loading assemblies.
Fields§
§runtime_version: RuntimeVersion
.NET runtime version to use.
meta_host: ICLRMetaHost
MetaHost for accessing CLR components.
runtime_info: ICLRRuntimeInfo
Runtime information for the specified CLR version.
cor_runtime_host: ICorRuntimeHost
Host for the CLR runtime.
app_domain: _AppDomain
Current application domain.
Implementations§
Source§impl RustClrEnv
impl RustClrEnv
Sourcepub fn new(runtime_version: Option<RuntimeVersion>) -> Result<Self, ClrError>
pub fn new(runtime_version: Option<RuntimeVersion>) -> Result<Self, ClrError>
Creates a new RustClrEnv
instance with the specified runtime version.
§Arguments
runtime_version
- The .NET runtime version to use.
§Returns
Ok(Self)
- If the components are initialized successfully.Err(ClrError)
- If initialization fails at any step.
§Examples
ⓘ
use rustclr::{RustClrEnv, RuntimeVersion};
fn main() -> Result<(), Box<dyn std::error::Error>> {
// Create a new RustClrEnv with a specific runtime version
let clr_env = RustClrEnv::new(Some(RuntimeVersion::V4))?;
println!("CLR initialized successfully.");
Ok(())
}
Trait Implementations§
Source§impl Debug for RustClrEnv
impl Debug for RustClrEnv
Auto Trait Implementations§
impl Freeze for RustClrEnv
impl RefUnwindSafe for RustClrEnv
impl !Send for RustClrEnv
impl !Sync for RustClrEnv
impl Unpin for RustClrEnv
impl UnwindSafe for RustClrEnv
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