pub struct CompileRequest {
pub target: CompileTarget,
pub assembly_flavor: Option<AssemblyFlavor>,
pub demangle_assembly: Option<DemangleAssembly>,
pub process_assembly: Option<ProcessAssembly>,
pub channel: Channel,
pub mode: Mode,
pub edition: Edition,
pub crate_type: CrateType,
pub tests: bool,
pub backtrace: bool,
pub code: String,
}Expand description
Request structure for compiling Rust code via the playground API.
Contains configuration for target output, compilation channel, mode, crate type, edition, and the source code to compile.
Fields§
§target: CompileTargetThe output target format of the compilation (e.g., Assembly, MIR).
assembly_flavor: Option<AssemblyFlavor>What flavour the assembly output should have (only required when target is CompileTarget::Assembly)
demangle_assembly: Option<DemangleAssembly>If the assembly output should be demangled or not (only required when target is CompileTarget::Assembly)
process_assembly: Option<ProcessAssembly>If the output should be processed or not (only required when target is CompileTarget::Assembly)
channel: ChannelThe Rust release channel to use (stable, beta, nightly).
mode: ModeThe compilation mode: debug or release.
edition: EditionThe Rust edition to use (2015, 2018, 2021, 2024).
crate_type: CrateTypeThe crate type: binary or library.
tests: boolWhether to include test code during compilation.
backtrace: boolWhether to enable backtrace output on errors.
code: StringThe Rust source code to compile.
Implementations§
Source§impl CompileRequest
impl CompileRequest
Sourcepub fn new(
target: CompileTarget,
assembly_flavor: Option<AssemblyFlavor>,
demangle_assembly: Option<DemangleAssembly>,
process_assembly: Option<ProcessAssembly>,
channel: Channel,
mode: Mode,
edition: Edition,
crate_type: CrateType,
tests: bool,
backtrace: bool,
code: String,
) -> Self
pub fn new( target: CompileTarget, assembly_flavor: Option<AssemblyFlavor>, demangle_assembly: Option<DemangleAssembly>, process_assembly: Option<ProcessAssembly>, channel: Channel, mode: Mode, edition: Edition, crate_type: CrateType, tests: bool, backtrace: bool, code: String, ) -> Self
Creates a new CompileRequest instance.
§Arguments
target- The compilation target (e.g., Assembly, LLVM IR, Wasm).assembly_flavor- The assembly flavor used when targeting assembly (e.g., AT&T or Intel). Optional.demangle_assembly- Whether to demangle symbols in assembly output. Optional.process_assembly- Whether to filter or output raw assembly. Optional.channel- The Rust release channel (e.g., stable, beta, nightly).mode- Compilation mode (e.g., debug or release).edition- The Rust edition to compile against.crate_type- The crate type (binary or library).tests- Whether to compile with test harness.backtrace- Whether to enable backtrace support.code- The Rust source code to compile.
§Returns
A fully constructed CompileRequest.
Trait Implementations§
Source§impl Clone for CompileRequest
impl Clone for CompileRequest
Source§fn clone(&self) -> CompileRequest
fn clone(&self) -> CompileRequest
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CompileRequest
impl Debug for CompileRequest
Source§impl Default for CompileRequest
impl Default for CompileRequest
Source§fn default() -> Self
fn default() -> Self
Provides a default CompileRequest configuration.
Defaults to:
- Target:
Assembly - Assembly flavor:
AT&T - Demangling:
Demangle - Process:
Filter - Channel:
Stable - Mode:
Debug - Edition:
2024 - Crate type:
Binary - Tests: disabled
- Backtrace: disabled
- Code:
fn main() { println!("Hello, world!"); }
§Returns
A CompileRequest instance with default values for compiling basic Rust code.
Source§impl<'de> Deserialize<'de> for CompileRequest
impl<'de> Deserialize<'de> for CompileRequest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for CompileRequest
impl PartialEq for CompileRequest
Source§impl Serialize for CompileRequest
impl Serialize for CompileRequest
impl Eq for CompileRequest
impl StructuralPartialEq for CompileRequest
Auto Trait Implementations§
impl Freeze for CompileRequest
impl RefUnwindSafe for CompileRequest
impl Send for CompileRequest
impl Sync for CompileRequest
impl Unpin for CompileRequest
impl UnwindSafe for CompileRequest
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
Source§impl<T> CloneDebuggableStorage for Twhere
T: DebuggableStorage + Clone,
impl<T> CloneDebuggableStorage for Twhere
T: DebuggableStorage + Clone,
fn clone_storage(&self) -> Box<dyn CloneDebuggableStorage>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> CloneableStorage for T
impl<T> CloneableStorage for T
fn clone_storage(&self) -> Box<dyn CloneableStorage>
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.