Struct link_args::windows::msvc::LinkArgs [−][src]
Helps to construct MSVC linker arguments.
Implementations
impl<const CAPACITY: usize> LinkArgs<CAPACITY>
[src]
pub const fn stack_size(self, reserve: u32) -> Self
[src]
The STACK
directive.
reserve
is the number of bytes of virtual memory to reserve for the
stack.
pub const fn stack_size_with_commit(self, reserve: u32, commit: u32) -> Self
[src]
The STACK
directive with explicit commit value.
reserve
is the number of bytes of virtual memory to reserve for the
stack. commit
is the number of byte of physical memory to allocate for
the stack when the program starts.
pub const fn default_lib(self, lib: &str) -> Self
[src]
The DEFAULTLIB
directive. Adds a library to use.
Libraries specified on the command line will override default libraries if there is a conflict.
pub const unsafe fn no_default_lib(self, lib: &str) -> Self
[src]
The NODEFAULTLIB
directive. Prevents a default library from being used.
Overrides default_lib
. Libraries specified on the command line will
bypass no_default_lib
.
This can be unsafe if used with default_lib
to replace symbols.
Examples
Prevent kernel32 from being linked.
link_args::windows::no_default_lib!("kernel32");
pub const fn disable_all_default_libs(self) -> Self
[src]
The NODEFAULTLIB
directive wihout arguments. Prevent any default lib
from being used.
Completely disables any and all use of default_lib
. This is safe
because if a symbol is unavaliable the program will fail to compile.
pub const unsafe fn raw(self, raw: &str) -> Self
[src]
One or more raw arguments, seperated by a space.
Many arguments that work on the command line will not work here.
Examples
The windows!
macro.
link_args::windows!{ unsafe { raw("/ENTRY:mainCRTStartup /STACK:0x800000"); } }
The windows::raw!
macro.
link_args::windows::raw!(unsafe "/ENTRY:mainCRTStartup /STACK:0x800000");
Possible arguments
- /DEFAULTLIB
- /NODEFAULTLIB
- /STACK
- /HEAP
- /SUBSYSTEM
- /EXPORT
- /INCLUDE
- /MANIFESTDEPENDENCY
- /MERGE
- /SECTION
- /ENTRY
Limitations
Different versions of the MSVC linker may support (or not support) different embeded arguments. Unsupported arguments or values may be silently ignored by the linker.
pub const fn new() -> Self
[src]
Create an empty argument list with the CAPACITY
of the type.
pub const fn len(&self) -> usize
[src]
Get the length in bytes.
pub const fn into_array(self) -> [u8; CAPACITY]
[src]
Consume the LinkArgs
and return its byte buffer.
Auto Trait Implementations
impl<const CAPACITY: usize> Send for LinkArgs<CAPACITY>
impl<const CAPACITY: usize> Sync for LinkArgs<CAPACITY>
impl<const CAPACITY: usize> Unpin for LinkArgs<CAPACITY>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,