#[resource_main_func]
Expand description
Defines entry point of your alt:V Rust resource.
§Example
ⓘ
#[altv::main]
fn main() -> impl altv::IntoVoidResult {
altv::log!("hello world");
}
§crate_name
This attribute can be used if altv
crate is renamed in Cargo.toml using “package” option.
Cargo.toml
[dependencies]
my_custom_name = { version = "...", package = "altv" }
src/lib.rs
ⓘ
#[my_custom_name::main(crate_name = "my_custom_name")]
fn main() -> impl my_custom_name::IntoVoidResult {
my_custom_name::log!("hello world");
}