pub struct CompileRequest<'a> {
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: Cow<'a, str>,
}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: Cow<'a, str>The Rust source code to compile.
Implementations§
Source§impl<'a> CompileRequest<'a>
impl<'a> CompileRequest<'a>
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: Cow<'a, str>,
) -> 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: Cow<'a, str>, ) -> 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<'a> Clone for CompileRequest<'a>
impl<'a> Clone for CompileRequest<'a>
Source§fn clone(&self) -> CompileRequest<'a>
fn clone(&self) -> CompileRequest<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'a> Debug for CompileRequest<'a>
impl<'a> Debug for CompileRequest<'a>
Source§impl<'a> Default for CompileRequest<'a>
impl<'a> Default for CompileRequest<'a>
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, 'a> Deserialize<'de> for CompileRequest<'a>
impl<'de, 'a> Deserialize<'de> for CompileRequest<'a>
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<'a> PartialEq for CompileRequest<'a>
impl<'a> PartialEq for CompileRequest<'a>
Source§impl<'a> Serialize for CompileRequest<'a>
impl<'a> Serialize for CompileRequest<'a>
impl<'a> Eq for CompileRequest<'a>
impl<'a> StructuralPartialEq for CompileRequest<'a>
Auto Trait Implementations§
impl<'a> Freeze for CompileRequest<'a>
impl<'a> RefUnwindSafe for CompileRequest<'a>
impl<'a> Send for CompileRequest<'a>
impl<'a> Sync for CompileRequest<'a>
impl<'a> Unpin for CompileRequest<'a>
impl<'a> UnwindSafe for CompileRequest<'a>
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.