[INFO] fetching crate gdnative-bindings-lily 0.9.3... [INFO] checking gdnative-bindings-lily-0.9.3 against master#d3dd34a1d4a7e25a92a0d65994bb01a5d17c59ee for pr-127481-2 [INFO] extracting crate gdnative-bindings-lily 0.9.3 into /workspace/builds/worker-5-tc1/source [INFO] validating manifest of crates.io crate gdnative-bindings-lily 0.9.3 on toolchain d3dd34a1d4a7e25a92a0d65994bb01a5d17c59ee [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+d3dd34a1d4a7e25a92a0d65994bb01a5d17c59ee" "metadata" "--manifest-path" "Cargo.toml" "--no-deps", kill_on_drop: false }` [INFO] started tweaking crates.io crate gdnative-bindings-lily 0.9.3 [INFO] finished tweaking crates.io crate gdnative-bindings-lily 0.9.3 [INFO] tweaked toml for crates.io crate gdnative-bindings-lily 0.9.3 written to /workspace/builds/worker-5-tc1/source/Cargo.toml [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+d3dd34a1d4a7e25a92a0d65994bb01a5d17c59ee" "generate-lockfile" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Updating crates.io index [INFO] [stderr] Locking 67 packages to latest compatible versions [INFO] [stderr] Adding ahash v0.7.8 (latest: v0.8.11) [INFO] [stderr] Adding approx v0.4.0 (latest: v0.5.1) [INFO] [stderr] Adding bindgen v0.56.0 (latest: v0.69.4) [INFO] [stderr] Adding bitflags v1.3.2 (latest: v2.6.0) [INFO] [stderr] Adding cexpr v0.4.0 (latest: v0.6.0) [INFO] [stderr] Adding gdnative-core v0.9.3 (latest: v0.11.3) [INFO] [stderr] Adding gdnative-impl-proc-macros v0.9.3 (latest: v0.11.3) [INFO] [stderr] Adding gdnative-sys v0.9.3 (latest: v0.11.3) [INFO] [stderr] Adding gdnative_bindings_generator v0.9.3 (latest: v0.11.3) [INFO] [stderr] Adding hashbrown v0.12.3 (latest: v0.14.5) [INFO] [stderr] Adding heck v0.3.3 (latest: v0.5.0) [INFO] [stderr] Adding indexmap v1.9.3 (latest: v2.2.6) [INFO] [stderr] Adding itoa v0.4.8 (latest: v1.0.11) [INFO] [stderr] Adding mini-internal v0.1.13 (latest: v0.1.39) [INFO] [stderr] Adding miniserde v0.1.13 (latest: v0.1.39) [INFO] [stderr] Adding nom v5.1.3 (latest: v7.1.3) [INFO] [stderr] Adding parking_lot v0.11.2 (latest: v0.12.3) [INFO] [stderr] Adding parking_lot_core v0.8.6 (latest: v0.9.10) [INFO] [stderr] Adding peeking_take_while v0.1.2 (latest: v1.0.0) [INFO] [stderr] Adding redox_syscall v0.2.16 (latest: v0.5.3) [INFO] [stderr] Adding roxmltree v0.14.1 (latest: v0.20.0) [INFO] [stderr] Adding rustc-hash v1.1.0 (latest: v2.0.0) [INFO] [stderr] Adding shlex v0.1.1 (latest: v1.3.0) [INFO] [stderr] Adding syn v1.0.109 (latest: v2.0.71) [INFO] [stderr] Adding unindent v0.1.11 (latest: v0.2.3) [INFO] [stderr] Adding wasi v0.11.0+wasi-snapshot-preview1 (latest: v0.13.1+wasi-0.2.0) [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+d3dd34a1d4a7e25a92a0d65994bb01a5d17c59ee" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded gdnative-core v0.9.3 [INFO] [stderr] Downloaded gdnative-impl-proc-macros v0.9.3 [INFO] [stderr] Downloaded mini-internal v0.1.13 [INFO] [stderr] Downloaded gdnative_bindings_generator v0.9.3 [INFO] [stderr] Downloaded miniserde v0.1.13 [INFO] [stderr] Downloaded gdnative-sys v0.9.3 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:dff56e7819e73ed36160586b3445e93eb0be776c16704aeeded9c3fb668b2384" "/opt/rustwide/cargo-home/bin/cargo" "+d3dd34a1d4a7e25a92a0d65994bb01a5d17c59ee" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] 3c7a68c84a3410523c9d7af5c2c8efb1bed7417236df664f8473bd83853a7b23 [INFO] running `Command { std: "docker" "start" "-a" "3c7a68c84a3410523c9d7af5c2c8efb1bed7417236df664f8473bd83853a7b23", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "3c7a68c84a3410523c9d7af5c2c8efb1bed7417236df664f8473bd83853a7b23", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "3c7a68c84a3410523c9d7af5c2c8efb1bed7417236df664f8473bd83853a7b23", kill_on_drop: false }` [INFO] [stdout] 3c7a68c84a3410523c9d7af5c2c8efb1bed7417236df664f8473bd83853a7b23 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:dff56e7819e73ed36160586b3445e93eb0be776c16704aeeded9c3fb668b2384" "/opt/rustwide/cargo-home/bin/cargo" "+d3dd34a1d4a7e25a92a0d65994bb01a5d17c59ee" "check" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] bd7dafd8e7b7331a48e676c8713549d9ef079ad5bae4a301dd5a0dfe35e3c7c9 [INFO] running `Command { std: "docker" "start" "-a" "bd7dafd8e7b7331a48e676c8713549d9ef079ad5bae4a301dd5a0dfe35e3c7c9", kill_on_drop: false }` [INFO] [stderr] Compiling syn v1.0.109 [INFO] [stderr] Compiling version_check v0.9.4 [INFO] [stderr] Compiling glob v0.3.1 [INFO] [stderr] Compiling ryu v1.0.18 [INFO] [stderr] Compiling itoa v0.4.8 [INFO] [stderr] Compiling cfg-if v1.0.0 [INFO] [stderr] Compiling regex-syntax v0.8.4 [INFO] [stderr] Compiling memchr v2.7.4 [INFO] [stderr] Compiling libloading v0.8.4 [INFO] [stderr] Compiling libc v0.2.155 [INFO] [stderr] Compiling bindgen v0.56.0 [INFO] [stderr] Compiling num-traits v0.2.19 [INFO] [stderr] Compiling nom v5.1.3 [INFO] [stderr] Compiling clang-sys v1.8.1 [INFO] [stderr] Compiling lazycell v1.3.0 [INFO] [stderr] Compiling rustc-hash v1.1.0 [INFO] [stderr] Compiling lazy_static v1.5.0 [INFO] [stderr] Compiling peeking_take_while v0.1.2 [INFO] [stderr] Compiling shlex v0.1.1 [INFO] [stderr] Compiling lock_api v0.4.12 [INFO] [stderr] Compiling unicode-segmentation v1.11.0 [INFO] [stderr] Compiling parking_lot_core v0.8.6 [INFO] [stderr] Compiling xmlparser v0.13.6 [INFO] [stderr] Compiling heck v0.3.3 [INFO] [stderr] Compiling roxmltree v0.14.1 [INFO] [stderr] Compiling ahash v0.7.8 [INFO] [stderr] Checking instant v0.1.13 [INFO] [stderr] Checking scopeguard v1.2.0 [INFO] [stderr] Compiling unindent v0.1.11 [INFO] [stderr] Checking smallvec v1.13.2 [INFO] [stderr] Checking getrandom v0.2.15 [INFO] [stderr] Checking once_cell v1.19.0 [INFO] [stderr] Checking parking_lot v0.11.2 [INFO] [stderr] Checking approx v0.4.0 [INFO] [stderr] Checking euclid v0.22.10 [INFO] [stderr] Compiling regex-automata v0.4.7 [INFO] [stderr] Compiling cexpr v0.4.0 [INFO] [stderr] Compiling regex v1.10.5 [INFO] [stderr] Compiling mini-internal v0.1.13 [INFO] [stderr] Compiling gdnative-impl-proc-macros v0.9.3 [INFO] [stderr] Compiling miniserde v0.1.13 [INFO] [stderr] Compiling gdnative_bindings_generator v0.9.3 [INFO] [stderr] Compiling gdnative-bindings-lily v0.9.3 (/opt/rustwide/workdir) [INFO] [stderr] Compiling gdnative-sys v0.9.3 [INFO] [stderr] Checking gdnative-core v0.9.3 [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:4:8780 [INFO] [stdout] | [INFO] [stdout] 4 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] = note: `#[warn(static_mut_refs)]` on by default [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 4 | # [doc = "`core class AudioEffectPhaser` inherits `AudioEffect` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_audioeffectphaser.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nAudioEffectPhaser inherits methods from:\n - [AudioEffect](struct.AudioEffect.html)\n - [Resource](struct.Resource.html)\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct AudioEffectPhaser { this : RawObject < Self > , } impl AudioEffectPhaser { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AudioEffectPhaserMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "Governs how high the filter frequencies sweep. Low value will primarily affect bass frequencies. High value can sweep high into the treble. Value can range from 0.1 to 4."] # [doc = ""] # [inline] pub fn depth (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectPhaserMethodTable :: get (get_api ()) . get_depth ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Output percent of modified sound. Value can range from 0.1 to 0.9."] # [doc = ""] # [inline] pub fn feedback (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectPhaserMethodTable :: get (get_api ()) . get_feedback ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Determines the maximum frequency affected by the LFO modulations, in Hz. Value can range from 10 to 10000."] # [doc = ""] # [inline] pub fn range_max_hz (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectPhaserMethodTable :: get (get_api ()) . get_range_max_hz ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Determines the minimum frequency affected by the LFO modulations, in Hz. Value can range from 10 to 10000."] # [doc = ""] # [inline] pub fn range_min_hz (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectPhaserMethodTable :: get (get_api ()) . get_range_min_hz ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Adjusts the rate in Hz at which the effect sweeps up and down across the frequency range."] # [doc = ""] # [inline] pub fn rate_hz (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectPhaserMethodTable :: get (get_api ()) . get_rate_hz ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Governs how high the filter frequencies sweep. Low value will primarily affect bass frequencies. High value can sweep high into the treble. Value can range from 0.1 to 4."] # [doc = ""] # [inline] pub fn set_depth (& self , depth : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectPhaserMethodTable :: get (get_api ()) . set_depth ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , depth) ; } } # [doc = "Output percent of modified sound. Value can range from 0.1 to 0.9."] # [doc = ""] # [inline] pub fn set_feedback (& self , fbk : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectPhaserMethodTable :: get (get_api ()) . set_feedback ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , fbk) ; } } # [doc = "Determines the maximum frequency affected by the LFO modulations, in Hz. Value can range from 10 to 10000."] # [doc = ""] # [inline] pub fn set_range_max_hz (& self , hz : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectPhaserMethodTable :: get (get_api ()) . set_range_max_hz ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , hz) ; } } # [doc = "Determines the minimum frequency affected by the LFO modulations, in Hz. Value can range from 10 to 10000."] # [doc = ""] # [inline] pub fn set_range_min_hz (& self , hz : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectPhaserMethodTable :: get (get_api ()) . set_range_min_hz ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , hz) ; } } # [doc = "Adjusts the rate in Hz at which the effect sweeps up and down across the frequency range."] # [doc = ""] # [inline] pub fn set_rate_hz (& self , hz : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectPhaserMethodTable :: get (get_api ()) . set_rate_hz ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , hz) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for AudioEffectPhaser { } unsafe impl GodotObject for AudioEffectPhaser { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AudioEffectPhaser" } } impl std :: ops :: Deref for AudioEffectPhaser { type Target = crate :: generated :: audio_effect :: AudioEffect ; # [inline] fn deref (& self) -> & crate :: generated :: audio_effect :: AudioEffect { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AudioEffectPhaser { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: audio_effect :: AudioEffect { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: audio_effect :: AudioEffect > for AudioEffectPhaser { } unsafe impl SubClass < crate :: generated :: resource :: Resource > for AudioEffectPhaser { } unsafe impl SubClass < crate :: generated :: reference :: Reference > for AudioEffectPhaser { } unsafe impl SubClass < crate :: generated :: object :: Object > for AudioEffectPhaser { } impl Instanciable for AudioEffectPhaser { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { AudioEffectPhaser :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AudioEffectPhaserMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_depth : * mut sys :: godot_method_bind , pub get_feedback : * mut sys :: godot_method_bind , pub get_range_max_hz : * mut sys :: godot_method_bind , pub get_range_min_hz : * mut sys :: godot_method_bind , pub get_rate_hz : * mut sys :: godot_method_bind , pub set_depth : * mut sys :: godot_method_bind , pub set_feedback : * mut sys :: godot_method_bind , pub set_range_max_hz : * mut sys :: godot_method_bind , pub set_range_min_hz : * mut sys :: godot_method_bind , pub set_rate_hz : * mut sys :: godot_method_bind } impl AudioEffectPhaserMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AudioEffectPhaserMethodTable = AudioEffectPhaserMethodTable { class_constructor : None , get_depth : 0 as * mut sys :: godot_method_bind , get_feedback : 0 as * mut sys :: godot_method_bind , get_range_max_hz : 0 as * mut sys :: godot_method_bind , get_range_min_hz : 0 as * mut sys :: godot_method_bind , get_rate_hz : 0 as * mut sys :: godot_method_bind , set_depth : 0 as * mut sys :: godot_method_bind , set_feedback : 0 as * mut sys :: godot_method_bind , set_range_max_hz : 0 as * mut sys :: godot_method_bind , set_range_min_hz : 0 as * mut sys :: godot_method_bind , set_rate_hz : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { AudioEffectPhaserMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AudioEffectPhaser\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_depth = (gd_api . godot_method_bind_get_method) (class_name , "get_depth\0" . as_ptr () as * const c_char) ; table . get_feedback = (gd_api . godot_method_bind_get_method) (class_name , "get_feedback\0" . as_ptr () as * const c_char) ; table . get_range_max_hz = (gd_api . godot_method_bind_get_method) (class_name , "get_range_max_hz\0" . as_ptr () as * const c_char) ; table . get_range_min_hz = (gd_api . godot_method_bind_get_method) (class_name , "get_range_min_hz\0" . as_ptr () as * const c_char) ; table . get_rate_hz = (gd_api . godot_method_bind_get_method) (class_name , "get_rate_hz\0" . as_ptr () as * const c_char) ; table . set_depth = (gd_api . godot_method_bind_get_method) (class_name , "set_depth\0" . as_ptr () as * const c_char) ; table . set_feedback = (gd_api . godot_method_bind_get_method) (class_name , "set_feedback\0" . as_ptr () as * const c_char) ; table . set_range_max_hz = (gd_api . godot_method_bind_get_method) (class_name , "set_range_max_hz\0" . as_ptr () as * const c_char) ; table . set_range_min_hz = (gd_api . godot_method_bind_get_method) (class_name , "set_range_min_hz\0" . as_ptr () as * const c_char) ; table . set_rate_hz = (gd_api . godot_method_bind_get_method) (class_name , "set_rate_hz\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:10:6196 [INFO] [stdout] | [INFO] [stdout] 10 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 10 | # [doc = "`core singleton class CameraServer` inherits `Object` (unsafe)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_cameraserver.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = ""] # [doc = "\n## Class hierarchy\n\nCameraServer inherits methods from:\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct CameraServer { this : RawObject < Self > , } # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct FeedImage (pub i64) ; impl FeedImage { pub const YCBCR_IMAGE : FeedImage = FeedImage (0i64) ; pub const RGBA_IMAGE : FeedImage = FeedImage (0i64) ; pub const Y_IMAGE : FeedImage = FeedImage (0i64) ; pub const CBCR_IMAGE : FeedImage = FeedImage (1i64) ; } impl From < i64 > for FeedImage { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < FeedImage > for i64 { # [inline] fn from (v : FeedImage) -> Self { v . 0 } } # [doc = "Constants"] # [allow (non_upper_case_globals)] impl CameraServer { pub const FEED_CBCR_IMAGE : i64 = 1i64 ; pub const FEED_RGBA_IMAGE : i64 = 0i64 ; pub const FEED_YCBCR_IMAGE : i64 = 0i64 ; pub const FEED_Y_IMAGE : i64 = 0i64 ; } impl CameraServer { # [doc = "Returns a reference to the singleton instance."] # [inline] pub fn godot_singleton () -> & 'static Self { unsafe { let this = (get_api () . godot_global_get_singleton) ("CameraServer\0" . as_ptr () as * mut _) ; let this = ptr :: NonNull :: new (this) . expect ("singleton should not be null") ; let this = RawObject :: from_sys_ref_unchecked :: < 'static > (this) ; Self :: cast_ref (this) } } # [doc = "Adds a camera feed to the camera server."] # [doc = ""] # [inline] pub fn add_feed (& self , feed : impl AsArg < crate :: generated :: camera_feed :: CameraFeed >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CameraServerMethodTable :: get (get_api ()) . add_feed ; let ret = crate :: icalls :: icallptr_void_obj (method_bind , self . this . sys () . as_ptr () , feed . as_arg_ptr ()) ; } } # [doc = "Returns an array of [CameraFeed]s."] # [doc = ""] # [inline] pub fn feeds (& self) -> VariantArray { unsafe { let method_bind : * mut sys :: godot_method_bind = CameraServerMethodTable :: get (get_api ()) . feeds ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < VariantArray > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns the [CameraFeed] with this id."] # [doc = ""] # [inline] pub fn get_feed (& self , index : i64) -> Option < Ref < crate :: generated :: camera_feed :: CameraFeed , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = CameraServerMethodTable :: get (get_api ()) . get_feed ; let ret = crate :: icalls :: icallptr_obj_i64 (method_bind , self . this . sys () . as_ptr () , index) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: camera_feed :: CameraFeed , thread_access :: Shared >> :: move_from_sys (sys)) } } # [doc = "Returns the number of [CameraFeed]s registered."] # [doc = ""] # [inline] pub fn get_feed_count (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = CameraServerMethodTable :: get (get_api ()) . get_feed_count ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Removes a [CameraFeed]."] # [doc = ""] # [inline] pub fn remove_feed (& self , feed : impl AsArg < crate :: generated :: camera_feed :: CameraFeed >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CameraServerMethodTable :: get (get_api ()) . remove_feed ; let ret = crate :: icalls :: icallptr_void_obj (method_bind , self . this . sys () . as_ptr () , feed . as_arg_ptr ()) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for CameraServer { } unsafe impl GodotObject for CameraServer { type RefKind = ref_kind :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "CameraServer" } } impl std :: ops :: Deref for CameraServer { type Target = crate :: generated :: object :: Object ; # [inline] fn deref (& self) -> & crate :: generated :: object :: Object { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for CameraServer { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: object :: Object { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: object :: Object > for CameraServer { } unsafe impl Send for CameraServer { } unsafe impl Sync for CameraServer { } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct CameraServerMethodTable { pub class_constructor : sys :: godot_class_constructor , pub add_feed : * mut sys :: godot_method_bind , pub feeds : * mut sys :: godot_method_bind , pub get_feed : * mut sys :: godot_method_bind , pub get_feed_count : * mut sys :: godot_method_bind , pub remove_feed : * mut sys :: godot_method_bind } impl CameraServerMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : CameraServerMethodTable = CameraServerMethodTable { class_constructor : None , add_feed : 0 as * mut sys :: godot_method_bind , feeds : 0 as * mut sys :: godot_method_bind , get_feed : 0 as * mut sys :: godot_method_bind , get_feed_count : 0 as * mut sys :: godot_method_bind , remove_feed : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { CameraServerMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "CameraServer\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . add_feed = (gd_api . godot_method_bind_get_method) (class_name , "add_feed\0" . as_ptr () as * const c_char) ; table . feeds = (gd_api . godot_method_bind_get_method) (class_name , "feeds\0" . as_ptr () as * const c_char) ; table . get_feed = (gd_api . godot_method_bind_get_method) (class_name , "get_feed\0" . as_ptr () as * const c_char) ; table . get_feed_count = (gd_api . godot_method_bind_get_method) (class_name , "get_feed_count\0" . as_ptr () as * const c_char) ; table . remove_feed = (gd_api . godot_method_bind_get_method) (class_name , "remove_feed\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:16:4512 [INFO] [stdout] | [INFO] [stdout] 16 | ...thodTable { class_constructor : None , } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 16 | # [doc = "`core class CheckBox` inherits `Button` (unsafe)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_checkbox.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nNon reference counted objects such as the ones of this type are usually owned by the engine.\n\n`CheckBox` is a reference-only type. Persistent references can\nonly exist in the unsafe `Ref` form.\n\nIn the cases where Rust code owns an object of this type, for example if the object was just\ncreated on the Rust side and not passed to the engine yet, ownership should be either given\nto the engine or the object must be manually destroyed using `Ref::free`, or `Ref::queue_free`\nif it is a `Node`."] # [doc = "\n## Class hierarchy\n\nCheckBox inherits methods from:\n - [Button](struct.Button.html)\n - [BaseButton](struct.BaseButton.html)\n - [Control](struct.Control.html)\n - [CanvasItem](struct.CanvasItem.html)\n - [Node](struct.Node.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct CheckBox { this : RawObject < Self > , } impl CheckBox { # [doc = "Creates a new instance of this object.\n\nBecause this type is not reference counted, the lifetime of the returned object\nis *not* automatically managed.\n\nImmediately after creation, the object is owned by the caller, and can be\npassed to the engine (in which case the engine will be responsible for\ndestroying the object) or destroyed manually using `Ref::free`, or preferably\n`Ref::queue_free` if it is a `Node`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = CheckBoxMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } } impl gdnative_core :: private :: godot_object :: Sealed for CheckBox { } unsafe impl GodotObject for CheckBox { type RefKind = ref_kind :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "CheckBox" } } impl QueueFree for CheckBox { # [inline] unsafe fn godot_queue_free (obj : * mut sys :: godot_object) { let method_bind : * mut sys :: godot_method_bind = crate :: generated :: node :: NodeMethodTable :: get (get_api ()) . queue_free ; crate :: icalls :: icallptr_void (method_bind , obj) } } impl std :: ops :: Deref for CheckBox { type Target = crate :: generated :: button :: Button ; # [inline] fn deref (& self) -> & crate :: generated :: button :: Button { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for CheckBox { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: button :: Button { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: button :: Button > for CheckBox { } unsafe impl SubClass < crate :: generated :: base_button :: BaseButton > for CheckBox { } unsafe impl SubClass < crate :: generated :: control :: Control > for CheckBox { } unsafe impl SubClass < crate :: generated :: canvas_item :: CanvasItem > for CheckBox { } unsafe impl SubClass < crate :: generated :: node :: Node > for CheckBox { } unsafe impl SubClass < crate :: generated :: object :: Object > for CheckBox { } impl Instanciable for CheckBox { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { CheckBox :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct CheckBoxMethodTable { pub class_constructor : sys :: godot_class_constructor , } impl CheckBoxMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : CheckBoxMethodTable = CheckBoxMethodTable { class_constructor : None , } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { CheckBoxMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "CheckBox\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:22:11978 [INFO] [stdout] | [INFO] [stdout] 22 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 22 | # [doc = "`core class SpriteFrames` inherits `Resource` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_spriteframes.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nSpriteFrames inherits methods from:\n - [Resource](struct.Resource.html)\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct SpriteFrames { this : RawObject < Self > , } impl SpriteFrames { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = SpriteFramesMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "Adds a new animation to the library."] # [doc = ""] # [inline] pub fn add_animation (& self , anim : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = SpriteFramesMethodTable :: get (get_api ()) . add_animation ; let ret = crate :: icalls :: icallptr_void_str (method_bind , self . this . sys () . as_ptr () , anim . into ()) ; } } # [doc = "Adds a frame to the given animation.\n# Default Arguments\n* `at_position` - `-1`"] # [doc = ""] # [inline] pub fn add_frame (& self , anim : impl Into < GodotString > , frame : impl AsArg < crate :: generated :: texture :: Texture > , at_position : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = SpriteFramesMethodTable :: get (get_api ()) . add_frame ; let ret = crate :: icalls :: icallptr_void_str_obj_i64 (method_bind , self . this . sys () . as_ptr () , anim . into () , frame . as_arg_ptr () , at_position) ; } } # [doc = "Removes all frames from the given animation."] # [doc = ""] # [inline] pub fn clear (& self , anim : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = SpriteFramesMethodTable :: get (get_api ()) . clear ; let ret = crate :: icalls :: icallptr_void_str (method_bind , self . this . sys () . as_ptr () , anim . into ()) ; } } # [doc = "Removes all animations. A \"default\" animation will be created."] # [doc = ""] # [inline] pub fn clear_all (& self) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = SpriteFramesMethodTable :: get (get_api ()) . clear_all ; let ret = crate :: icalls :: icallptr_void (method_bind , self . this . sys () . as_ptr ()) ; } } # [doc = "If `true`, the given animation will loop."] # [doc = ""] # [inline] pub fn get_animation_loop (& self , anim : impl Into < GodotString >) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = SpriteFramesMethodTable :: get (get_api ()) . get_animation_loop ; let ret = crate :: icalls :: icallptr_bool_str (method_bind , self . this . sys () . as_ptr () , anim . into ()) ; ret as _ } } # [doc = "Returns an array containing the names associated to each animation. Values are placed in alphabetical order."] # [doc = ""] # [inline] pub fn get_animation_names (& self) -> StringArray { unsafe { let method_bind : * mut sys :: godot_method_bind = SpriteFramesMethodTable :: get (get_api ()) . get_animation_names ; let ret = crate :: icalls :: icallptr_strarr (method_bind , self . this . sys () . as_ptr ()) ; StringArray :: from_sys (ret) } } # [doc = "The animation's speed in frames per second."] # [doc = ""] # [inline] pub fn get_animation_speed (& self , anim : impl Into < GodotString >) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = SpriteFramesMethodTable :: get (get_api ()) . get_animation_speed ; let ret = crate :: icalls :: icallptr_f64_str (method_bind , self . this . sys () . as_ptr () , anim . into ()) ; ret as _ } } # [doc = "Returns the animation's selected frame."] # [doc = ""] # [inline] pub fn get_frame (& self , anim : impl Into < GodotString > , idx : i64) -> Option < Ref < crate :: generated :: texture :: Texture , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = SpriteFramesMethodTable :: get (get_api ()) . get_frame ; let ret = crate :: icalls :: icallptr_obj_str_i64 (method_bind , self . this . sys () . as_ptr () , anim . into () , idx) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: texture :: Texture , thread_access :: Shared >> :: move_from_sys (sys)) } } # [doc = "Returns the number of frames in the animation."] # [doc = ""] # [inline] pub fn get_frame_count (& self , anim : impl Into < GodotString >) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = SpriteFramesMethodTable :: get (get_api ()) . get_frame_count ; let ret = crate :: icalls :: icallptr_i64_str (method_bind , self . this . sys () . as_ptr () , anim . into ()) ; ret as _ } } # [doc = "If `true`, the named animation exists."] # [doc = ""] # [inline] pub fn has_animation (& self , anim : impl Into < GodotString >) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = SpriteFramesMethodTable :: get (get_api ()) . has_animation ; let ret = crate :: icalls :: icallptr_bool_str (method_bind , self . this . sys () . as_ptr () , anim . into ()) ; ret as _ } } # [doc = "Removes the given animation."] # [doc = ""] # [inline] pub fn remove_animation (& self , anim : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = SpriteFramesMethodTable :: get (get_api ()) . remove_animation ; let ret = crate :: icalls :: icallptr_void_str (method_bind , self . this . sys () . as_ptr () , anim . into ()) ; } } # [doc = "Removes the animation's selected frame."] # [doc = ""] # [inline] pub fn remove_frame (& self , anim : impl Into < GodotString > , idx : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = SpriteFramesMethodTable :: get (get_api ()) . remove_frame ; let ret = crate :: icalls :: icallptr_void_str_i64 (method_bind , self . this . sys () . as_ptr () , anim . into () , idx) ; } } # [doc = "Changes the animation's name to `newname`."] # [doc = ""] # [inline] pub fn rename_animation (& self , anim : impl Into < GodotString > , newname : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = SpriteFramesMethodTable :: get (get_api ()) . rename_animation ; let ret = crate :: icalls :: icallptr_void_str_str (method_bind , self . this . sys () . as_ptr () , anim . into () , newname . into ()) ; } } # [doc = "If `true`, the animation will loop."] # [doc = ""] # [inline] pub fn set_animation_loop (& self , anim : impl Into < GodotString > , _loop : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = SpriteFramesMethodTable :: get (get_api ()) . set_animation_loop ; let ret = crate :: icalls :: icallptr_void_str_bool (method_bind , self . this . sys () . as_ptr () , anim . into () , _loop) ; } } # [doc = "The animation's speed in frames per second."] # [doc = ""] # [inline] pub fn set_animation_speed (& self , anim : impl Into < GodotString > , speed : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = SpriteFramesMethodTable :: get (get_api ()) . set_animation_speed ; let ret = crate :: icalls :: icallptr_void_str_f64 (method_bind , self . this . sys () . as_ptr () , anim . into () , speed) ; } } # [doc = "Sets the texture of the given frame."] # [doc = ""] # [inline] pub fn set_frame (& self , anim : impl Into < GodotString > , idx : i64 , txt : impl AsArg < crate :: generated :: texture :: Texture >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = SpriteFramesMethodTable :: get (get_api ()) . set_frame ; let ret = crate :: icalls :: icallptr_void_str_i64_obj (method_bind , self . this . sys () . as_ptr () , anim . into () , idx , txt . as_arg_ptr ()) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for SpriteFrames { } unsafe impl GodotObject for SpriteFrames { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "SpriteFrames" } } impl std :: ops :: Deref for SpriteFrames { type Target = crate :: generated :: resource :: Resource ; # [inline] fn deref (& self) -> & crate :: generated :: resource :: Resource { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for SpriteFrames { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: resource :: Resource { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: resource :: Resource > for SpriteFrames { } unsafe impl SubClass < crate :: generated :: reference :: Reference > for SpriteFrames { } unsafe impl SubClass < crate :: generated :: object :: Object > for SpriteFrames { } impl Instanciable for SpriteFrames { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { SpriteFrames :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct SpriteFramesMethodTable { pub class_constructor : sys :: godot_class_constructor , pub add_animation : * mut sys :: godot_method_bind , pub add_frame : * mut sys :: godot_method_bind , pub clear : * mut sys :: godot_method_bind , pub clear_all : * mut sys :: godot_method_bind , pub get_animation_loop : * mut sys :: godot_method_bind , pub get_animation_names : * mut sys :: godot_method_bind , pub get_animation_speed : * mut sys :: godot_method_bind , pub get_frame : * mut sys :: godot_method_bind , pub get_frame_count : * mut sys :: godot_method_bind , pub has_animation : * mut sys :: godot_method_bind , pub remove_animation : * mut sys :: godot_method_bind , pub remove_frame : * mut sys :: godot_method_bind , pub rename_animation : * mut sys :: godot_method_bind , pub set_animation_loop : * mut sys :: godot_method_bind , pub set_animation_speed : * mut sys :: godot_method_bind , pub set_frame : * mut sys :: godot_method_bind } impl SpriteFramesMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : SpriteFramesMethodTable = SpriteFramesMethodTable { class_constructor : None , add_animation : 0 as * mut sys :: godot_method_bind , add_frame : 0 as * mut sys :: godot_method_bind , clear : 0 as * mut sys :: godot_method_bind , clear_all : 0 as * mut sys :: godot_method_bind , get_animation_loop : 0 as * mut sys :: godot_method_bind , get_animation_names : 0 as * mut sys :: godot_method_bind , get_animation_speed : 0 as * mut sys :: godot_method_bind , get_frame : 0 as * mut sys :: godot_method_bind , get_frame_count : 0 as * mut sys :: godot_method_bind , has_animation : 0 as * mut sys :: godot_method_bind , remove_animation : 0 as * mut sys :: godot_method_bind , remove_frame : 0 as * mut sys :: godot_method_bind , rename_animation : 0 as * mut sys :: godot_method_bind , set_animation_loop : 0 as * mut sys :: godot_method_bind , set_animation_speed : 0 as * mut sys :: godot_method_bind , set_frame : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { SpriteFramesMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "SpriteFrames\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . add_animation = (gd_api . godot_method_bind_get_method) (class_name , "add_animation\0" . as_ptr () as * const c_char) ; table . add_frame = (gd_api . godot_method_bind_get_method) (class_name , "add_frame\0" . as_ptr () as * const c_char) ; table . clear = (gd_api . godot_method_bind_get_method) (class_name , "clear\0" . as_ptr () as * const c_char) ; table . clear_all = (gd_api . godot_method_bind_get_method) (class_name , "clear_all\0" . as_ptr () as * const c_char) ; table . get_animation_loop = (gd_api . godot_method_bind_get_method) (class_name , "get_animation_loop\0" . as_ptr () as * const c_char) ; table . get_animation_names = (gd_api . godot_method_bind_get_method) (class_name , "get_animation_names\0" . as_ptr () as * const c_char) ; table . get_animation_speed = (gd_api . godot_method_bind_get_method) (class_name , "get_animation_speed\0" . as_ptr () as * const c_char) ; table . get_frame = (gd_api . godot_method_bind_get_method) (class_name , "get_frame\0" . as_ptr () as * const c_char) ; table . get_frame_count = (gd_api . godot_method_bind_get_method) (class_name , "get_frame_count\0" . as_ptr () as * const c_char) ; table . has_animation = (gd_api . godot_method_bind_get_method) (class_name , "has_animation\0" . as_ptr () as * const c_char) ; table . remove_animation = (gd_api . godot_method_bind_get_method) (class_name , "remove_animation\0" . as_ptr () as * const c_char) ; table . remove_frame = (gd_api . godot_method_bind_get_method) (class_name , "remove_frame\0" . as_ptr () as * const c_char) ; table . rename_animation = (gd_api . godot_method_bind_get_method) (class_name , "rename_animation\0" . as_ptr () as * const c_char) ; table . set_animation_loop = (gd_api . godot_method_bind_get_method) (class_name , "set_animation_loop\0" . as_ptr () as * const c_char) ; table . set_animation_speed = (gd_api . godot_method_bind_get_method) (class_name , "set_animation_speed\0" . as_ptr () as * const c_char) ; table . set_frame = (gd_api . godot_method_bind_get_method) (class_name , "set_frame\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:28:3380 [INFO] [stdout] | [INFO] [stdout] 28 | ...thodTable { class_constructor : None , } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 28 | # [doc = "`core class Texture3D` inherits `TextureLayered` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_texture3d.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nTexture3D inherits methods from:\n - [TextureLayered](struct.TextureLayered.html)\n - [Resource](struct.Resource.html)\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct Texture3D { this : RawObject < Self > , } impl Texture3D { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = Texture3DMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } } impl gdnative_core :: private :: godot_object :: Sealed for Texture3D { } unsafe impl GodotObject for Texture3D { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "Texture3D" } } impl std :: ops :: Deref for Texture3D { type Target = crate :: generated :: texture_layered :: TextureLayered ; # [inline] fn deref (& self) -> & crate :: generated :: texture_layered :: TextureLayered { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for Texture3D { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: texture_layered :: TextureLayered { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: texture_layered :: TextureLayered > for Texture3D { } unsafe impl SubClass < crate :: generated :: resource :: Resource > for Texture3D { } unsafe impl SubClass < crate :: generated :: reference :: Reference > for Texture3D { } unsafe impl SubClass < crate :: generated :: object :: Object > for Texture3D { } impl Instanciable for Texture3D { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { Texture3D :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct Texture3DMethodTable { pub class_constructor : sys :: godot_class_constructor , } impl Texture3DMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : Texture3DMethodTable = Texture3DMethodTable { class_constructor : None , } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { Texture3DMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "Texture3D\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:34:4483 [INFO] [stdout] | [INFO] [stdout] 34 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 34 | # [doc = "`core class RectangleShape2D` inherits `Shape2D` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_rectangleshape2d.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nRectangleShape2D inherits methods from:\n - [Shape2D](struct.Shape2D.html)\n - [Resource](struct.Resource.html)\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct RectangleShape2D { this : RawObject < Self > , } impl RectangleShape2D { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = RectangleShape2DMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "The rectangle's half extents. The width and height of this shape is twice the half extents."] # [doc = ""] # [inline] pub fn extents (& self) -> Vector2 { unsafe { let method_bind : * mut sys :: godot_method_bind = RectangleShape2DMethodTable :: get (get_api ()) . get_extents ; let ret = crate :: icalls :: icallptr_vec2 (method_bind , self . this . sys () . as_ptr ()) ; mem :: transmute (ret) } } # [doc = "The rectangle's half extents. The width and height of this shape is twice the half extents."] # [doc = ""] # [inline] pub fn set_extents (& self , extents : Vector2) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = RectangleShape2DMethodTable :: get (get_api ()) . set_extents ; let ret = crate :: icalls :: icallptr_void_vec2 (method_bind , self . this . sys () . as_ptr () , extents) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for RectangleShape2D { } unsafe impl GodotObject for RectangleShape2D { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "RectangleShape2D" } } impl std :: ops :: Deref for RectangleShape2D { type Target = crate :: generated :: shape_2d :: Shape2D ; # [inline] fn deref (& self) -> & crate :: generated :: shape_2d :: Shape2D { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for RectangleShape2D { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: shape_2d :: Shape2D { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: shape_2d :: Shape2D > for RectangleShape2D { } unsafe impl SubClass < crate :: generated :: resource :: Resource > for RectangleShape2D { } unsafe impl SubClass < crate :: generated :: reference :: Reference > for RectangleShape2D { } unsafe impl SubClass < crate :: generated :: object :: Object > for RectangleShape2D { } impl Instanciable for RectangleShape2D { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { RectangleShape2D :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct RectangleShape2DMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_extents : * mut sys :: godot_method_bind , pub set_extents : * mut sys :: godot_method_bind } impl RectangleShape2DMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : RectangleShape2DMethodTable = RectangleShape2DMethodTable { class_constructor : None , get_extents : 0 as * mut sys :: godot_method_bind , set_extents : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { RectangleShape2DMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "RectangleShape2D\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_extents = (gd_api . godot_method_bind_get_method) (class_name , "get_extents\0" . as_ptr () as * const c_char) ; table . set_extents = (gd_api . godot_method_bind_get_method) (class_name , "set_extents\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:40:5075 [INFO] [stdout] | [INFO] [stdout] 40 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 40 | # [doc = "`core class CylinderShape` inherits `Shape` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_cylindershape.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nCylinderShape inherits methods from:\n - [Shape](struct.Shape.html)\n - [Resource](struct.Resource.html)\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct CylinderShape { this : RawObject < Self > , } impl CylinderShape { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = CylinderShapeMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "The cylinder's height."] # [doc = ""] # [inline] pub fn height (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = CylinderShapeMethodTable :: get (get_api ()) . get_height ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "The cylinder's radius."] # [doc = ""] # [inline] pub fn radius (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = CylinderShapeMethodTable :: get (get_api ()) . get_radius ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "The cylinder's height."] # [doc = ""] # [inline] pub fn set_height (& self , height : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CylinderShapeMethodTable :: get (get_api ()) . set_height ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , height) ; } } # [doc = "The cylinder's radius."] # [doc = ""] # [inline] pub fn set_radius (& self , radius : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CylinderShapeMethodTable :: get (get_api ()) . set_radius ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , radius) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for CylinderShape { } unsafe impl GodotObject for CylinderShape { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "CylinderShape" } } impl std :: ops :: Deref for CylinderShape { type Target = crate :: generated :: shape :: Shape ; # [inline] fn deref (& self) -> & crate :: generated :: shape :: Shape { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for CylinderShape { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: shape :: Shape { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: shape :: Shape > for CylinderShape { } unsafe impl SubClass < crate :: generated :: resource :: Resource > for CylinderShape { } unsafe impl SubClass < crate :: generated :: reference :: Reference > for CylinderShape { } unsafe impl SubClass < crate :: generated :: object :: Object > for CylinderShape { } impl Instanciable for CylinderShape { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { CylinderShape :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct CylinderShapeMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_height : * mut sys :: godot_method_bind , pub get_radius : * mut sys :: godot_method_bind , pub set_height : * mut sys :: godot_method_bind , pub set_radius : * mut sys :: godot_method_bind } impl CylinderShapeMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : CylinderShapeMethodTable = CylinderShapeMethodTable { class_constructor : None , get_height : 0 as * mut sys :: godot_method_bind , get_radius : 0 as * mut sys :: godot_method_bind , set_height : 0 as * mut sys :: godot_method_bind , set_radius : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { CylinderShapeMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "CylinderShape\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_height = (gd_api . godot_method_bind_get_method) (class_name , "get_height\0" . as_ptr () as * const c_char) ; table . get_radius = (gd_api . godot_method_bind_get_method) (class_name , "get_radius\0" . as_ptr () as * const c_char) ; table . set_height = (gd_api . godot_method_bind_get_method) (class_name , "set_height\0" . as_ptr () as * const c_char) ; table . set_radius = (gd_api . godot_method_bind_get_method) (class_name , "set_radius\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:46:5943 [INFO] [stdout] | [INFO] [stdout] 46 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 46 | # [doc = "`core class VisibilityNotifier` inherits `Spatial` (unsafe)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_visibilitynotifier.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nNon reference counted objects such as the ones of this type are usually owned by the engine.\n\n`VisibilityNotifier` is a reference-only type. Persistent references can\nonly exist in the unsafe `Ref` form.\n\nIn the cases where Rust code owns an object of this type, for example if the object was just\ncreated on the Rust side and not passed to the engine yet, ownership should be either given\nto the engine or the object must be manually destroyed using `Ref::free`, or `Ref::queue_free`\nif it is a `Node`."] # [doc = "\n## Class hierarchy\n\nVisibilityNotifier inherits methods from:\n - [Spatial](struct.Spatial.html)\n - [Node](struct.Node.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct VisibilityNotifier { this : RawObject < Self > , } impl VisibilityNotifier { # [doc = "Creates a new instance of this object.\n\nBecause this type is not reference counted, the lifetime of the returned object\nis *not* automatically managed.\n\nImmediately after creation, the object is owned by the caller, and can be\npassed to the engine (in which case the engine will be responsible for\ndestroying the object) or destroyed manually using `Ref::free`, or preferably\n`Ref::queue_free` if it is a `Node`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = VisibilityNotifierMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "The VisibilityNotifier's bounding box."] # [doc = ""] # [inline] pub fn aabb (& self) -> Aabb { unsafe { let method_bind : * mut sys :: godot_method_bind = VisibilityNotifierMethodTable :: get (get_api ()) . get_aabb ; let ret = crate :: icalls :: icallptr_aabb (method_bind , self . this . sys () . as_ptr ()) ; mem :: transmute (ret) } } # [doc = "If `true`, the bounding box is on the screen.\n**Note:** It takes one frame for the node's visibility to be assessed once added to the scene tree, so this method will return `false` right after it is instantiated, even if it will be on screen in the draw pass."] # [doc = ""] # [inline] pub fn is_on_screen (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = VisibilityNotifierMethodTable :: get (get_api ()) . is_on_screen ; let ret = crate :: icalls :: icallptr_bool (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "The VisibilityNotifier's bounding box."] # [doc = ""] # [inline] pub fn set_aabb (& self , rect : Aabb) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = VisibilityNotifierMethodTable :: get (get_api ()) . set_aabb ; let ret = crate :: icalls :: icallptr_void_aabb (method_bind , self . this . sys () . as_ptr () , rect) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for VisibilityNotifier { } unsafe impl GodotObject for VisibilityNotifier { type RefKind = ref_kind :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "VisibilityNotifier" } } impl QueueFree for VisibilityNotifier { # [inline] unsafe fn godot_queue_free (obj : * mut sys :: godot_object) { let method_bind : * mut sys :: godot_method_bind = crate :: generated :: node :: NodeMethodTable :: get (get_api ()) . queue_free ; crate :: icalls :: icallptr_void (method_bind , obj) } } impl std :: ops :: Deref for VisibilityNotifier { type Target = crate :: generated :: spatial :: Spatial ; # [inline] fn deref (& self) -> & crate :: generated :: spatial :: Spatial { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for VisibilityNotifier { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: spatial :: Spatial { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: spatial :: Spatial > for VisibilityNotifier { } unsafe impl SubClass < crate :: generated :: node :: Node > for VisibilityNotifier { } unsafe impl SubClass < crate :: generated :: object :: Object > for VisibilityNotifier { } impl Instanciable for VisibilityNotifier { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { VisibilityNotifier :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct VisibilityNotifierMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_aabb : * mut sys :: godot_method_bind , pub is_on_screen : * mut sys :: godot_method_bind , pub set_aabb : * mut sys :: godot_method_bind } impl VisibilityNotifierMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : VisibilityNotifierMethodTable = VisibilityNotifierMethodTable { class_constructor : None , get_aabb : 0 as * mut sys :: godot_method_bind , is_on_screen : 0 as * mut sys :: godot_method_bind , set_aabb : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { VisibilityNotifierMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "VisibilityNotifier\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_aabb = (gd_api . godot_method_bind_get_method) (class_name , "get_aabb\0" . as_ptr () as * const c_char) ; table . is_on_screen = (gd_api . godot_method_bind_get_method) (class_name , "is_on_screen\0" . as_ptr () as * const c_char) ; table . set_aabb = (gd_api . godot_method_bind_get_method) (class_name , "set_aabb\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:52:2890 [INFO] [stdout] | [INFO] [stdout] 52 | ...thodTable { class_constructor : None , } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 52 | # [doc = "`tools class EditorResourcePreviewGenerator` inherits `Reference` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_editorresourcepreviewgenerator.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nEditorResourcePreviewGenerator inherits methods from:\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = "\n## Tool\n\nThis class is used to interact with Godot's editor."] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct EditorResourcePreviewGenerator { this : RawObject < Self > , } impl EditorResourcePreviewGenerator { } impl gdnative_core :: private :: godot_object :: Sealed for EditorResourcePreviewGenerator { } unsafe impl GodotObject for EditorResourcePreviewGenerator { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "EditorResourcePreviewGenerator" } } impl std :: ops :: Deref for EditorResourcePreviewGenerator { type Target = crate :: generated :: reference :: Reference ; # [inline] fn deref (& self) -> & crate :: generated :: reference :: Reference { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for EditorResourcePreviewGenerator { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: reference :: Reference { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: reference :: Reference > for EditorResourcePreviewGenerator { } unsafe impl SubClass < crate :: generated :: object :: Object > for EditorResourcePreviewGenerator { } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct EditorResourcePreviewGeneratorMethodTable { pub class_constructor : sys :: godot_class_constructor , } impl EditorResourcePreviewGeneratorMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : EditorResourcePreviewGeneratorMethodTable = EditorResourcePreviewGeneratorMethodTable { class_constructor : None , } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { EditorResourcePreviewGeneratorMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "EditorResourcePreviewGenerator\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:58:13122 [INFO] [stdout] | [INFO] [stdout] 58 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 58 | # [doc = "`core class AnimatedTexture` inherits `Texture` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_animatedtexture.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nAnimatedTexture inherits methods from:\n - [Texture](struct.Texture.html)\n - [Resource](struct.Resource.html)\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct AnimatedTexture { this : RawObject < Self > , } # [doc = "Constants"] # [allow (non_upper_case_globals)] impl AnimatedTexture { pub const MAX_FRAMES : i64 = 256i64 ; } impl AnimatedTexture { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AnimatedTextureMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "Sets the currently visible frame of the texture."] # [doc = ""] # [inline] pub fn current_frame (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimatedTextureMethodTable :: get (get_api ()) . get_current_frame ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Animation speed in frames per second. This value defines the default time interval between two frames of the animation, and thus the overall duration of the animation loop based on the [member frames] property. A value of 0 means no predefined number of frames per second, the animation will play according to each frame's frame delay (see [method set_frame_delay]).\nFor example, an animation with 8 frames, no frame delay and a `fps` value of 2 will run for 4 seconds, with each frame lasting 0.5 seconds."] # [doc = ""] # [inline] pub fn fps (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimatedTextureMethodTable :: get (get_api ()) . get_fps ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Returns the given frame's delay value."] # [doc = ""] # [inline] pub fn frame_delay (& self , frame : i64) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimatedTextureMethodTable :: get (get_api ()) . get_frame_delay ; let ret = crate :: icalls :: icallptr_f64_i64 (method_bind , self . this . sys () . as_ptr () , frame) ; ret as _ } } # [doc = "Returns the given frame's [Texture]."] # [doc = ""] # [inline] pub fn frame_texture (& self , frame : i64) -> Option < Ref < crate :: generated :: texture :: Texture , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimatedTextureMethodTable :: get (get_api ()) . get_frame_texture ; let ret = crate :: icalls :: icallptr_obj_i64 (method_bind , self . this . sys () . as_ptr () , frame) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: texture :: Texture , thread_access :: Shared >> :: move_from_sys (sys)) } } # [doc = "Number of frames to use in the animation. While you can create the frames independently with [method set_frame_texture], you need to set this value for the animation to take new frames into account. The maximum number of frames is [constant MAX_FRAMES]."] # [doc = ""] # [inline] pub fn frames (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimatedTextureMethodTable :: get (get_api ()) . get_frames ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "If `true`, the animation will only play once and will not loop back to the first frame after reaching the end. Note that reaching the end will not set [member pause] to `true`."] # [doc = ""] # [inline] pub fn oneshot (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimatedTextureMethodTable :: get (get_api ()) . get_oneshot ; let ret = crate :: icalls :: icallptr_bool (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "If `true`, the animation will pause where it currently is (i.e. at [member current_frame]). The animation will continue from where it was paused when changing this property to `false`."] # [doc = ""] # [inline] pub fn pause (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimatedTextureMethodTable :: get (get_api ()) . get_pause ; let ret = crate :: icalls :: icallptr_bool (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Sets the currently visible frame of the texture."] # [doc = ""] # [inline] pub fn set_current_frame (& self , frame : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimatedTextureMethodTable :: get (get_api ()) . set_current_frame ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , frame) ; } } # [doc = "Animation speed in frames per second. This value defines the default time interval between two frames of the animation, and thus the overall duration of the animation loop based on the [member frames] property. A value of 0 means no predefined number of frames per second, the animation will play according to each frame's frame delay (see [method set_frame_delay]).\nFor example, an animation with 8 frames, no frame delay and a `fps` value of 2 will run for 4 seconds, with each frame lasting 0.5 seconds."] # [doc = ""] # [inline] pub fn set_fps (& self , fps : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimatedTextureMethodTable :: get (get_api ()) . set_fps ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , fps) ; } } # [doc = "_Sample code is GDScript unless otherwise noted._\n\nSets an additional delay (in seconds) between this frame and the next one, that will be added to the time interval defined by [member fps]. By default, frames have no delay defined. If a delay value is defined, the final time interval between this frame and the next will be `1.0 / fps + delay`.\nFor example, for an animation with 3 frames, 2 FPS and a frame delay on the second frame of 1.2, the resulting playback will be:\n```gdscript\nFrame 0: 0.5 s (1 / fps)\nFrame 1: 1.7 s (1 / fps + 1.2)\nFrame 2: 0.5 s (1 / fps)\nTotal duration: 2.7 s\n```"] # [doc = ""] # [inline] pub fn set_frame_delay (& self , frame : i64 , delay : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimatedTextureMethodTable :: get (get_api ()) . set_frame_delay ; let ret = crate :: icalls :: icallptr_void_i64_f64 (method_bind , self . this . sys () . as_ptr () , frame , delay) ; } } # [doc = "Assigns a [Texture] to the given frame. Frame IDs start at 0, so the first frame has ID 0, and the last frame of the animation has ID [member frames] - 1.\nYou can define any number of textures up to [constant MAX_FRAMES], but keep in mind that only frames from 0 to [member frames] - 1 will be part of the animation."] # [doc = ""] # [inline] pub fn set_frame_texture (& self , frame : i64 , texture : impl AsArg < crate :: generated :: texture :: Texture >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimatedTextureMethodTable :: get (get_api ()) . set_frame_texture ; let ret = crate :: icalls :: icallptr_void_i64_obj (method_bind , self . this . sys () . as_ptr () , frame , texture . as_arg_ptr ()) ; } } # [doc = "Number of frames to use in the animation. While you can create the frames independently with [method set_frame_texture], you need to set this value for the animation to take new frames into account. The maximum number of frames is [constant MAX_FRAMES]."] # [doc = ""] # [inline] pub fn set_frames (& self , frames : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimatedTextureMethodTable :: get (get_api ()) . set_frames ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , frames) ; } } # [doc = "If `true`, the animation will only play once and will not loop back to the first frame after reaching the end. Note that reaching the end will not set [member pause] to `true`."] # [doc = ""] # [inline] pub fn set_oneshot (& self , oneshot : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimatedTextureMethodTable :: get (get_api ()) . set_oneshot ; let ret = crate :: icalls :: icallptr_void_bool (method_bind , self . this . sys () . as_ptr () , oneshot) ; } } # [doc = "If `true`, the animation will pause where it currently is (i.e. at [member current_frame]). The animation will continue from where it was paused when changing this property to `false`."] # [doc = ""] # [inline] pub fn set_pause (& self , pause : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimatedTextureMethodTable :: get (get_api ()) . set_pause ; let ret = crate :: icalls :: icallptr_void_bool (method_bind , self . this . sys () . as_ptr () , pause) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for AnimatedTexture { } unsafe impl GodotObject for AnimatedTexture { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AnimatedTexture" } } impl std :: ops :: Deref for AnimatedTexture { type Target = crate :: generated :: texture :: Texture ; # [inline] fn deref (& self) -> & crate :: generated :: texture :: Texture { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AnimatedTexture { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: texture :: Texture { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: texture :: Texture > for AnimatedTexture { } unsafe impl SubClass < crate :: generated :: resource :: Resource > for AnimatedTexture { } unsafe impl SubClass < crate :: generated :: reference :: Reference > for AnimatedTexture { } unsafe impl SubClass < crate :: generated :: object :: Object > for AnimatedTexture { } impl Instanciable for AnimatedTexture { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { AnimatedTexture :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AnimatedTextureMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_current_frame : * mut sys :: godot_method_bind , pub get_fps : * mut sys :: godot_method_bind , pub get_frame_delay : * mut sys :: godot_method_bind , pub get_frame_texture : * mut sys :: godot_method_bind , pub get_frames : * mut sys :: godot_method_bind , pub get_oneshot : * mut sys :: godot_method_bind , pub get_pause : * mut sys :: godot_method_bind , pub set_current_frame : * mut sys :: godot_method_bind , pub set_fps : * mut sys :: godot_method_bind , pub set_frame_delay : * mut sys :: godot_method_bind , pub set_frame_texture : * mut sys :: godot_method_bind , pub set_frames : * mut sys :: godot_method_bind , pub set_oneshot : * mut sys :: godot_method_bind , pub set_pause : * mut sys :: godot_method_bind } impl AnimatedTextureMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AnimatedTextureMethodTable = AnimatedTextureMethodTable { class_constructor : None , get_current_frame : 0 as * mut sys :: godot_method_bind , get_fps : 0 as * mut sys :: godot_method_bind , get_frame_delay : 0 as * mut sys :: godot_method_bind , get_frame_texture : 0 as * mut sys :: godot_method_bind , get_frames : 0 as * mut sys :: godot_method_bind , get_oneshot : 0 as * mut sys :: godot_method_bind , get_pause : 0 as * mut sys :: godot_method_bind , set_current_frame : 0 as * mut sys :: godot_method_bind , set_fps : 0 as * mut sys :: godot_method_bind , set_frame_delay : 0 as * mut sys :: godot_method_bind , set_frame_texture : 0 as * mut sys :: godot_method_bind , set_frames : 0 as * mut sys :: godot_method_bind , set_oneshot : 0 as * mut sys :: godot_method_bind , set_pause : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { AnimatedTextureMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AnimatedTexture\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_current_frame = (gd_api . godot_method_bind_get_method) (class_name , "get_current_frame\0" . as_ptr () as * const c_char) ; table . get_fps = (gd_api . godot_method_bind_get_method) (class_name , "get_fps\0" . as_ptr () as * const c_char) ; table . get_frame_delay = (gd_api . godot_method_bind_get_method) (class_name , "get_frame_delay\0" . as_ptr () as * const c_char) ; table . get_frame_texture = (gd_api . godot_method_bind_get_method) (class_name , "get_frame_texture\0" . as_ptr () as * const c_char) ; table . get_frames = (gd_api . godot_method_bind_get_method) (class_name , "get_frames\0" . as_ptr () as * const c_char) ; table . get_oneshot = (gd_api . godot_method_bind_get_method) (class_name , "get_oneshot\0" . as_ptr () as * const c_char) ; table . get_pause = (gd_api . godot_method_bind_get_method) (class_name , "get_pause\0" . as_ptr () as * const c_char) ; table . set_current_frame = (gd_api . godot_method_bind_get_method) (class_name , "set_current_frame\0" . as_ptr () as * const c_char) ; table . set_fps = (gd_api . godot_method_bind_get_method) (class_name , "set_fps\0" . as_ptr () as * const c_char) ; table . set_frame_delay = (gd_api . godot_method_bind_get_method) (class_name , "set_frame_delay\0" . as_ptr () as * const c_char) ; table . set_frame_texture = (gd_api . godot_method_bind_get_method) (class_name , "set_frame_texture\0" . as_ptr () as * const c_char) ; table . set_frames = (gd_api . godot_method_bind_get_method) (class_name , "set_frames\0" . as_ptr () as * const c_char) ; table . set_oneshot = (gd_api . godot_method_bind_get_method) (class_name , "set_oneshot\0" . as_ptr () as * const c_char) ; table . set_pause = (gd_api . godot_method_bind_get_method) (class_name , "set_pause\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:64:4445 [INFO] [stdout] | [INFO] [stdout] 64 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 64 | # [doc = "`core class ConvexPolygonShape` inherits `Shape` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_convexpolygonshape.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nConvexPolygonShape inherits methods from:\n - [Shape](struct.Shape.html)\n - [Resource](struct.Resource.html)\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct ConvexPolygonShape { this : RawObject < Self > , } impl ConvexPolygonShape { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = ConvexPolygonShapeMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "The list of 3D points forming the convex polygon shape."] # [doc = ""] # [inline] pub fn points (& self) -> Vector3Array { unsafe { let method_bind : * mut sys :: godot_method_bind = ConvexPolygonShapeMethodTable :: get (get_api ()) . get_points ; let ret = crate :: icalls :: icallptr_vec3arr (method_bind , self . this . sys () . as_ptr ()) ; Vector3Array :: from_sys (ret) } } # [doc = "The list of 3D points forming the convex polygon shape."] # [doc = ""] # [inline] pub fn set_points (& self , points : Vector3Array) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = ConvexPolygonShapeMethodTable :: get (get_api ()) . set_points ; let ret = crate :: icalls :: icallptr_void_vec3arr (method_bind , self . this . sys () . as_ptr () , points) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for ConvexPolygonShape { } unsafe impl GodotObject for ConvexPolygonShape { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "ConvexPolygonShape" } } impl std :: ops :: Deref for ConvexPolygonShape { type Target = crate :: generated :: shape :: Shape ; # [inline] fn deref (& self) -> & crate :: generated :: shape :: Shape { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for ConvexPolygonShape { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: shape :: Shape { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: shape :: Shape > for ConvexPolygonShape { } unsafe impl SubClass < crate :: generated :: resource :: Resource > for ConvexPolygonShape { } unsafe impl SubClass < crate :: generated :: reference :: Reference > for ConvexPolygonShape { } unsafe impl SubClass < crate :: generated :: object :: Object > for ConvexPolygonShape { } impl Instanciable for ConvexPolygonShape { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { ConvexPolygonShape :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct ConvexPolygonShapeMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_points : * mut sys :: godot_method_bind , pub set_points : * mut sys :: godot_method_bind } impl ConvexPolygonShapeMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : ConvexPolygonShapeMethodTable = ConvexPolygonShapeMethodTable { class_constructor : None , get_points : 0 as * mut sys :: godot_method_bind , set_points : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { ConvexPolygonShapeMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "ConvexPolygonShape\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_points = (gd_api . godot_method_bind_get_method) (class_name , "get_points\0" . as_ptr () as * const c_char) ; table . set_points = (gd_api . godot_method_bind_get_method) (class_name , "set_points\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:76:8153 [INFO] [stdout] | [INFO] [stdout] 76 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 76 | # [doc = "`core class VisualInstance` inherits `Spatial` (unsafe)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_visualinstance.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = ""] # [doc = "\n## Class hierarchy\n\nVisualInstance inherits methods from:\n - [Spatial](struct.Spatial.html)\n - [Node](struct.Node.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct VisualInstance { this : RawObject < Self > , } impl VisualInstance { # [doc = "Returns the [AABB] (also known as the bounding box) for this [VisualInstance]. See also [method get_transformed_aabb]."] # [doc = ""] # [inline] pub fn get_aabb (& self) -> Aabb { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualInstanceMethodTable :: get (get_api ()) . get_aabb ; let ret = crate :: icalls :: icallptr_aabb (method_bind , self . this . sys () . as_ptr ()) ; mem :: transmute (ret) } } # [doc = "Returns the RID of the resource associated with this [VisualInstance]. For example, if the Node is a [MeshInstance], this will return the RID of the associated [Mesh]."] # [doc = ""] # [inline] pub fn get_base (& self) -> Rid { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualInstanceMethodTable :: get (get_api ()) . get_base ; let ret = crate :: icalls :: icallptr_rid (method_bind , self . this . sys () . as_ptr ()) ; Rid :: from_sys (ret) } } # [doc = "Returns the RID of this instance. This RID is the same as the RID returned by [method VisualServer.instance_create]. This RID is needed if you want to call [VisualServer] functions directly on this [VisualInstance]."] # [doc = ""] # [inline] pub fn get_instance (& self) -> Rid { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualInstanceMethodTable :: get (get_api ()) . get_instance ; let ret = crate :: icalls :: icallptr_rid (method_bind , self . this . sys () . as_ptr ()) ; Rid :: from_sys (ret) } } # [doc = "The render layer(s) this [VisualInstance] is drawn on.\nThis object will only be visible for [Camera]s whose cull mask includes the render object this [VisualInstance] is set to."] # [doc = ""] # [inline] pub fn layer_mask (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualInstanceMethodTable :: get (get_api ()) . get_layer_mask ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Returns `true` when the specified layer is enabled in [member layers] and `false` otherwise."] # [doc = ""] # [inline] pub fn get_layer_mask_bit (& self , layer : i64) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualInstanceMethodTable :: get (get_api ()) . get_layer_mask_bit ; let ret = crate :: icalls :: icallptr_bool_i64 (method_bind , self . this . sys () . as_ptr () , layer) ; ret as _ } } # [doc = "Returns the transformed [AABB] (also known as the bounding box) for this [VisualInstance].\nTransformed in this case means the [AABB] plus the position, rotation, and scale of the [Spatial]'s [Transform]. See also [method get_aabb]."] # [doc = ""] # [inline] pub fn get_transformed_aabb (& self) -> Aabb { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualInstanceMethodTable :: get (get_api ()) . get_transformed_aabb ; let ret = crate :: icalls :: icallptr_aabb (method_bind , self . this . sys () . as_ptr ()) ; mem :: transmute (ret) } } # [doc = "Sets the resource that is instantiated by this [VisualInstance], which changes how the engine handles the [VisualInstance] under the hood. Equivalent to [method VisualServer.instance_set_base]."] # [doc = ""] # [inline] pub fn set_base (& self , base : Rid) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualInstanceMethodTable :: get (get_api ()) . set_base ; let ret = crate :: icalls :: icallptr_void_rid (method_bind , self . this . sys () . as_ptr () , base) ; } } # [doc = "The render layer(s) this [VisualInstance] is drawn on.\nThis object will only be visible for [Camera]s whose cull mask includes the render object this [VisualInstance] is set to."] # [doc = ""] # [inline] pub fn set_layer_mask (& self , mask : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualInstanceMethodTable :: get (get_api ()) . set_layer_mask ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , mask) ; } } # [doc = "Enables a particular layer in [member layers]."] # [doc = ""] # [inline] pub fn set_layer_mask_bit (& self , layer : i64 , enabled : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualInstanceMethodTable :: get (get_api ()) . set_layer_mask_bit ; let ret = crate :: icalls :: icallptr_void_i64_bool (method_bind , self . this . sys () . as_ptr () , layer , enabled) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for VisualInstance { } unsafe impl GodotObject for VisualInstance { type RefKind = ref_kind :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "VisualInstance" } } impl QueueFree for VisualInstance { # [inline] unsafe fn godot_queue_free (obj : * mut sys :: godot_object) { let method_bind : * mut sys :: godot_method_bind = crate :: generated :: node :: NodeMethodTable :: get (get_api ()) . queue_free ; crate :: icalls :: icallptr_void (method_bind , obj) } } impl std :: ops :: Deref for VisualInstance { type Target = crate :: generated :: spatial :: Spatial ; # [inline] fn deref (& self) -> & crate :: generated :: spatial :: Spatial { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for VisualInstance { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: spatial :: Spatial { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: spatial :: Spatial > for VisualInstance { } unsafe impl SubClass < crate :: generated :: node :: Node > for VisualInstance { } unsafe impl SubClass < crate :: generated :: object :: Object > for VisualInstance { } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct VisualInstanceMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_aabb : * mut sys :: godot_method_bind , pub get_base : * mut sys :: godot_method_bind , pub get_instance : * mut sys :: godot_method_bind , pub get_layer_mask : * mut sys :: godot_method_bind , pub get_layer_mask_bit : * mut sys :: godot_method_bind , pub get_transformed_aabb : * mut sys :: godot_method_bind , pub set_base : * mut sys :: godot_method_bind , pub set_layer_mask : * mut sys :: godot_method_bind , pub set_layer_mask_bit : * mut sys :: godot_method_bind } impl VisualInstanceMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : VisualInstanceMethodTable = VisualInstanceMethodTable { class_constructor : None , get_aabb : 0 as * mut sys :: godot_method_bind , get_base : 0 as * mut sys :: godot_method_bind , get_instance : 0 as * mut sys :: godot_method_bind , get_layer_mask : 0 as * mut sys :: godot_method_bind , get_layer_mask_bit : 0 as * mut sys :: godot_method_bind , get_transformed_aabb : 0 as * mut sys :: godot_method_bind , set_base : 0 as * mut sys :: godot_method_bind , set_layer_mask : 0 as * mut sys :: godot_method_bind , set_layer_mask_bit : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { VisualInstanceMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "VisualInstance\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_aabb = (gd_api . godot_method_bind_get_method) (class_name , "get_aabb\0" . as_ptr () as * const c_char) ; table . get_base = (gd_api . godot_method_bind_get_method) (class_name , "get_base\0" . as_ptr () as * const c_char) ; table . get_instance = (gd_api . godot_method_bind_get_method) (class_name , "get_instance\0" . as_ptr () as * const c_char) ; table . get_layer_mask = (gd_api . godot_method_bind_get_method) (class_name , "get_layer_mask\0" . as_ptr () as * const c_char) ; table . get_layer_mask_bit = (gd_api . godot_method_bind_get_method) (class_name , "get_layer_mask_bit\0" . as_ptr () as * const c_char) ; table . get_transformed_aabb = (gd_api . godot_method_bind_get_method) (class_name , "get_transformed_aabb\0" . as_ptr () as * const c_char) ; table . set_base = (gd_api . godot_method_bind_get_method) (class_name , "set_base\0" . as_ptr () as * const c_char) ; table . set_layer_mask = (gd_api . godot_method_bind_get_method) (class_name , "set_layer_mask\0" . as_ptr () as * const c_char) ; table . set_layer_mask_bit = (gd_api . godot_method_bind_get_method) (class_name , "set_layer_mask_bit\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:82:27512 [INFO] [stdout] | [INFO] [stdout] 82 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 82 | # [doc = "`tools class EditorPlugin` inherits `Node` (unsafe)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_editorplugin.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = ""] # [doc = "\n## Class hierarchy\n\nEditorPlugin inherits methods from:\n - [Node](struct.Node.html)\n - [Object](struct.Object.html)\n"] # [doc = "\n## Tool\n\nThis class is used to interact with Godot's editor."] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct EditorPlugin { this : RawObject < Self > , } # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct CustomControlContainer (pub i64) ; impl CustomControlContainer { pub const TOOLBAR : CustomControlContainer = CustomControlContainer (0i64) ; pub const SPATIAL_EDITOR_MENU : CustomControlContainer = CustomControlContainer (1i64) ; pub const SPATIAL_EDITOR_SIDE_LEFT : CustomControlContainer = CustomControlContainer (2i64) ; pub const SPATIAL_EDITOR_SIDE_RIGHT : CustomControlContainer = CustomControlContainer (3i64) ; pub const SPATIAL_EDITOR_BOTTOM : CustomControlContainer = CustomControlContainer (4i64) ; pub const CANVAS_EDITOR_MENU : CustomControlContainer = CustomControlContainer (5i64) ; pub const CANVAS_EDITOR_SIDE_LEFT : CustomControlContainer = CustomControlContainer (6i64) ; pub const CANVAS_EDITOR_SIDE_RIGHT : CustomControlContainer = CustomControlContainer (7i64) ; pub const CANVAS_EDITOR_BOTTOM : CustomControlContainer = CustomControlContainer (8i64) ; pub const PROPERTY_EDITOR_BOTTOM : CustomControlContainer = CustomControlContainer (9i64) ; pub const PROJECT_SETTING_TAB_LEFT : CustomControlContainer = CustomControlContainer (10i64) ; pub const PROJECT_SETTING_TAB_RIGHT : CustomControlContainer = CustomControlContainer (11i64) ; } impl From < i64 > for CustomControlContainer { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < CustomControlContainer > for i64 { # [inline] fn from (v : CustomControlContainer) -> Self { v . 0 } } # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct DockSlot (pub i64) ; impl DockSlot { pub const LEFT_UL : DockSlot = DockSlot (0i64) ; pub const LEFT_BL : DockSlot = DockSlot (1i64) ; pub const LEFT_UR : DockSlot = DockSlot (2i64) ; pub const LEFT_BR : DockSlot = DockSlot (3i64) ; pub const RIGHT_UL : DockSlot = DockSlot (4i64) ; pub const RIGHT_BL : DockSlot = DockSlot (5i64) ; pub const RIGHT_UR : DockSlot = DockSlot (6i64) ; pub const RIGHT_BR : DockSlot = DockSlot (7i64) ; pub const MAX : DockSlot = DockSlot (8i64) ; } impl From < i64 > for DockSlot { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < DockSlot > for i64 { # [inline] fn from (v : DockSlot) -> Self { v . 0 } } # [doc = "Constants"] # [allow (non_upper_case_globals)] impl EditorPlugin { pub const CONTAINER_CANVAS_EDITOR_BOTTOM : i64 = 8i64 ; pub const CONTAINER_CANVAS_EDITOR_MENU : i64 = 5i64 ; pub const CONTAINER_CANVAS_EDITOR_SIDE_LEFT : i64 = 6i64 ; pub const CONTAINER_CANVAS_EDITOR_SIDE_RIGHT : i64 = 7i64 ; pub const CONTAINER_PROJECT_SETTING_TAB_LEFT : i64 = 10i64 ; pub const CONTAINER_PROJECT_SETTING_TAB_RIGHT : i64 = 11i64 ; pub const CONTAINER_PROPERTY_EDITOR_BOTTOM : i64 = 9i64 ; pub const CONTAINER_SPATIAL_EDITOR_BOTTOM : i64 = 4i64 ; pub const CONTAINER_SPATIAL_EDITOR_MENU : i64 = 1i64 ; pub const CONTAINER_SPATIAL_EDITOR_SIDE_LEFT : i64 = 2i64 ; pub const CONTAINER_SPATIAL_EDITOR_SIDE_RIGHT : i64 = 3i64 ; pub const CONTAINER_TOOLBAR : i64 = 0i64 ; pub const DOCK_SLOT_LEFT_BL : i64 = 1i64 ; pub const DOCK_SLOT_LEFT_BR : i64 = 3i64 ; pub const DOCK_SLOT_LEFT_UL : i64 = 0i64 ; pub const DOCK_SLOT_LEFT_UR : i64 = 2i64 ; pub const DOCK_SLOT_MAX : i64 = 8i64 ; pub const DOCK_SLOT_RIGHT_BL : i64 = 5i64 ; pub const DOCK_SLOT_RIGHT_BR : i64 = 7i64 ; pub const DOCK_SLOT_RIGHT_UL : i64 = 4i64 ; pub const DOCK_SLOT_RIGHT_UR : i64 = 6i64 ; } impl EditorPlugin { # [doc = "Adds a script at `path` to the Autoload list as `name`."] # [doc = ""] # [inline] pub fn add_autoload_singleton (& self , name : impl Into < GodotString > , path : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorPluginMethodTable :: get (get_api ()) . add_autoload_singleton ; let ret = crate :: icalls :: icallptr_void_str_str (method_bind , self . this . sys () . as_ptr () , name . into () , path . into ()) ; } } # [doc = "Adds a control to the bottom panel (together with Output, Debug, Animation, etc). Returns a reference to the button added. It's up to you to hide/show the button when needed. When your plugin is deactivated, make sure to remove your custom control with [method remove_control_from_bottom_panel] and free it with [method Node.queue_free]."] # [doc = ""] # [inline] pub fn add_control_to_bottom_panel (& self , control : impl AsArg < crate :: generated :: control :: Control > , title : impl Into < GodotString >) -> Option < Ref < crate :: generated :: tool_button :: ToolButton , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorPluginMethodTable :: get (get_api ()) . add_control_to_bottom_panel ; let ret = crate :: icalls :: icallptr_obj_obj_str (method_bind , self . this . sys () . as_ptr () , control . as_arg_ptr () , title . into ()) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: tool_button :: ToolButton , thread_access :: Shared >> :: move_from_sys (sys)) } } # [doc = "Adds a custom control to a container (see [enum CustomControlContainer]). There are many locations where custom controls can be added in the editor UI.\nPlease remember that you have to manage the visibility of your custom controls yourself (and likely hide it after adding it).\nWhen your plugin is deactivated, make sure to remove your custom control with [method remove_control_from_container] and free it with [method Node.queue_free]."] # [doc = ""] # [inline] pub fn add_control_to_container (& self , container : i64 , control : impl AsArg < crate :: generated :: control :: Control >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorPluginMethodTable :: get (get_api ()) . add_control_to_container ; let ret = crate :: icalls :: icallptr_void_i64_obj (method_bind , self . this . sys () . as_ptr () , container , control . as_arg_ptr ()) ; } } # [doc = "Adds the control to a specific dock slot (see [enum DockSlot] for options).\nIf the dock is repositioned and as long as the plugin is active, the editor will save the dock position on further sessions.\nWhen your plugin is deactivated, make sure to remove your custom control with [method remove_control_from_docks] and free it with [method Node.queue_free]."] # [doc = ""] # [inline] pub fn add_control_to_dock (& self , slot : i64 , control : impl AsArg < crate :: generated :: control :: Control >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorPluginMethodTable :: get (get_api ()) . add_control_to_dock ; let ret = crate :: icalls :: icallptr_void_i64_obj (method_bind , self . this . sys () . as_ptr () , slot , control . as_arg_ptr ()) ; } } # [doc = "Adds a custom type, which will appear in the list of nodes or resources. An icon can be optionally passed.\nWhen given node or resource is selected, the base type will be instanced (ie, \"Spatial\", \"Control\", \"Resource\"), then the script will be loaded and set to this object.\nYou can use the virtual method [method handles] to check if your custom object is being edited by checking the script or using the `is` keyword.\nDuring run-time, this will be a simple object with a script so this function does not need to be called then."] # [doc = ""] # [inline] pub fn add_custom_type (& self , _type : impl Into < GodotString > , base : impl Into < GodotString > , script : impl AsArg < crate :: generated :: script :: Script > , icon : impl AsArg < crate :: generated :: texture :: Texture >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorPluginMethodTable :: get (get_api ()) . add_custom_type ; let ret = crate :: icalls :: icallptr_void_str_str_obj_obj (method_bind , self . this . sys () . as_ptr () , _type . into () , base . into () , script . as_arg_ptr () , icon . as_arg_ptr ()) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn add_export_plugin (& self , plugin : impl AsArg < crate :: generated :: editor_export_plugin :: EditorExportPlugin >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorPluginMethodTable :: get (get_api ()) . add_export_plugin ; let ret = crate :: icalls :: icallptr_void_obj (method_bind , self . this . sys () . as_ptr () , plugin . as_arg_ptr ()) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn add_import_plugin (& self , importer : impl AsArg < crate :: generated :: editor_import_plugin :: EditorImportPlugin >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorPluginMethodTable :: get (get_api ()) . add_import_plugin ; let ret = crate :: icalls :: icallptr_void_obj (method_bind , self . this . sys () . as_ptr () , importer . as_arg_ptr ()) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn add_inspector_plugin (& self , plugin : impl AsArg < crate :: generated :: editor_inspector_plugin :: EditorInspectorPlugin >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorPluginMethodTable :: get (get_api ()) . add_inspector_plugin ; let ret = crate :: icalls :: icallptr_void_obj (method_bind , self . this . sys () . as_ptr () , plugin . as_arg_ptr ()) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn add_scene_import_plugin (& self , scene_importer : impl AsArg < crate :: generated :: editor_scene_importer :: EditorSceneImporter >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorPluginMethodTable :: get (get_api ()) . add_scene_import_plugin ; let ret = crate :: icalls :: icallptr_void_obj (method_bind , self . this . sys () . as_ptr () , scene_importer . as_arg_ptr ()) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn add_spatial_gizmo_plugin (& self , plugin : impl AsArg < crate :: generated :: editor_spatial_gizmo_plugin :: EditorSpatialGizmoPlugin >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorPluginMethodTable :: get (get_api ()) . add_spatial_gizmo_plugin ; let ret = crate :: icalls :: icallptr_void_obj (method_bind , self . this . sys () . as_ptr () , plugin . as_arg_ptr ()) ; } } # [doc = "Adds a custom menu item to **Project > Tools** as `name` that calls `callback` on an instance of `handler` with a parameter `ud` when user activates it.\n# Default Arguments\n* `ud` - `null`"] # [doc = ""] # [inline] pub fn add_tool_menu_item (& self , name : impl Into < GodotString > , handler : impl AsArg < crate :: generated :: object :: Object > , callback : impl Into < GodotString > , ud : impl OwnedToVariant) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorPluginMethodTable :: get (get_api ()) . add_tool_menu_item ; let ret = crate :: icalls :: icallptr_void_str_obj_str_var (method_bind , self . this . sys () . as_ptr () , name . into () , handler . as_arg_ptr () , callback . into () , ud . owned_to_variant ()) ; } } # [doc = "Adds a custom submenu under **Project > Tools >** `name`. `submenu` should be an object of class [PopupMenu]. This submenu should be cleaned up using `remove_tool_menu_item(name)`."] # [doc = ""] # [inline] pub fn add_tool_submenu_item (& self , name : impl Into < GodotString > , submenu : impl AsArg < crate :: generated :: object :: Object >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorPluginMethodTable :: get (get_api ()) . add_tool_submenu_item ; let ret = crate :: icalls :: icallptr_void_str_obj (method_bind , self . this . sys () . as_ptr () , name . into () , submenu . as_arg_ptr ()) ; } } # [doc = "Returns the [EditorInterface] object that gives you control over Godot editor's window and its functionalities."] # [doc = ""] # [inline] pub fn get_editor_interface (& self) -> Option < Ref < crate :: generated :: editor_interface :: EditorInterface , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorPluginMethodTable :: get (get_api ()) . get_editor_interface ; let ret = crate :: icalls :: icallptr_obj (method_bind , self . this . sys () . as_ptr ()) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: editor_interface :: EditorInterface , thread_access :: Shared >> :: move_from_sys (sys)) } } # [doc = "Gets the Editor's dialogue used for making scripts.\n**Note:** Users can configure it before use."] # [doc = ""] # [inline] pub fn get_script_create_dialog (& self) -> Option < Ref < crate :: generated :: script_create_dialog :: ScriptCreateDialog , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorPluginMethodTable :: get (get_api ()) . get_script_create_dialog ; let ret = crate :: icalls :: icallptr_obj (method_bind , self . this . sys () . as_ptr ()) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: script_create_dialog :: ScriptCreateDialog , thread_access :: Shared >> :: move_from_sys (sys)) } } # [doc = "Gets the undo/redo object. Most actions in the editor can be undoable, so use this object to make sure this happens when it's worth it."] # [doc = ""] # [inline] pub fn get_undo_redo (& self) -> Option < Ref < crate :: generated :: undo_redo :: UndoRedo , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorPluginMethodTable :: get (get_api ()) . get_undo_redo ; let ret = crate :: icalls :: icallptr_obj (method_bind , self . this . sys () . as_ptr ()) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: undo_redo :: UndoRedo , thread_access :: Shared >> :: move_from_sys (sys)) } } # [doc = ""] # [doc = ""] # [inline] pub fn hide_bottom_panel (& self) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorPluginMethodTable :: get (get_api ()) . hide_bottom_panel ; let ret = crate :: icalls :: icallptr_void (method_bind , self . this . sys () . as_ptr ()) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn make_bottom_panel_item_visible (& self , item : impl AsArg < crate :: generated :: control :: Control >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorPluginMethodTable :: get (get_api ()) . make_bottom_panel_item_visible ; let ret = crate :: icalls :: icallptr_void_obj (method_bind , self . this . sys () . as_ptr () , item . as_arg_ptr ()) ; } } # [doc = "Queue save the project's editor layout."] # [doc = ""] # [inline] pub fn queue_save_layout (& self) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorPluginMethodTable :: get (get_api ()) . queue_save_layout ; let ret = crate :: icalls :: icallptr_void (method_bind , self . this . sys () . as_ptr ()) ; } } # [doc = "Removes an Autoload `name` from the list."] # [doc = ""] # [inline] pub fn remove_autoload_singleton (& self , name : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorPluginMethodTable :: get (get_api ()) . remove_autoload_singleton ; let ret = crate :: icalls :: icallptr_void_str (method_bind , self . this . sys () . as_ptr () , name . into ()) ; } } # [doc = "Removes the control from the bottom panel. You have to manually [method Node.queue_free] the control."] # [doc = ""] # [inline] pub fn remove_control_from_bottom_panel (& self , control : impl AsArg < crate :: generated :: control :: Control >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorPluginMethodTable :: get (get_api ()) . remove_control_from_bottom_panel ; let ret = crate :: icalls :: icallptr_void_obj (method_bind , self . this . sys () . as_ptr () , control . as_arg_ptr ()) ; } } # [doc = "Removes the control from the specified container. You have to manually [method Node.queue_free] the control."] # [doc = ""] # [inline] pub fn remove_control_from_container (& self , container : i64 , control : impl AsArg < crate :: generated :: control :: Control >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorPluginMethodTable :: get (get_api ()) . remove_control_from_container ; let ret = crate :: icalls :: icallptr_void_i64_obj (method_bind , self . this . sys () . as_ptr () , container , control . as_arg_ptr ()) ; } } # [doc = "Removes the control from the dock. You have to manually [method Node.queue_free] the control."] # [doc = ""] # [inline] pub fn remove_control_from_docks (& self , control : impl AsArg < crate :: generated :: control :: Control >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorPluginMethodTable :: get (get_api ()) . remove_control_from_docks ; let ret = crate :: icalls :: icallptr_void_obj (method_bind , self . this . sys () . as_ptr () , control . as_arg_ptr ()) ; } } # [doc = "Removes a custom type added by [method add_custom_type]."] # [doc = ""] # [inline] pub fn remove_custom_type (& self , _type : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorPluginMethodTable :: get (get_api ()) . remove_custom_type ; let ret = crate :: icalls :: icallptr_void_str (method_bind , self . this . sys () . as_ptr () , _type . into ()) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn remove_export_plugin (& self , plugin : impl AsArg < crate :: generated :: editor_export_plugin :: EditorExportPlugin >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorPluginMethodTable :: get (get_api ()) . remove_export_plugin ; let ret = crate :: icalls :: icallptr_void_obj (method_bind , self . this . sys () . as_ptr () , plugin . as_arg_ptr ()) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn remove_import_plugin (& self , importer : impl AsArg < crate :: generated :: editor_import_plugin :: EditorImportPlugin >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorPluginMethodTable :: get (get_api ()) . remove_import_plugin ; let ret = crate :: icalls :: icallptr_void_obj (method_bind , self . this . sys () . as_ptr () , importer . as_arg_ptr ()) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn remove_inspector_plugin (& self , plugin : impl AsArg < crate :: generated :: editor_inspector_plugin :: EditorInspectorPlugin >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorPluginMethodTable :: get (get_api ()) . remove_inspector_plugin ; let ret = crate :: icalls :: icallptr_void_obj (method_bind , self . this . sys () . as_ptr () , plugin . as_arg_ptr ()) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn remove_scene_import_plugin (& self , scene_importer : impl AsArg < crate :: generated :: editor_scene_importer :: EditorSceneImporter >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorPluginMethodTable :: get (get_api ()) . remove_scene_import_plugin ; let ret = crate :: icalls :: icallptr_void_obj (method_bind , self . this . sys () . as_ptr () , scene_importer . as_arg_ptr ()) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn remove_spatial_gizmo_plugin (& self , plugin : impl AsArg < crate :: generated :: editor_spatial_gizmo_plugin :: EditorSpatialGizmoPlugin >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorPluginMethodTable :: get (get_api ()) . remove_spatial_gizmo_plugin ; let ret = crate :: icalls :: icallptr_void_obj (method_bind , self . this . sys () . as_ptr () , plugin . as_arg_ptr ()) ; } } # [doc = "Removes a menu `name` from **Project > Tools**."] # [doc = ""] # [inline] pub fn remove_tool_menu_item (& self , name : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorPluginMethodTable :: get (get_api ()) . remove_tool_menu_item ; let ret = crate :: icalls :: icallptr_void_str (method_bind , self . this . sys () . as_ptr () , name . into ()) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn set_force_draw_over_forwarding_enabled (& self) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorPluginMethodTable :: get (get_api ()) . set_force_draw_over_forwarding_enabled ; let ret = crate :: icalls :: icallptr_void (method_bind , self . this . sys () . as_ptr ()) ; } } # [doc = "Use this method if you always want to receive inputs from 3D view screen inside [method forward_spatial_gui_input]. It might be especially usable if your plugin will want to use raycast in the scene."] # [doc = ""] # [inline] pub fn set_input_event_forwarding_always_enabled (& self) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorPluginMethodTable :: get (get_api ()) . set_input_event_forwarding_always_enabled ; let ret = crate :: icalls :: icallptr_void (method_bind , self . this . sys () . as_ptr ()) ; } } # [doc = "Updates the overlays of the editor (2D/3D) viewport."] # [doc = ""] # [inline] pub fn update_overlays (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorPluginMethodTable :: get (get_api ()) . update_overlays ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } } impl gdnative_core :: private :: godot_object :: Sealed for EditorPlugin { } unsafe impl GodotObject for EditorPlugin { type RefKind = ref_kind :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "EditorPlugin" } } impl QueueFree for EditorPlugin { # [inline] unsafe fn godot_queue_free (obj : * mut sys :: godot_object) { let method_bind : * mut sys :: godot_method_bind = crate :: generated :: node :: NodeMethodTable :: get (get_api ()) . queue_free ; crate :: icalls :: icallptr_void (method_bind , obj) } } impl std :: ops :: Deref for EditorPlugin { type Target = crate :: generated :: node :: Node ; # [inline] fn deref (& self) -> & crate :: generated :: node :: Node { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for EditorPlugin { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: node :: Node { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: node :: Node > for EditorPlugin { } unsafe impl SubClass < crate :: generated :: object :: Object > for EditorPlugin { } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct EditorPluginMethodTable { pub class_constructor : sys :: godot_class_constructor , pub add_autoload_singleton : * mut sys :: godot_method_bind , pub add_control_to_bottom_panel : * mut sys :: godot_method_bind , pub add_control_to_container : * mut sys :: godot_method_bind , pub add_control_to_dock : * mut sys :: godot_method_bind , pub add_custom_type : * mut sys :: godot_method_bind , pub add_export_plugin : * mut sys :: godot_method_bind , pub add_import_plugin : * mut sys :: godot_method_bind , pub add_inspector_plugin : * mut sys :: godot_method_bind , pub add_scene_import_plugin : * mut sys :: godot_method_bind , pub add_spatial_gizmo_plugin : * mut sys :: godot_method_bind , pub add_tool_menu_item : * mut sys :: godot_method_bind , pub add_tool_submenu_item : * mut sys :: godot_method_bind , pub get_editor_interface : * mut sys :: godot_method_bind , pub get_script_create_dialog : * mut sys :: godot_method_bind , pub get_undo_redo : * mut sys :: godot_method_bind , pub hide_bottom_panel : * mut sys :: godot_method_bind , pub make_bottom_panel_item_visible : * mut sys :: godot_method_bind , pub queue_save_layout : * mut sys :: godot_method_bind , pub remove_autoload_singleton : * mut sys :: godot_method_bind , pub remove_control_from_bottom_panel : * mut sys :: godot_method_bind , pub remove_control_from_container : * mut sys :: godot_method_bind , pub remove_control_from_docks : * mut sys :: godot_method_bind , pub remove_custom_type : * mut sys :: godot_method_bind , pub remove_export_plugin : * mut sys :: godot_method_bind , pub remove_import_plugin : * mut sys :: godot_method_bind , pub remove_inspector_plugin : * mut sys :: godot_method_bind , pub remove_scene_import_plugin : * mut sys :: godot_method_bind , pub remove_spatial_gizmo_plugin : * mut sys :: godot_method_bind , pub remove_tool_menu_item : * mut sys :: godot_method_bind , pub set_force_draw_over_forwarding_enabled : * mut sys :: godot_method_bind , pub set_input_event_forwarding_always_enabled : * mut sys :: godot_method_bind , pub update_overlays : * mut sys :: godot_method_bind } impl EditorPluginMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : EditorPluginMethodTable = EditorPluginMethodTable { class_constructor : None , add_autoload_singleton : 0 as * mut sys :: godot_method_bind , add_control_to_bottom_panel : 0 as * mut sys :: godot_method_bind , add_control_to_container : 0 as * mut sys :: godot_method_bind , add_control_to_dock : 0 as * mut sys :: godot_method_bind , add_custom_type : 0 as * mut sys :: godot_method_bind , add_export_plugin : 0 as * mut sys :: godot_method_bind , add_import_plugin : 0 as * mut sys :: godot_method_bind , add_inspector_plugin : 0 as * mut sys :: godot_method_bind , add_scene_import_plugin : 0 as * mut sys :: godot_method_bind , add_spatial_gizmo_plugin : 0 as * mut sys :: godot_method_bind , add_tool_menu_item : 0 as * mut sys :: godot_method_bind , add_tool_submenu_item : 0 as * mut sys :: godot_method_bind , get_editor_interface : 0 as * mut sys :: godot_method_bind , get_script_create_dialog : 0 as * mut sys :: godot_method_bind , get_undo_redo : 0 as * mut sys :: godot_method_bind , hide_bottom_panel : 0 as * mut sys :: godot_method_bind , make_bottom_panel_item_visible : 0 as * mut sys :: godot_method_bind , queue_save_layout : 0 as * mut sys :: godot_method_bind , remove_autoload_singleton : 0 as * mut sys :: godot_method_bind , remove_control_from_bottom_panel : 0 as * mut sys :: godot_method_bind , remove_control_from_container : 0 as * mut sys :: godot_method_bind , remove_control_from_docks : 0 as * mut sys :: godot_method_bind , remove_custom_type : 0 as * mut sys :: godot_method_bind , remove_export_plugin : 0 as * mut sys :: godot_method_bind , remove_import_plugin : 0 as * mut sys :: godot_method_bind , remove_inspector_plugin : 0 as * mut sys :: godot_method_bind , remove_scene_import_plugin : 0 as * mut sys :: godot_method_bind , remove_spatial_gizmo_plugin : 0 as * mut sys :: godot_method_bind , remove_tool_menu_item : 0 as * mut sys :: godot_method_bind , set_force_draw_over_forwarding_enabled : 0 as * mut sys :: godot_method_bind , set_input_event_forwarding_always_enabled : 0 as * mut sys :: godot_method_bind , update_overlays : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { EditorPluginMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "EditorPlugin\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . add_autoload_singleton = (gd_api . godot_method_bind_get_method) (class_name , "add_autoload_singleton\0" . as_ptr () as * const c_char) ; table . add_control_to_bottom_panel = (gd_api . godot_method_bind_get_method) (class_name , "add_control_to_bottom_panel\0" . as_ptr () as * const c_char) ; table . add_control_to_container = (gd_api . godot_method_bind_get_method) (class_name , "add_control_to_container\0" . as_ptr () as * const c_char) ; table . add_control_to_dock = (gd_api . godot_method_bind_get_method) (class_name , "add_control_to_dock\0" . as_ptr () as * const c_char) ; table . add_custom_type = (gd_api . godot_method_bind_get_method) (class_name , "add_custom_type\0" . as_ptr () as * const c_char) ; table . add_export_plugin = (gd_api . godot_method_bind_get_method) (class_name , "add_export_plugin\0" . as_ptr () as * const c_char) ; table . add_import_plugin = (gd_api . godot_method_bind_get_method) (class_name , "add_import_plugin\0" . as_ptr () as * const c_char) ; table . add_inspector_plugin = (gd_api . godot_method_bind_get_method) (class_name , "add_inspector_plugin\0" . as_ptr () as * const c_char) ; table . add_scene_import_plugin = (gd_api . godot_method_bind_get_method) (class_name , "add_scene_import_plugin\0" . as_ptr () as * const c_char) ; table . add_spatial_gizmo_plugin = (gd_api . godot_method_bind_get_method) (class_name , "add_spatial_gizmo_plugin\0" . as_ptr () as * const c_char) ; table . add_tool_menu_item = (gd_api . godot_method_bind_get_method) (class_name , "add_tool_menu_item\0" . as_ptr () as * const c_char) ; table . add_tool_submenu_item = (gd_api . godot_method_bind_get_method) (class_name , "add_tool_submenu_item\0" . as_ptr () as * const c_char) ; table . get_editor_interface = (gd_api . godot_method_bind_get_method) (class_name , "get_editor_interface\0" . as_ptr () as * const c_char) ; table . get_script_create_dialog = (gd_api . godot_method_bind_get_method) (class_name , "get_script_create_dialog\0" . as_ptr () as * const c_char) ; table . get_undo_redo = (gd_api . godot_method_bind_get_method) (class_name , "get_undo_redo\0" . as_ptr () as * const c_char) ; table . hide_bottom_panel = (gd_api . godot_method_bind_get_method) (class_name , "hide_bottom_panel\0" . as_ptr () as * const c_char) ; table . make_bottom_panel_item_visible = (gd_api . godot_method_bind_get_method) (class_name , "make_bottom_panel_item_visible\0" . as_ptr () as * const c_char) ; table . queue_save_layout = (gd_api . godot_method_bind_get_method) (class_name , "queue_save_layout\0" . as_ptr () as * const c_char) ; table . remove_autoload_singleton = (gd_api . godot_method_bind_get_method) (class_name , "remove_autoload_singleton\0" . as_ptr () as * const c_char) ; table . remove_control_from_bottom_panel = (gd_api . godot_method_bind_get_method) (class_name , "remove_control_from_bottom_panel\0" . as_ptr () as * const c_char) ; table . remove_control_from_container = (gd_api . godot_method_bind_get_method) (class_name , "remove_control_from_container\0" . as_ptr () as * const c_char) ; table . remove_control_from_docks = (gd_api . godot_method_bind_get_method) (class_name , "remove_control_from_docks\0" . as_ptr () as * const c_char) ; table . remove_custom_type = (gd_api . godot_method_bind_get_method) (class_name , "remove_custom_type\0" . as_ptr () as * const c_char) ; table . remove_export_plugin = (gd_api . godot_method_bind_get_method) (class_name , "remove_export_plugin\0" . as_ptr () as * const c_char) ; table . remove_import_plugin = (gd_api . godot_method_bind_get_method) (class_name , "remove_import_plugin\0" . as_ptr () as * const c_char) ; table . remove_inspector_plugin = (gd_api . godot_method_bind_get_method) (class_name , "remove_inspector_plugin\0" . as_ptr () as * const c_char) ; table . remove_scene_import_plugin = (gd_api . godot_method_bind_get_method) (class_name , "remove_scene_import_plugin\0" . as_ptr () as * const c_char) ; table . remove_spatial_gizmo_plugin = (gd_api . godot_method_bind_get_method) (class_name , "remove_spatial_gizmo_plugin\0" . as_ptr () as * const c_char) ; table . remove_tool_menu_item = (gd_api . godot_method_bind_get_method) (class_name , "remove_tool_menu_item\0" . as_ptr () as * const c_char) ; table . set_force_draw_over_forwarding_enabled = (gd_api . godot_method_bind_get_method) (class_name , "set_force_draw_over_forwarding_enabled\0" . as_ptr () as * const c_char) ; table . set_input_event_forwarding_always_enabled = (gd_api . godot_method_bind_get_method) (class_name , "set_input_event_forwarding_always_enabled\0" . as_ptr () as * const c_char) ; table . update_overlays = (gd_api . godot_method_bind_get_method) (class_name , "update_overlays\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:88:7780 [INFO] [stdout] | [INFO] [stdout] 88 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 88 | # [doc = "`core class VisualShaderNodeTextureUniform` inherits `VisualShaderNodeUniform` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_visualshadernodetextureuniform.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nVisualShaderNodeTextureUniform inherits methods from:\n - [VisualShaderNodeUniform](struct.VisualShaderNodeUniform.html)\n - [VisualShaderNode](struct.VisualShaderNode.html)\n - [Resource](struct.Resource.html)\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct VisualShaderNodeTextureUniform { this : RawObject < Self > , } # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct ColorDefault (pub i64) ; impl ColorDefault { pub const WHITE : ColorDefault = ColorDefault (0i64) ; pub const BLACK : ColorDefault = ColorDefault (1i64) ; } impl From < i64 > for ColorDefault { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < ColorDefault > for i64 { # [inline] fn from (v : ColorDefault) -> Self { v . 0 } } # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct TextureType (pub i64) ; impl TextureType { pub const DATA : TextureType = TextureType (0i64) ; pub const COLOR : TextureType = TextureType (1i64) ; pub const NORMALMAP : TextureType = TextureType (2i64) ; pub const ANISO : TextureType = TextureType (3i64) ; } impl From < i64 > for TextureType { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < TextureType > for i64 { # [inline] fn from (v : TextureType) -> Self { v . 0 } } # [doc = "Constants"] # [allow (non_upper_case_globals)] impl VisualShaderNodeTextureUniform { pub const COLOR_DEFAULT_BLACK : i64 = 1i64 ; pub const COLOR_DEFAULT_WHITE : i64 = 0i64 ; pub const TYPE_ANISO : i64 = 3i64 ; pub const TYPE_COLOR : i64 = 1i64 ; pub const TYPE_DATA : i64 = 0i64 ; pub const TYPE_NORMALMAP : i64 = 2i64 ; } impl VisualShaderNodeTextureUniform { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = VisualShaderNodeTextureUniformMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "Sets the default color if no texture is assigned to the uniform."] # [doc = ""] # [inline] pub fn color_default (& self) -> crate :: generated :: visual_shader_node_texture_uniform :: ColorDefault { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualShaderNodeTextureUniformMethodTable :: get (get_api ()) . get_color_default ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; crate :: generated :: visual_shader_node_texture_uniform :: ColorDefault (ret) } } # [doc = "Defines the type of data provided by the source texture. See [enum TextureType] for options."] # [doc = ""] # [inline] pub fn texture_type (& self) -> crate :: generated :: visual_shader_node_texture_uniform :: TextureType { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualShaderNodeTextureUniformMethodTable :: get (get_api ()) . get_texture_type ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; crate :: generated :: visual_shader_node_texture_uniform :: TextureType (ret) } } # [doc = "Sets the default color if no texture is assigned to the uniform."] # [doc = ""] # [inline] pub fn set_color_default (& self , _type : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualShaderNodeTextureUniformMethodTable :: get (get_api ()) . set_color_default ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , _type) ; } } # [doc = "Defines the type of data provided by the source texture. See [enum TextureType] for options."] # [doc = ""] # [inline] pub fn set_texture_type (& self , _type : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualShaderNodeTextureUniformMethodTable :: get (get_api ()) . set_texture_type ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , _type) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for VisualShaderNodeTextureUniform { } unsafe impl GodotObject for VisualShaderNodeTextureUniform { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "VisualShaderNodeTextureUniform" } } impl std :: ops :: Deref for VisualShaderNodeTextureUniform { type Target = crate :: generated :: visual_shader_node_uniform :: VisualShaderNodeUniform ; # [inline] fn deref (& self) -> & crate :: generated :: visual_shader_node_uniform :: VisualShaderNodeUniform { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for VisualShaderNodeTextureUniform { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: visual_shader_node_uniform :: VisualShaderNodeUniform { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: visual_shader_node_uniform :: VisualShaderNodeUniform > for VisualShaderNodeTextureUniform { } unsafe impl SubClass < crate :: generated :: visual_shader_node :: VisualShaderNode > for VisualShaderNodeTextureUniform { } unsafe impl SubClass < crate :: generated :: resource :: Resource > for VisualShaderNodeTextureUniform { } unsafe impl SubClass < crate :: generated :: reference :: Reference > for VisualShaderNodeTextureUniform { } unsafe impl SubClass < crate :: generated :: object :: Object > for VisualShaderNodeTextureUniform { } impl Instanciable for VisualShaderNodeTextureUniform { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { VisualShaderNodeTextureUniform :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct VisualShaderNodeTextureUniformMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_color_default : * mut sys :: godot_method_bind , pub get_texture_type : * mut sys :: godot_method_bind , pub set_color_default : * mut sys :: godot_method_bind , pub set_texture_type : * mut sys :: godot_method_bind } impl VisualShaderNodeTextureUniformMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : VisualShaderNodeTextureUniformMethodTable = VisualShaderNodeTextureUniformMethodTable { class_constructor : None , get_color_default : 0 as * mut sys :: godot_method_bind , get_texture_type : 0 as * mut sys :: godot_method_bind , set_color_default : 0 as * mut sys :: godot_method_bind , set_texture_type : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { VisualShaderNodeTextureUniformMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "VisualShaderNodeTextureUniform\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_color_default = (gd_api . godot_method_bind_get_method) (class_name , "get_color_default\0" . as_ptr () as * const c_char) ; table . get_texture_type = (gd_api . godot_method_bind_get_method) (class_name , "get_texture_type\0" . as_ptr () as * const c_char) ; table . set_color_default = (gd_api . godot_method_bind_get_method) (class_name , "set_color_default\0" . as_ptr () as * const c_char) ; table . set_texture_type = (gd_api . godot_method_bind_get_method) (class_name , "set_texture_type\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:94:6131 [INFO] [stdout] | [INFO] [stdout] 94 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 94 | # [doc = "`core class VisualShaderNodeVectorOp` inherits `VisualShaderNode` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_visualshadernodevectorop.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nVisualShaderNodeVectorOp inherits methods from:\n - [VisualShaderNode](struct.VisualShaderNode.html)\n - [Resource](struct.Resource.html)\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct VisualShaderNodeVectorOp { this : RawObject < Self > , } # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct Operator (pub i64) ; impl Operator { pub const ADD : Operator = Operator (0i64) ; pub const SUB : Operator = Operator (1i64) ; pub const MUL : Operator = Operator (2i64) ; pub const DIV : Operator = Operator (3i64) ; pub const MOD : Operator = Operator (4i64) ; pub const POW : Operator = Operator (5i64) ; pub const MAX : Operator = Operator (6i64) ; pub const MIN : Operator = Operator (7i64) ; pub const CROSS : Operator = Operator (8i64) ; pub const ATAN2 : Operator = Operator (9i64) ; pub const REFLECT : Operator = Operator (10i64) ; pub const STEP : Operator = Operator (11i64) ; } impl From < i64 > for Operator { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < Operator > for i64 { # [inline] fn from (v : Operator) -> Self { v . 0 } } # [doc = "Constants"] # [allow (non_upper_case_globals)] impl VisualShaderNodeVectorOp { pub const OP_ADD : i64 = 0i64 ; pub const OP_ATAN2 : i64 = 9i64 ; pub const OP_CROSS : i64 = 8i64 ; pub const OP_DIV : i64 = 3i64 ; pub const OP_MAX : i64 = 6i64 ; pub const OP_MIN : i64 = 7i64 ; pub const OP_MOD : i64 = 4i64 ; pub const OP_MUL : i64 = 2i64 ; pub const OP_POW : i64 = 5i64 ; pub const OP_REFLECT : i64 = 10i64 ; pub const OP_STEP : i64 = 11i64 ; pub const OP_SUB : i64 = 1i64 ; } impl VisualShaderNodeVectorOp { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = VisualShaderNodeVectorOpMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "The operator to be used. See [enum Operator] for options."] # [doc = ""] # [inline] pub fn operator (& self) -> crate :: generated :: visual_shader_node_vector_op :: Operator { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualShaderNodeVectorOpMethodTable :: get (get_api ()) . get_operator ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; crate :: generated :: visual_shader_node_vector_op :: Operator (ret) } } # [doc = "The operator to be used. See [enum Operator] for options."] # [doc = ""] # [inline] pub fn set_operator (& self , op : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualShaderNodeVectorOpMethodTable :: get (get_api ()) . set_operator ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , op) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for VisualShaderNodeVectorOp { } unsafe impl GodotObject for VisualShaderNodeVectorOp { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "VisualShaderNodeVectorOp" } } impl std :: ops :: Deref for VisualShaderNodeVectorOp { type Target = crate :: generated :: visual_shader_node :: VisualShaderNode ; # [inline] fn deref (& self) -> & crate :: generated :: visual_shader_node :: VisualShaderNode { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for VisualShaderNodeVectorOp { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: visual_shader_node :: VisualShaderNode { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: visual_shader_node :: VisualShaderNode > for VisualShaderNodeVectorOp { } unsafe impl SubClass < crate :: generated :: resource :: Resource > for VisualShaderNodeVectorOp { } unsafe impl SubClass < crate :: generated :: reference :: Reference > for VisualShaderNodeVectorOp { } unsafe impl SubClass < crate :: generated :: object :: Object > for VisualShaderNodeVectorOp { } impl Instanciable for VisualShaderNodeVectorOp { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { VisualShaderNodeVectorOp :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct VisualShaderNodeVectorOpMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_operator : * mut sys :: godot_method_bind , pub set_operator : * mut sys :: godot_method_bind } impl VisualShaderNodeVectorOpMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : VisualShaderNodeVectorOpMethodTable = VisualShaderNodeVectorOpMethodTable { class_constructor : None , get_operator : 0 as * mut sys :: godot_method_bind , set_operator : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { VisualShaderNodeVectorOpMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "VisualShaderNodeVectorOp\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_operator = (gd_api . godot_method_bind_get_method) (class_name , "get_operator\0" . as_ptr () as * const c_char) ; table . set_operator = (gd_api . godot_method_bind_get_method) (class_name , "set_operator\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:100:4015 [INFO] [stdout] | [INFO] [stdout] 100 | ...thodTable { class_constructor : None , } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 100 | # [doc = "`core class VisualShaderNodeVectorScalarSmoothStep` inherits `VisualShaderNode` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_visualshadernodevectorscalarsmoothstep.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nVisualShaderNodeVectorScalarSmoothStep inherits methods from:\n - [VisualShaderNode](struct.VisualShaderNode.html)\n - [Resource](struct.Resource.html)\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct VisualShaderNodeVectorScalarSmoothStep { this : RawObject < Self > , } impl VisualShaderNodeVectorScalarSmoothStep { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = VisualShaderNodeVectorScalarSmoothStepMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } } impl gdnative_core :: private :: godot_object :: Sealed for VisualShaderNodeVectorScalarSmoothStep { } unsafe impl GodotObject for VisualShaderNodeVectorScalarSmoothStep { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "VisualShaderNodeVectorScalarSmoothStep" } } impl std :: ops :: Deref for VisualShaderNodeVectorScalarSmoothStep { type Target = crate :: generated :: visual_shader_node :: VisualShaderNode ; # [inline] fn deref (& self) -> & crate :: generated :: visual_shader_node :: VisualShaderNode { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for VisualShaderNodeVectorScalarSmoothStep { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: visual_shader_node :: VisualShaderNode { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: visual_shader_node :: VisualShaderNode > for VisualShaderNodeVectorScalarSmoothStep { } unsafe impl SubClass < crate :: generated :: resource :: Resource > for VisualShaderNodeVectorScalarSmoothStep { } unsafe impl SubClass < crate :: generated :: reference :: Reference > for VisualShaderNodeVectorScalarSmoothStep { } unsafe impl SubClass < crate :: generated :: object :: Object > for VisualShaderNodeVectorScalarSmoothStep { } impl Instanciable for VisualShaderNodeVectorScalarSmoothStep { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { VisualShaderNodeVectorScalarSmoothStep :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct VisualShaderNodeVectorScalarSmoothStepMethodTable { pub class_constructor : sys :: godot_class_constructor , } impl VisualShaderNodeVectorScalarSmoothStepMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : VisualShaderNodeVectorScalarSmoothStepMethodTable = VisualShaderNodeVectorScalarSmoothStepMethodTable { class_constructor : None , } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { VisualShaderNodeVectorScalarSmoothStepMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "VisualShaderNodeVectorScalarSmoothStep\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:106:3393 [INFO] [stdout] | [INFO] [stdout] 106 | ...thodTable { class_constructor : None , } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 106 | # [doc = "`core class PacketPeerGDNative` inherits `PacketPeer` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_packetpeergdnative.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nPacketPeerGDNative inherits methods from:\n - [PacketPeer](struct.PacketPeer.html)\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct PacketPeerGDNative { this : RawObject < Self > , } impl PacketPeerGDNative { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = PacketPeerGDNativeMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } } impl gdnative_core :: private :: godot_object :: Sealed for PacketPeerGDNative { } unsafe impl GodotObject for PacketPeerGDNative { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "PacketPeerGDNative" } } impl std :: ops :: Deref for PacketPeerGDNative { type Target = crate :: generated :: packet_peer :: PacketPeer ; # [inline] fn deref (& self) -> & crate :: generated :: packet_peer :: PacketPeer { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for PacketPeerGDNative { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: packet_peer :: PacketPeer { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: packet_peer :: PacketPeer > for PacketPeerGDNative { } unsafe impl SubClass < crate :: generated :: reference :: Reference > for PacketPeerGDNative { } unsafe impl SubClass < crate :: generated :: object :: Object > for PacketPeerGDNative { } impl Instanciable for PacketPeerGDNative { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { PacketPeerGDNative :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct PacketPeerGDNativeMethodTable { pub class_constructor : sys :: godot_class_constructor , } impl PacketPeerGDNativeMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : PacketPeerGDNativeMethodTable = PacketPeerGDNativeMethodTable { class_constructor : None , } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { PacketPeerGDNativeMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "PacketPeerGDNative\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:112:11175 [INFO] [stdout] | [INFO] [stdout] 112 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 112 | # [doc = "`core class StaticBody2D` inherits `PhysicsBody2D` (unsafe)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_staticbody2d.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nNon reference counted objects such as the ones of this type are usually owned by the engine.\n\n`StaticBody2D` is a reference-only type. Persistent references can\nonly exist in the unsafe `Ref` form.\n\nIn the cases where Rust code owns an object of this type, for example if the object was just\ncreated on the Rust side and not passed to the engine yet, ownership should be either given\nto the engine or the object must be manually destroyed using `Ref::free`, or `Ref::queue_free`\nif it is a `Node`."] # [doc = "\n## Class hierarchy\n\nStaticBody2D inherits methods from:\n - [PhysicsBody2D](struct.PhysicsBody2D.html)\n - [CollisionObject2D](struct.CollisionObject2D.html)\n - [Node2D](struct.Node2D.html)\n - [CanvasItem](struct.CanvasItem.html)\n - [Node](struct.Node.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct StaticBody2D { this : RawObject < Self > , } impl StaticBody2D { # [doc = "Creates a new instance of this object.\n\nBecause this type is not reference counted, the lifetime of the returned object\nis *not* automatically managed.\n\nImmediately after creation, the object is owned by the caller, and can be\npassed to the engine (in which case the engine will be responsible for\ndestroying the object) or destroyed manually using `Ref::free`, or preferably\n`Ref::queue_free` if it is a `Node`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = StaticBody2DMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "The body's bounciness. Values range from `0` (no bounce) to `1` (full bounciness).\nDeprecated, use [member PhysicsMaterial.bounce] instead via [member physics_material_override]."] # [doc = ""] # [inline] pub fn bounce (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = StaticBody2DMethodTable :: get (get_api ()) . get_bounce ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "The body's constant angular velocity. This does not rotate the body, but affects colliding bodies, as if it were rotating."] # [doc = ""] # [inline] pub fn constant_angular_velocity (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = StaticBody2DMethodTable :: get (get_api ()) . get_constant_angular_velocity ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "The body's constant linear velocity. This does not move the body, but affects colliding bodies, as if it were moving."] # [doc = ""] # [inline] pub fn constant_linear_velocity (& self) -> Vector2 { unsafe { let method_bind : * mut sys :: godot_method_bind = StaticBody2DMethodTable :: get (get_api ()) . get_constant_linear_velocity ; let ret = crate :: icalls :: icallptr_vec2 (method_bind , self . this . sys () . as_ptr ()) ; mem :: transmute (ret) } } # [doc = "The body's friction. Values range from `0` (no friction) to `1` (full friction).\nDeprecated, use [member PhysicsMaterial.friction] instead via [member physics_material_override]."] # [doc = ""] # [inline] pub fn friction (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = StaticBody2DMethodTable :: get (get_api ()) . get_friction ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "The physics material override for the body.\nIf a material is assigned to this property, it will be used instead of any other physics material, such as an inherited one."] # [doc = ""] # [inline] pub fn physics_material_override (& self) -> Option < Ref < crate :: generated :: physics_material :: PhysicsMaterial , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = StaticBody2DMethodTable :: get (get_api ()) . get_physics_material_override ; let ret = crate :: icalls :: icallptr_obj (method_bind , self . this . sys () . as_ptr ()) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: physics_material :: PhysicsMaterial , thread_access :: Shared >> :: move_from_sys (sys)) } } # [doc = "The body's bounciness. Values range from `0` (no bounce) to `1` (full bounciness).\nDeprecated, use [member PhysicsMaterial.bounce] instead via [member physics_material_override]."] # [doc = ""] # [inline] pub fn set_bounce (& self , bounce : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = StaticBody2DMethodTable :: get (get_api ()) . set_bounce ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , bounce) ; } } # [doc = "The body's constant angular velocity. This does not rotate the body, but affects colliding bodies, as if it were rotating."] # [doc = ""] # [inline] pub fn set_constant_angular_velocity (& self , vel : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = StaticBody2DMethodTable :: get (get_api ()) . set_constant_angular_velocity ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , vel) ; } } # [doc = "The body's constant linear velocity. This does not move the body, but affects colliding bodies, as if it were moving."] # [doc = ""] # [inline] pub fn set_constant_linear_velocity (& self , vel : Vector2) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = StaticBody2DMethodTable :: get (get_api ()) . set_constant_linear_velocity ; let ret = crate :: icalls :: icallptr_void_vec2 (method_bind , self . this . sys () . as_ptr () , vel) ; } } # [doc = "The body's friction. Values range from `0` (no friction) to `1` (full friction).\nDeprecated, use [member PhysicsMaterial.friction] instead via [member physics_material_override]."] # [doc = ""] # [inline] pub fn set_friction (& self , friction : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = StaticBody2DMethodTable :: get (get_api ()) . set_friction ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , friction) ; } } # [doc = "The physics material override for the body.\nIf a material is assigned to this property, it will be used instead of any other physics material, such as an inherited one."] # [doc = ""] # [inline] pub fn set_physics_material_override (& self , physics_material_override : impl AsArg < crate :: generated :: physics_material :: PhysicsMaterial >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = StaticBody2DMethodTable :: get (get_api ()) . set_physics_material_override ; let ret = crate :: icalls :: icallptr_void_obj (method_bind , self . this . sys () . as_ptr () , physics_material_override . as_arg_ptr ()) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for StaticBody2D { } unsafe impl GodotObject for StaticBody2D { type RefKind = ref_kind :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "StaticBody2D" } } impl QueueFree for StaticBody2D { # [inline] unsafe fn godot_queue_free (obj : * mut sys :: godot_object) { let method_bind : * mut sys :: godot_method_bind = crate :: generated :: node :: NodeMethodTable :: get (get_api ()) . queue_free ; crate :: icalls :: icallptr_void (method_bind , obj) } } impl std :: ops :: Deref for StaticBody2D { type Target = crate :: generated :: physics_body_2d :: PhysicsBody2D ; # [inline] fn deref (& self) -> & crate :: generated :: physics_body_2d :: PhysicsBody2D { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for StaticBody2D { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: physics_body_2d :: PhysicsBody2D { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: physics_body_2d :: PhysicsBody2D > for StaticBody2D { } unsafe impl SubClass < crate :: generated :: collision_object_2d :: CollisionObject2D > for StaticBody2D { } unsafe impl SubClass < crate :: generated :: node_2d :: Node2D > for StaticBody2D { } unsafe impl SubClass < crate :: generated :: canvas_item :: CanvasItem > for StaticBody2D { } unsafe impl SubClass < crate :: generated :: node :: Node > for StaticBody2D { } unsafe impl SubClass < crate :: generated :: object :: Object > for StaticBody2D { } impl Instanciable for StaticBody2D { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { StaticBody2D :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct StaticBody2DMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_bounce : * mut sys :: godot_method_bind , pub get_constant_angular_velocity : * mut sys :: godot_method_bind , pub get_constant_linear_velocity : * mut sys :: godot_method_bind , pub get_friction : * mut sys :: godot_method_bind , pub get_physics_material_override : * mut sys :: godot_method_bind , pub set_bounce : * mut sys :: godot_method_bind , pub set_constant_angular_velocity : * mut sys :: godot_method_bind , pub set_constant_linear_velocity : * mut sys :: godot_method_bind , pub set_friction : * mut sys :: godot_method_bind , pub set_physics_material_override : * mut sys :: godot_method_bind } impl StaticBody2DMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : StaticBody2DMethodTable = StaticBody2DMethodTable { class_constructor : None , get_bounce : 0 as * mut sys :: godot_method_bind , get_constant_angular_velocity : 0 as * mut sys :: godot_method_bind , get_constant_linear_velocity : 0 as * mut sys :: godot_method_bind , get_friction : 0 as * mut sys :: godot_method_bind , get_physics_material_override : 0 as * mut sys :: godot_method_bind , set_bounce : 0 as * mut sys :: godot_method_bind , set_constant_angular_velocity : 0 as * mut sys :: godot_method_bind , set_constant_linear_velocity : 0 as * mut sys :: godot_method_bind , set_friction : 0 as * mut sys :: godot_method_bind , set_physics_material_override : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { StaticBody2DMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "StaticBody2D\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_bounce = (gd_api . godot_method_bind_get_method) (class_name , "get_bounce\0" . as_ptr () as * const c_char) ; table . get_constant_angular_velocity = (gd_api . godot_method_bind_get_method) (class_name , "get_constant_angular_velocity\0" . as_ptr () as * const c_char) ; table . get_constant_linear_velocity = (gd_api . godot_method_bind_get_method) (class_name , "get_constant_linear_velocity\0" . as_ptr () as * const c_char) ; table . get_friction = (gd_api . godot_method_bind_get_method) (class_name , "get_friction\0" . as_ptr () as * const c_char) ; table . get_physics_material_override = (gd_api . godot_method_bind_get_method) (class_name , "get_physics_material_override\0" . as_ptr () as * const c_char) ; table . set_bounce = (gd_api . godot_method_bind_get_method) (class_name , "set_bounce\0" . as_ptr () as * const c_char) ; table . set_constant_angular_velocity = (gd_api . godot_method_bind_get_method) (class_name , "set_constant_angular_velocity\0" . as_ptr () as * const c_char) ; table . set_constant_linear_velocity = (gd_api . godot_method_bind_get_method) (class_name , "set_constant_linear_velocity\0" . as_ptr () as * const c_char) ; table . set_friction = (gd_api . godot_method_bind_get_method) (class_name , "set_friction\0" . as_ptr () as * const c_char) ; table . set_physics_material_override = (gd_api . godot_method_bind_get_method) (class_name , "set_physics_material_override\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:118:3889 [INFO] [stdout] | [INFO] [stdout] 118 | ...thodTable { class_constructor : None , } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 118 | # [doc = "`core class VisualShaderNodeVectorScalarStep` inherits `VisualShaderNode` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_visualshadernodevectorscalarstep.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nVisualShaderNodeVectorScalarStep inherits methods from:\n - [VisualShaderNode](struct.VisualShaderNode.html)\n - [Resource](struct.Resource.html)\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct VisualShaderNodeVectorScalarStep { this : RawObject < Self > , } impl VisualShaderNodeVectorScalarStep { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = VisualShaderNodeVectorScalarStepMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } } impl gdnative_core :: private :: godot_object :: Sealed for VisualShaderNodeVectorScalarStep { } unsafe impl GodotObject for VisualShaderNodeVectorScalarStep { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "VisualShaderNodeVectorScalarStep" } } impl std :: ops :: Deref for VisualShaderNodeVectorScalarStep { type Target = crate :: generated :: visual_shader_node :: VisualShaderNode ; # [inline] fn deref (& self) -> & crate :: generated :: visual_shader_node :: VisualShaderNode { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for VisualShaderNodeVectorScalarStep { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: visual_shader_node :: VisualShaderNode { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: visual_shader_node :: VisualShaderNode > for VisualShaderNodeVectorScalarStep { } unsafe impl SubClass < crate :: generated :: resource :: Resource > for VisualShaderNodeVectorScalarStep { } unsafe impl SubClass < crate :: generated :: reference :: Reference > for VisualShaderNodeVectorScalarStep { } unsafe impl SubClass < crate :: generated :: object :: Object > for VisualShaderNodeVectorScalarStep { } impl Instanciable for VisualShaderNodeVectorScalarStep { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { VisualShaderNodeVectorScalarStep :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct VisualShaderNodeVectorScalarStepMethodTable { pub class_constructor : sys :: godot_class_constructor , } impl VisualShaderNodeVectorScalarStepMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : VisualShaderNodeVectorScalarStepMethodTable = VisualShaderNodeVectorScalarStepMethodTable { class_constructor : None , } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { VisualShaderNodeVectorScalarStepMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "VisualShaderNodeVectorScalarStep\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:124:11831 [INFO] [stdout] | [INFO] [stdout] 124 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 124 | # [doc = "`core class AudioEffectReverb` inherits `AudioEffect` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_audioeffectreverb.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nAudioEffectReverb inherits methods from:\n - [AudioEffect](struct.AudioEffect.html)\n - [Resource](struct.Resource.html)\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct AudioEffectReverb { this : RawObject < Self > , } impl AudioEffectReverb { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AudioEffectReverbMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "Defines how reflective the imaginary room's walls are. Value can range from 0 to 1."] # [doc = ""] # [inline] pub fn damping (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectReverbMethodTable :: get (get_api ()) . get_damping ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Output percent of original sound. At 0, only modified sound is outputted. Value can range from 0 to 1."] # [doc = ""] # [inline] pub fn dry (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectReverbMethodTable :: get (get_api ()) . get_dry ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "High-pass filter passes signals with a frequency higher than a certain cutoff frequency and attenuates signals with frequencies lower than the cutoff frequency. Value can range from 0 to 1."] # [doc = ""] # [inline] pub fn hpf (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectReverbMethodTable :: get (get_api ()) . get_hpf ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Output percent of predelay. Value can range from 0 to 1."] # [doc = ""] # [inline] pub fn predelay_feedback (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectReverbMethodTable :: get (get_api ()) . get_predelay_feedback ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Time between the original signal and the early reflections of the reverb signal, in milliseconds."] # [doc = ""] # [inline] pub fn predelay_msec (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectReverbMethodTable :: get (get_api ()) . get_predelay_msec ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Dimensions of simulated room. Bigger means more echoes. Value can range from 0 to 1."] # [doc = ""] # [inline] pub fn room_size (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectReverbMethodTable :: get (get_api ()) . get_room_size ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Widens or narrows the stereo image of the reverb tail. 1 means fully widens. Value can range from 0 to 1."] # [doc = ""] # [inline] pub fn spread (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectReverbMethodTable :: get (get_api ()) . get_spread ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Output percent of modified sound. At 0, only original sound is outputted. Value can range from 0 to 1."] # [doc = ""] # [inline] pub fn wet (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectReverbMethodTable :: get (get_api ()) . get_wet ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Defines how reflective the imaginary room's walls are. Value can range from 0 to 1."] # [doc = ""] # [inline] pub fn set_damping (& self , amount : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectReverbMethodTable :: get (get_api ()) . set_damping ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , amount) ; } } # [doc = "Output percent of original sound. At 0, only modified sound is outputted. Value can range from 0 to 1."] # [doc = ""] # [inline] pub fn set_dry (& self , amount : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectReverbMethodTable :: get (get_api ()) . set_dry ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , amount) ; } } # [doc = "High-pass filter passes signals with a frequency higher than a certain cutoff frequency and attenuates signals with frequencies lower than the cutoff frequency. Value can range from 0 to 1."] # [doc = ""] # [inline] pub fn set_hpf (& self , amount : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectReverbMethodTable :: get (get_api ()) . set_hpf ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , amount) ; } } # [doc = "Output percent of predelay. Value can range from 0 to 1."] # [doc = ""] # [inline] pub fn set_predelay_feedback (& self , feedback : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectReverbMethodTable :: get (get_api ()) . set_predelay_feedback ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , feedback) ; } } # [doc = "Time between the original signal and the early reflections of the reverb signal, in milliseconds."] # [doc = ""] # [inline] pub fn set_predelay_msec (& self , msec : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectReverbMethodTable :: get (get_api ()) . set_predelay_msec ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , msec) ; } } # [doc = "Dimensions of simulated room. Bigger means more echoes. Value can range from 0 to 1."] # [doc = ""] # [inline] pub fn set_room_size (& self , size : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectReverbMethodTable :: get (get_api ()) . set_room_size ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , size) ; } } # [doc = "Widens or narrows the stereo image of the reverb tail. 1 means fully widens. Value can range from 0 to 1."] # [doc = ""] # [inline] pub fn set_spread (& self , amount : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectReverbMethodTable :: get (get_api ()) . set_spread ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , amount) ; } } # [doc = "Output percent of modified sound. At 0, only original sound is outputted. Value can range from 0 to 1."] # [doc = ""] # [inline] pub fn set_wet (& self , amount : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectReverbMethodTable :: get (get_api ()) . set_wet ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , amount) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for AudioEffectReverb { } unsafe impl GodotObject for AudioEffectReverb { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AudioEffectReverb" } } impl std :: ops :: Deref for AudioEffectReverb { type Target = crate :: generated :: audio_effect :: AudioEffect ; # [inline] fn deref (& self) -> & crate :: generated :: audio_effect :: AudioEffect { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AudioEffectReverb { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: audio_effect :: AudioEffect { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: audio_effect :: AudioEffect > for AudioEffectReverb { } unsafe impl SubClass < crate :: generated :: resource :: Resource > for AudioEffectReverb { } unsafe impl SubClass < crate :: generated :: reference :: Reference > for AudioEffectReverb { } unsafe impl SubClass < crate :: generated :: object :: Object > for AudioEffectReverb { } impl Instanciable for AudioEffectReverb { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { AudioEffectReverb :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AudioEffectReverbMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_damping : * mut sys :: godot_method_bind , pub get_dry : * mut sys :: godot_method_bind , pub get_hpf : * mut sys :: godot_method_bind , pub get_predelay_feedback : * mut sys :: godot_method_bind , pub get_predelay_msec : * mut sys :: godot_method_bind , pub get_room_size : * mut sys :: godot_method_bind , pub get_spread : * mut sys :: godot_method_bind , pub get_wet : * mut sys :: godot_method_bind , pub set_damping : * mut sys :: godot_method_bind , pub set_dry : * mut sys :: godot_method_bind , pub set_hpf : * mut sys :: godot_method_bind , pub set_predelay_feedback : * mut sys :: godot_method_bind , pub set_predelay_msec : * mut sys :: godot_method_bind , pub set_room_size : * mut sys :: godot_method_bind , pub set_spread : * mut sys :: godot_method_bind , pub set_wet : * mut sys :: godot_method_bind } impl AudioEffectReverbMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AudioEffectReverbMethodTable = AudioEffectReverbMethodTable { class_constructor : None , get_damping : 0 as * mut sys :: godot_method_bind , get_dry : 0 as * mut sys :: godot_method_bind , get_hpf : 0 as * mut sys :: godot_method_bind , get_predelay_feedback : 0 as * mut sys :: godot_method_bind , get_predelay_msec : 0 as * mut sys :: godot_method_bind , get_room_size : 0 as * mut sys :: godot_method_bind , get_spread : 0 as * mut sys :: godot_method_bind , get_wet : 0 as * mut sys :: godot_method_bind , set_damping : 0 as * mut sys :: godot_method_bind , set_dry : 0 as * mut sys :: godot_method_bind , set_hpf : 0 as * mut sys :: godot_method_bind , set_predelay_feedback : 0 as * mut sys :: godot_method_bind , set_predelay_msec : 0 as * mut sys :: godot_method_bind , set_room_size : 0 as * mut sys :: godot_method_bind , set_spread : 0 as * mut sys :: godot_method_bind , set_wet : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { AudioEffectReverbMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AudioEffectReverb\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_damping = (gd_api . godot_method_bind_get_method) (class_name , "get_damping\0" . as_ptr () as * const c_char) ; table . get_dry = (gd_api . godot_method_bind_get_method) (class_name , "get_dry\0" . as_ptr () as * const c_char) ; table . get_hpf = (gd_api . godot_method_bind_get_method) (class_name , "get_hpf\0" . as_ptr () as * const c_char) ; table . get_predelay_feedback = (gd_api . godot_method_bind_get_method) (class_name , "get_predelay_feedback\0" . as_ptr () as * const c_char) ; table . get_predelay_msec = (gd_api . godot_method_bind_get_method) (class_name , "get_predelay_msec\0" . as_ptr () as * const c_char) ; table . get_room_size = (gd_api . godot_method_bind_get_method) (class_name , "get_room_size\0" . as_ptr () as * const c_char) ; table . get_spread = (gd_api . godot_method_bind_get_method) (class_name , "get_spread\0" . as_ptr () as * const c_char) ; table . get_wet = (gd_api . godot_method_bind_get_method) (class_name , "get_wet\0" . as_ptr () as * const c_char) ; table . set_damping = (gd_api . godot_method_bind_get_method) (class_name , "set_damping\0" . as_ptr () as * const c_char) ; table . set_dry = (gd_api . godot_method_bind_get_method) (class_name , "set_dry\0" . as_ptr () as * const c_char) ; table . set_hpf = (gd_api . godot_method_bind_get_method) (class_name , "set_hpf\0" . as_ptr () as * const c_char) ; table . set_predelay_feedback = (gd_api . godot_method_bind_get_method) (class_name , "set_predelay_feedback\0" . as_ptr () as * const c_char) ; table . set_predelay_msec = (gd_api . godot_method_bind_get_method) (class_name , "set_predelay_msec\0" . as_ptr () as * const c_char) ; table . set_room_size = (gd_api . godot_method_bind_get_method) (class_name , "set_room_size\0" . as_ptr () as * const c_char) ; table . set_spread = (gd_api . godot_method_bind_get_method) (class_name , "set_spread\0" . as_ptr () as * const c_char) ; table . set_wet = (gd_api . godot_method_bind_get_method) (class_name , "set_wet\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:130:3688 [INFO] [stdout] | [INFO] [stdout] 130 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 130 | # [doc = "`tools class EditorNavigationMeshGenerator` inherits `Object` (unsafe)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_editornavigationmeshgenerator.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = ""] # [doc = "\n## Class hierarchy\n\nEditorNavigationMeshGenerator inherits methods from:\n - [Object](struct.Object.html)\n"] # [doc = "\n## Tool\n\nThis class is used to interact with Godot's editor."] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct EditorNavigationMeshGenerator { this : RawObject < Self > , } impl EditorNavigationMeshGenerator { # [doc = ""] # [doc = ""] # [inline] pub fn bake (& self , nav_mesh : impl AsArg < crate :: generated :: navigation_mesh :: NavigationMesh > , root_node : impl AsArg < crate :: generated :: node :: Node >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorNavigationMeshGeneratorMethodTable :: get (get_api ()) . bake ; let ret = crate :: icalls :: icallptr_void_obj_obj (method_bind , self . this . sys () . as_ptr () , nav_mesh . as_arg_ptr () , root_node . as_arg_ptr ()) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn clear (& self , nav_mesh : impl AsArg < crate :: generated :: navigation_mesh :: NavigationMesh >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorNavigationMeshGeneratorMethodTable :: get (get_api ()) . clear ; let ret = crate :: icalls :: icallptr_void_obj (method_bind , self . this . sys () . as_ptr () , nav_mesh . as_arg_ptr ()) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for EditorNavigationMeshGenerator { } unsafe impl GodotObject for EditorNavigationMeshGenerator { type RefKind = ref_kind :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "EditorNavigationMeshGenerator" } } impl std :: ops :: Deref for EditorNavigationMeshGenerator { type Target = crate :: generated :: object :: Object ; # [inline] fn deref (& self) -> & crate :: generated :: object :: Object { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for EditorNavigationMeshGenerator { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: object :: Object { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: object :: Object > for EditorNavigationMeshGenerator { } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct EditorNavigationMeshGeneratorMethodTable { pub class_constructor : sys :: godot_class_constructor , pub bake : * mut sys :: godot_method_bind , pub clear : * mut sys :: godot_method_bind } impl EditorNavigationMeshGeneratorMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : EditorNavigationMeshGeneratorMethodTable = EditorNavigationMeshGeneratorMethodTable { class_constructor : None , bake : 0 as * mut sys :: godot_method_bind , clear : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { EditorNavigationMeshGeneratorMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "EditorNavigationMeshGenerator\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . bake = (gd_api . godot_method_bind_get_method) (class_name , "bake\0" . as_ptr () as * const c_char) ; table . clear = (gd_api . godot_method_bind_get_method) (class_name , "clear\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:136:4781 [INFO] [stdout] | [INFO] [stdout] 136 | ...thodTable { class_constructor : None , } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 136 | # [doc = "`core class VSplitContainer` inherits `SplitContainer` (unsafe)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_vsplitcontainer.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nNon reference counted objects such as the ones of this type are usually owned by the engine.\n\n`VSplitContainer` is a reference-only type. Persistent references can\nonly exist in the unsafe `Ref` form.\n\nIn the cases where Rust code owns an object of this type, for example if the object was just\ncreated on the Rust side and not passed to the engine yet, ownership should be either given\nto the engine or the object must be manually destroyed using `Ref::free`, or `Ref::queue_free`\nif it is a `Node`."] # [doc = "\n## Class hierarchy\n\nVSplitContainer inherits methods from:\n - [SplitContainer](struct.SplitContainer.html)\n - [Container](struct.Container.html)\n - [Control](struct.Control.html)\n - [CanvasItem](struct.CanvasItem.html)\n - [Node](struct.Node.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct VSplitContainer { this : RawObject < Self > , } impl VSplitContainer { # [doc = "Creates a new instance of this object.\n\nBecause this type is not reference counted, the lifetime of the returned object\nis *not* automatically managed.\n\nImmediately after creation, the object is owned by the caller, and can be\npassed to the engine (in which case the engine will be responsible for\ndestroying the object) or destroyed manually using `Ref::free`, or preferably\n`Ref::queue_free` if it is a `Node`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = VSplitContainerMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } } impl gdnative_core :: private :: godot_object :: Sealed for VSplitContainer { } unsafe impl GodotObject for VSplitContainer { type RefKind = ref_kind :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "VSplitContainer" } } impl QueueFree for VSplitContainer { # [inline] unsafe fn godot_queue_free (obj : * mut sys :: godot_object) { let method_bind : * mut sys :: godot_method_bind = crate :: generated :: node :: NodeMethodTable :: get (get_api ()) . queue_free ; crate :: icalls :: icallptr_void (method_bind , obj) } } impl std :: ops :: Deref for VSplitContainer { type Target = crate :: generated :: split_container :: SplitContainer ; # [inline] fn deref (& self) -> & crate :: generated :: split_container :: SplitContainer { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for VSplitContainer { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: split_container :: SplitContainer { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: split_container :: SplitContainer > for VSplitContainer { } unsafe impl SubClass < crate :: generated :: container :: Container > for VSplitContainer { } unsafe impl SubClass < crate :: generated :: control :: Control > for VSplitContainer { } unsafe impl SubClass < crate :: generated :: canvas_item :: CanvasItem > for VSplitContainer { } unsafe impl SubClass < crate :: generated :: node :: Node > for VSplitContainer { } unsafe impl SubClass < crate :: generated :: object :: Object > for VSplitContainer { } impl Instanciable for VSplitContainer { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { VSplitContainer :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct VSplitContainerMethodTable { pub class_constructor : sys :: godot_class_constructor , } impl VSplitContainerMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : VSplitContainerMethodTable = VSplitContainerMethodTable { class_constructor : None , } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { VSplitContainerMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "VSplitContainer\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:142:15700 [INFO] [stdout] | [INFO] [stdout] 142 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 142 | # [doc = "`core class MultiplayerAPI` inherits `Reference` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_multiplayerapi.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nMultiplayerAPI inherits methods from:\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct MultiplayerAPI { this : RawObject < Self > , } # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct RpcMode (pub i64) ; impl RpcMode { pub const DISABLED : RpcMode = RpcMode (0i64) ; pub const REMOTE : RpcMode = RpcMode (1i64) ; pub const MASTER : RpcMode = RpcMode (2i64) ; pub const SLAVE : RpcMode = RpcMode (3i64) ; pub const PUPPET : RpcMode = RpcMode (3i64) ; pub const SYNC : RpcMode = RpcMode (4i64) ; pub const REMOTESYNC : RpcMode = RpcMode (4i64) ; pub const MASTERSYNC : RpcMode = RpcMode (5i64) ; pub const PUPPETSYNC : RpcMode = RpcMode (6i64) ; } impl From < i64 > for RpcMode { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < RpcMode > for i64 { # [inline] fn from (v : RpcMode) -> Self { v . 0 } } # [doc = "Constants"] # [allow (non_upper_case_globals)] impl MultiplayerAPI { pub const RPC_MODE_DISABLED : i64 = 0i64 ; pub const RPC_MODE_MASTER : i64 = 2i64 ; pub const RPC_MODE_MASTERSYNC : i64 = 5i64 ; pub const RPC_MODE_PUPPET : i64 = 3i64 ; pub const RPC_MODE_PUPPETSYNC : i64 = 6i64 ; pub const RPC_MODE_REMOTE : i64 = 1i64 ; pub const RPC_MODE_REMOTESYNC : i64 = 4i64 ; pub const RPC_MODE_SLAVE : i64 = 3i64 ; pub const RPC_MODE_SYNC : i64 = 4i64 ; } impl MultiplayerAPI { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = MultiplayerAPIMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "Clears the current MultiplayerAPI network state (you shouldn't call this unless you know what you are doing)."] # [doc = ""] # [inline] pub fn clear (& self) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = MultiplayerAPIMethodTable :: get (get_api ()) . clear ; let ret = crate :: icalls :: icallptr_void (method_bind , self . this . sys () . as_ptr ()) ; } } # [doc = "Returns the peer IDs of all connected peers of this MultiplayerAPI's [member network_peer]."] # [doc = ""] # [inline] pub fn get_network_connected_peers (& self) -> Int32Array { unsafe { let method_bind : * mut sys :: godot_method_bind = MultiplayerAPIMethodTable :: get (get_api ()) . get_network_connected_peers ; let ret = crate :: icalls :: icallptr_i32arr (method_bind , self . this . sys () . as_ptr ()) ; Int32Array :: from_sys (ret) } } # [doc = "The peer object to handle the RPC system (effectively enabling networking when set). Depending on the peer itself, the MultiplayerAPI will become a network server (check with [method is_network_server]) and will set root node's network mode to master, or it will become a regular peer with root node set to puppet. All child nodes are set to inherit the network mode by default. Handling of networking-related events (connection, disconnection, new clients) is done by connecting to MultiplayerAPI's signals."] # [doc = ""] # [inline] pub fn network_peer (& self) -> Option < Ref < crate :: generated :: networked_multiplayer_peer :: NetworkedMultiplayerPeer , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = MultiplayerAPIMethodTable :: get (get_api ()) . get_network_peer ; let ret = crate :: icalls :: icallptr_obj (method_bind , self . this . sys () . as_ptr ()) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: networked_multiplayer_peer :: NetworkedMultiplayerPeer , thread_access :: Shared >> :: move_from_sys (sys)) } } # [doc = "Returns the unique peer ID of this MultiplayerAPI's [member network_peer]."] # [doc = ""] # [inline] pub fn get_network_unique_id (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = MultiplayerAPIMethodTable :: get (get_api ()) . get_network_unique_id ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = ""] # [doc = ""] # [inline] pub fn root_node (& self) -> Option < Ref < crate :: generated :: node :: Node , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = MultiplayerAPIMethodTable :: get (get_api ()) . get_root_node ; let ret = crate :: icalls :: icallptr_obj (method_bind , self . this . sys () . as_ptr ()) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: node :: Node , thread_access :: Shared >> :: move_from_sys (sys)) } } # [doc = "Returns the sender's peer ID for the RPC currently being executed.\n**Note:** If not inside an RPC this method will return 0."] # [doc = ""] # [inline] pub fn get_rpc_sender_id (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = MultiplayerAPIMethodTable :: get (get_api ()) . get_rpc_sender_id ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Returns `true` if there is a [member network_peer] set."] # [doc = ""] # [inline] pub fn has_network_peer (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = MultiplayerAPIMethodTable :: get (get_api ()) . has_network_peer ; let ret = crate :: icalls :: icallptr_bool (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Returns `true` if this MultiplayerAPI's [member network_peer] is in server mode (listening for connections)."] # [doc = ""] # [inline] pub fn is_network_server (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = MultiplayerAPIMethodTable :: get (get_api ()) . is_network_server ; let ret = crate :: icalls :: icallptr_bool (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "If `true` (or if the [member network_peer] has [member PacketPeer.allow_object_decoding] set to `true`), the MultiplayerAPI will allow encoding and decoding of object during RPCs/RSETs.\n**Warning:** Deserialized objects can contain code which gets executed. Do not use this option if the serialized object comes from untrusted sources to avoid potential security threats such as remote code execution."] # [doc = ""] # [inline] pub fn is_object_decoding_allowed (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = MultiplayerAPIMethodTable :: get (get_api ()) . is_object_decoding_allowed ; let ret = crate :: icalls :: icallptr_bool (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "If `true`, the MultiplayerAPI's [member network_peer] refuses new incoming connections."] # [doc = ""] # [inline] pub fn is_refusing_new_network_connections (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = MultiplayerAPIMethodTable :: get (get_api ()) . is_refusing_new_network_connections ; let ret = crate :: icalls :: icallptr_bool (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Method used for polling the MultiplayerAPI. You only need to worry about this if you are using [member Node.custom_multiplayer] override or you set [member SceneTree.multiplayer_poll] to `false`. By default, [SceneTree] will poll its MultiplayerAPI for you.\n**Note:** This method results in RPCs and RSETs being called, so they will be executed in the same context of this function (e.g. `_process`, `physics`, [Thread])."] # [doc = ""] # [inline] pub fn poll (& self) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = MultiplayerAPIMethodTable :: get (get_api ()) . poll ; let ret = crate :: icalls :: icallptr_void (method_bind , self . this . sys () . as_ptr ()) ; } } # [doc = "Sends the given raw `bytes` to a specific peer identified by `id` (see [method NetworkedMultiplayerPeer.set_target_peer]). Default ID is `0`, i.e. broadcast to all peers.\n# Default Arguments\n* `id` - `0`\n* `mode` - `2`"] # [doc = ""] # [inline] pub fn send_bytes (& self , bytes : ByteArray , id : i64 , mode : i64) -> GodotResult { unsafe { let method_bind : * mut sys :: godot_method_bind = MultiplayerAPIMethodTable :: get (get_api ()) . send_bytes ; let ret = crate :: icalls :: icallptr_i64_bytearr_i64_i64 (method_bind , self . this . sys () . as_ptr () , bytes , id , mode) ; GodotError :: result_from_sys (ret as _) } } # [doc = "If `true` (or if the [member network_peer] has [member PacketPeer.allow_object_decoding] set to `true`), the MultiplayerAPI will allow encoding and decoding of object during RPCs/RSETs.\n**Warning:** Deserialized objects can contain code which gets executed. Do not use this option if the serialized object comes from untrusted sources to avoid potential security threats such as remote code execution."] # [doc = ""] # [inline] pub fn set_allow_object_decoding (& self , enable : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = MultiplayerAPIMethodTable :: get (get_api ()) . set_allow_object_decoding ; let ret = crate :: icalls :: icallptr_void_bool (method_bind , self . this . sys () . as_ptr () , enable) ; } } # [doc = "The peer object to handle the RPC system (effectively enabling networking when set). Depending on the peer itself, the MultiplayerAPI will become a network server (check with [method is_network_server]) and will set root node's network mode to master, or it will become a regular peer with root node set to puppet. All child nodes are set to inherit the network mode by default. Handling of networking-related events (connection, disconnection, new clients) is done by connecting to MultiplayerAPI's signals."] # [doc = ""] # [inline] pub fn set_network_peer (& self , peer : impl AsArg < crate :: generated :: networked_multiplayer_peer :: NetworkedMultiplayerPeer >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = MultiplayerAPIMethodTable :: get (get_api ()) . set_network_peer ; let ret = crate :: icalls :: icallptr_void_obj (method_bind , self . this . sys () . as_ptr () , peer . as_arg_ptr ()) ; } } # [doc = "If `true`, the MultiplayerAPI's [member network_peer] refuses new incoming connections."] # [doc = ""] # [inline] pub fn set_refuse_new_network_connections (& self , refuse : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = MultiplayerAPIMethodTable :: get (get_api ()) . set_refuse_new_network_connections ; let ret = crate :: icalls :: icallptr_void_bool (method_bind , self . this . sys () . as_ptr () , refuse) ; } } # [doc = "Sets the base root node to use for RPCs. Instead of an absolute path, a relative path will be used to find the node upon which the RPC should be executed.\nThis effectively allows to have different branches of the scene tree to be managed by different MultiplayerAPI, allowing for example to run both client and server in the same scene."] # [doc = ""] # [inline] pub fn set_root_node (& self , node : impl AsArg < crate :: generated :: node :: Node >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = MultiplayerAPIMethodTable :: get (get_api ()) . set_root_node ; let ret = crate :: icalls :: icallptr_void_obj (method_bind , self . this . sys () . as_ptr () , node . as_arg_ptr ()) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for MultiplayerAPI { } unsafe impl GodotObject for MultiplayerAPI { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "MultiplayerAPI" } } impl std :: ops :: Deref for MultiplayerAPI { type Target = crate :: generated :: reference :: Reference ; # [inline] fn deref (& self) -> & crate :: generated :: reference :: Reference { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for MultiplayerAPI { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: reference :: Reference { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: reference :: Reference > for MultiplayerAPI { } unsafe impl SubClass < crate :: generated :: object :: Object > for MultiplayerAPI { } impl Instanciable for MultiplayerAPI { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { MultiplayerAPI :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct MultiplayerAPIMethodTable { pub class_constructor : sys :: godot_class_constructor , pub clear : * mut sys :: godot_method_bind , pub get_network_connected_peers : * mut sys :: godot_method_bind , pub get_network_peer : * mut sys :: godot_method_bind , pub get_network_unique_id : * mut sys :: godot_method_bind , pub get_root_node : * mut sys :: godot_method_bind , pub get_rpc_sender_id : * mut sys :: godot_method_bind , pub has_network_peer : * mut sys :: godot_method_bind , pub is_network_server : * mut sys :: godot_method_bind , pub is_object_decoding_allowed : * mut sys :: godot_method_bind , pub is_refusing_new_network_connections : * mut sys :: godot_method_bind , pub poll : * mut sys :: godot_method_bind , pub send_bytes : * mut sys :: godot_method_bind , pub set_allow_object_decoding : * mut sys :: godot_method_bind , pub set_network_peer : * mut sys :: godot_method_bind , pub set_refuse_new_network_connections : * mut sys :: godot_method_bind , pub set_root_node : * mut sys :: godot_method_bind } impl MultiplayerAPIMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : MultiplayerAPIMethodTable = MultiplayerAPIMethodTable { class_constructor : None , clear : 0 as * mut sys :: godot_method_bind , get_network_connected_peers : 0 as * mut sys :: godot_method_bind , get_network_peer : 0 as * mut sys :: godot_method_bind , get_network_unique_id : 0 as * mut sys :: godot_method_bind , get_root_node : 0 as * mut sys :: godot_method_bind , get_rpc_sender_id : 0 as * mut sys :: godot_method_bind , has_network_peer : 0 as * mut sys :: godot_method_bind , is_network_server : 0 as * mut sys :: godot_method_bind , is_object_decoding_allowed : 0 as * mut sys :: godot_method_bind , is_refusing_new_network_connections : 0 as * mut sys :: godot_method_bind , poll : 0 as * mut sys :: godot_method_bind , send_bytes : 0 as * mut sys :: godot_method_bind , set_allow_object_decoding : 0 as * mut sys :: godot_method_bind , set_network_peer : 0 as * mut sys :: godot_method_bind , set_refuse_new_network_connections : 0 as * mut sys :: godot_method_bind , set_root_node : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { MultiplayerAPIMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "MultiplayerAPI\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . clear = (gd_api . godot_method_bind_get_method) (class_name , "clear\0" . as_ptr () as * const c_char) ; table . get_network_connected_peers = (gd_api . godot_method_bind_get_method) (class_name , "get_network_connected_peers\0" . as_ptr () as * const c_char) ; table . get_network_peer = (gd_api . godot_method_bind_get_method) (class_name , "get_network_peer\0" . as_ptr () as * const c_char) ; table . get_network_unique_id = (gd_api . godot_method_bind_get_method) (class_name , "get_network_unique_id\0" . as_ptr () as * const c_char) ; table . get_root_node = (gd_api . godot_method_bind_get_method) (class_name , "get_root_node\0" . as_ptr () as * const c_char) ; table . get_rpc_sender_id = (gd_api . godot_method_bind_get_method) (class_name , "get_rpc_sender_id\0" . as_ptr () as * const c_char) ; table . has_network_peer = (gd_api . godot_method_bind_get_method) (class_name , "has_network_peer\0" . as_ptr () as * const c_char) ; table . is_network_server = (gd_api . godot_method_bind_get_method) (class_name , "is_network_server\0" . as_ptr () as * const c_char) ; table . is_object_decoding_allowed = (gd_api . godot_method_bind_get_method) (class_name , "is_object_decoding_allowed\0" . as_ptr () as * const c_char) ; table . is_refusing_new_network_connections = (gd_api . godot_method_bind_get_method) (class_name , "is_refusing_new_network_connections\0" . as_ptr () as * const c_char) ; table . poll = (gd_api . godot_method_bind_get_method) (class_name , "poll\0" . as_ptr () as * const c_char) ; table . send_bytes = (gd_api . godot_method_bind_get_method) (class_name , "send_bytes\0" . as_ptr () as * const c_char) ; table . set_allow_object_decoding = (gd_api . godot_method_bind_get_method) (class_name , "set_allow_object_decoding\0" . as_ptr () as * const c_char) ; table . set_network_peer = (gd_api . godot_method_bind_get_method) (class_name , "set_network_peer\0" . as_ptr () as * const c_char) ; table . set_refuse_new_network_connections = (gd_api . godot_method_bind_get_method) (class_name , "set_refuse_new_network_connections\0" . as_ptr () as * const c_char) ; table . set_root_node = (gd_api . godot_method_bind_get_method) (class_name , "set_root_node\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:148:9418 [INFO] [stdout] | [INFO] [stdout] 148 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 148 | # [doc = "`core class DampedSpringJoint2D` inherits `Joint2D` (unsafe)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_dampedspringjoint2d.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nNon reference counted objects such as the ones of this type are usually owned by the engine.\n\n`DampedSpringJoint2D` is a reference-only type. Persistent references can\nonly exist in the unsafe `Ref` form.\n\nIn the cases where Rust code owns an object of this type, for example if the object was just\ncreated on the Rust side and not passed to the engine yet, ownership should be either given\nto the engine or the object must be manually destroyed using `Ref::free`, or `Ref::queue_free`\nif it is a `Node`."] # [doc = "\n## Class hierarchy\n\nDampedSpringJoint2D inherits methods from:\n - [Joint2D](struct.Joint2D.html)\n - [Node2D](struct.Node2D.html)\n - [CanvasItem](struct.CanvasItem.html)\n - [Node](struct.Node.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct DampedSpringJoint2D { this : RawObject < Self > , } impl DampedSpringJoint2D { # [doc = "Creates a new instance of this object.\n\nBecause this type is not reference counted, the lifetime of the returned object\nis *not* automatically managed.\n\nImmediately after creation, the object is owned by the caller, and can be\npassed to the engine (in which case the engine will be responsible for\ndestroying the object) or destroyed manually using `Ref::free`, or preferably\n`Ref::queue_free` if it is a `Node`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = DampedSpringJoint2DMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "The spring joint's damping ratio. A value between `0` and `1`. When the two bodies move into different directions the system tries to align them to the spring axis again. A high `damping` value forces the attached bodies to align faster."] # [doc = ""] # [inline] pub fn damping (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = DampedSpringJoint2DMethodTable :: get (get_api ()) . get_damping ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "The spring joint's maximum length. The two attached bodies cannot stretch it past this value."] # [doc = ""] # [inline] pub fn length (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = DampedSpringJoint2DMethodTable :: get (get_api ()) . get_length ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "When the bodies attached to the spring joint move they stretch or squash it. The joint always tries to resize towards this length."] # [doc = ""] # [inline] pub fn rest_length (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = DampedSpringJoint2DMethodTable :: get (get_api ()) . get_rest_length ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "The higher the value, the less the bodies attached to the joint will deform it. The joint applies an opposing force to the bodies, the product of the stiffness multiplied by the size difference from its resting length."] # [doc = ""] # [inline] pub fn stiffness (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = DampedSpringJoint2DMethodTable :: get (get_api ()) . get_stiffness ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "The spring joint's damping ratio. A value between `0` and `1`. When the two bodies move into different directions the system tries to align them to the spring axis again. A high `damping` value forces the attached bodies to align faster."] # [doc = ""] # [inline] pub fn set_damping (& self , damping : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = DampedSpringJoint2DMethodTable :: get (get_api ()) . set_damping ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , damping) ; } } # [doc = "The spring joint's maximum length. The two attached bodies cannot stretch it past this value."] # [doc = ""] # [inline] pub fn set_length (& self , length : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = DampedSpringJoint2DMethodTable :: get (get_api ()) . set_length ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , length) ; } } # [doc = "When the bodies attached to the spring joint move they stretch or squash it. The joint always tries to resize towards this length."] # [doc = ""] # [inline] pub fn set_rest_length (& self , rest_length : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = DampedSpringJoint2DMethodTable :: get (get_api ()) . set_rest_length ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , rest_length) ; } } # [doc = "The higher the value, the less the bodies attached to the joint will deform it. The joint applies an opposing force to the bodies, the product of the stiffness multiplied by the size difference from its resting length."] # [doc = ""] # [inline] pub fn set_stiffness (& self , stiffness : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = DampedSpringJoint2DMethodTable :: get (get_api ()) . set_stiffness ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , stiffness) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for DampedSpringJoint2D { } unsafe impl GodotObject for DampedSpringJoint2D { type RefKind = ref_kind :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "DampedSpringJoint2D" } } impl QueueFree for DampedSpringJoint2D { # [inline] unsafe fn godot_queue_free (obj : * mut sys :: godot_object) { let method_bind : * mut sys :: godot_method_bind = crate :: generated :: node :: NodeMethodTable :: get (get_api ()) . queue_free ; crate :: icalls :: icallptr_void (method_bind , obj) } } impl std :: ops :: Deref for DampedSpringJoint2D { type Target = crate :: generated :: joint_2d :: Joint2D ; # [inline] fn deref (& self) -> & crate :: generated :: joint_2d :: Joint2D { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for DampedSpringJoint2D { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: joint_2d :: Joint2D { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: joint_2d :: Joint2D > for DampedSpringJoint2D { } unsafe impl SubClass < crate :: generated :: node_2d :: Node2D > for DampedSpringJoint2D { } unsafe impl SubClass < crate :: generated :: canvas_item :: CanvasItem > for DampedSpringJoint2D { } unsafe impl SubClass < crate :: generated :: node :: Node > for DampedSpringJoint2D { } unsafe impl SubClass < crate :: generated :: object :: Object > for DampedSpringJoint2D { } impl Instanciable for DampedSpringJoint2D { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { DampedSpringJoint2D :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct DampedSpringJoint2DMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_damping : * mut sys :: godot_method_bind , pub get_length : * mut sys :: godot_method_bind , pub get_rest_length : * mut sys :: godot_method_bind , pub get_stiffness : * mut sys :: godot_method_bind , pub set_damping : * mut sys :: godot_method_bind , pub set_length : * mut sys :: godot_method_bind , pub set_rest_length : * mut sys :: godot_method_bind , pub set_stiffness : * mut sys :: godot_method_bind } impl DampedSpringJoint2DMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : DampedSpringJoint2DMethodTable = DampedSpringJoint2DMethodTable { class_constructor : None , get_damping : 0 as * mut sys :: godot_method_bind , get_length : 0 as * mut sys :: godot_method_bind , get_rest_length : 0 as * mut sys :: godot_method_bind , get_stiffness : 0 as * mut sys :: godot_method_bind , set_damping : 0 as * mut sys :: godot_method_bind , set_length : 0 as * mut sys :: godot_method_bind , set_rest_length : 0 as * mut sys :: godot_method_bind , set_stiffness : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { DampedSpringJoint2DMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "DampedSpringJoint2D\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_damping = (gd_api . godot_method_bind_get_method) (class_name , "get_damping\0" . as_ptr () as * const c_char) ; table . get_length = (gd_api . godot_method_bind_get_method) (class_name , "get_length\0" . as_ptr () as * const c_char) ; table . get_rest_length = (gd_api . godot_method_bind_get_method) (class_name , "get_rest_length\0" . as_ptr () as * const c_char) ; table . get_stiffness = (gd_api . godot_method_bind_get_method) (class_name , "get_stiffness\0" . as_ptr () as * const c_char) ; table . set_damping = (gd_api . godot_method_bind_get_method) (class_name , "set_damping\0" . as_ptr () as * const c_char) ; table . set_length = (gd_api . godot_method_bind_get_method) (class_name , "set_length\0" . as_ptr () as * const c_char) ; table . set_rest_length = (gd_api . godot_method_bind_get_method) (class_name , "set_rest_length\0" . as_ptr () as * const c_char) ; table . set_stiffness = (gd_api . godot_method_bind_get_method) (class_name , "set_stiffness\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:154:3071 [INFO] [stdout] | [INFO] [stdout] 154 | ...thodTable { class_constructor : None , } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 154 | # [doc = "`core class JavaClass` inherits `Reference` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_javaclass.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nJavaClass inherits methods from:\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct JavaClass { this : RawObject < Self > , } impl JavaClass { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = JavaClassMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } } impl gdnative_core :: private :: godot_object :: Sealed for JavaClass { } unsafe impl GodotObject for JavaClass { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "JavaClass" } } impl std :: ops :: Deref for JavaClass { type Target = crate :: generated :: reference :: Reference ; # [inline] fn deref (& self) -> & crate :: generated :: reference :: Reference { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for JavaClass { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: reference :: Reference { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: reference :: Reference > for JavaClass { } unsafe impl SubClass < crate :: generated :: object :: Object > for JavaClass { } impl Instanciable for JavaClass { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { JavaClass :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct JavaClassMethodTable { pub class_constructor : sys :: godot_class_constructor , } impl JavaClassMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : JavaClassMethodTable = JavaClassMethodTable { class_constructor : None , } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { JavaClassMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "JavaClass\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:160:3498 [INFO] [stdout] | [INFO] [stdout] 160 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 160 | # [doc = "`core singleton class JavaClassWrapper` inherits `Object` (unsafe)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_javaclasswrapper.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = ""] # [doc = "\n## Class hierarchy\n\nJavaClassWrapper inherits methods from:\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct JavaClassWrapper { this : RawObject < Self > , } impl JavaClassWrapper { # [doc = "Returns a reference to the singleton instance."] # [inline] pub fn godot_singleton () -> & 'static Self { unsafe { let this = (get_api () . godot_global_get_singleton) ("JavaClassWrapper\0" . as_ptr () as * mut _) ; let this = ptr :: NonNull :: new (this) . expect ("singleton should not be null") ; let this = RawObject :: from_sys_ref_unchecked :: < 'static > (this) ; Self :: cast_ref (this) } } # [doc = ""] # [doc = ""] # [inline] pub fn wrap (& self , name : impl Into < GodotString >) -> Option < Ref < crate :: generated :: java_class :: JavaClass , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = JavaClassWrapperMethodTable :: get (get_api ()) . wrap ; let ret = crate :: icalls :: icallptr_obj_str (method_bind , self . this . sys () . as_ptr () , name . into ()) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: java_class :: JavaClass , thread_access :: Shared >> :: move_from_sys (sys)) } } } impl gdnative_core :: private :: godot_object :: Sealed for JavaClassWrapper { } unsafe impl GodotObject for JavaClassWrapper { type RefKind = ref_kind :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "JavaClassWrapper" } } impl std :: ops :: Deref for JavaClassWrapper { type Target = crate :: generated :: object :: Object ; # [inline] fn deref (& self) -> & crate :: generated :: object :: Object { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for JavaClassWrapper { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: object :: Object { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: object :: Object > for JavaClassWrapper { } unsafe impl Send for JavaClassWrapper { } unsafe impl Sync for JavaClassWrapper { } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct JavaClassWrapperMethodTable { pub class_constructor : sys :: godot_class_constructor , pub wrap : * mut sys :: godot_method_bind } impl JavaClassWrapperMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : JavaClassWrapperMethodTable = JavaClassWrapperMethodTable { class_constructor : None , wrap : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { JavaClassWrapperMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "JavaClassWrapper\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . wrap = (gd_api . godot_method_bind_get_method) (class_name , "wrap\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:166:5986 [INFO] [stdout] | [INFO] [stdout] 166 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 166 | # [doc = "`core class InputEventScreenTouch` inherits `InputEvent` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_inputeventscreentouch.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nInputEventScreenTouch inherits methods from:\n - [InputEvent](struct.InputEvent.html)\n - [Resource](struct.Resource.html)\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct InputEventScreenTouch { this : RawObject < Self > , } impl InputEventScreenTouch { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = InputEventScreenTouchMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "The touch index in the case of a multi-touch event. One index = one finger."] # [doc = ""] # [inline] pub fn index (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = InputEventScreenTouchMethodTable :: get (get_api ()) . get_index ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "The touch position."] # [doc = ""] # [inline] pub fn position (& self) -> Vector2 { unsafe { let method_bind : * mut sys :: godot_method_bind = InputEventScreenTouchMethodTable :: get (get_api ()) . get_position ; let ret = crate :: icalls :: icallptr_vec2 (method_bind , self . this . sys () . as_ptr ()) ; mem :: transmute (ret) } } # [doc = "The touch index in the case of a multi-touch event. One index = one finger."] # [doc = ""] # [inline] pub fn set_index (& self , index : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = InputEventScreenTouchMethodTable :: get (get_api ()) . set_index ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , index) ; } } # [doc = "The touch position."] # [doc = ""] # [inline] pub fn set_position (& self , position : Vector2) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = InputEventScreenTouchMethodTable :: get (get_api ()) . set_position ; let ret = crate :: icalls :: icallptr_void_vec2 (method_bind , self . this . sys () . as_ptr () , position) ; } } # [doc = "If `true`, the touch's state is pressed. If `false`, the touch's state is released."] # [doc = ""] # [inline] pub fn set_pressed (& self , pressed : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = InputEventScreenTouchMethodTable :: get (get_api ()) . set_pressed ; let ret = crate :: icalls :: icallptr_void_bool (method_bind , self . this . sys () . as_ptr () , pressed) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for InputEventScreenTouch { } unsafe impl GodotObject for InputEventScreenTouch { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "InputEventScreenTouch" } } impl std :: ops :: Deref for InputEventScreenTouch { type Target = crate :: generated :: input_event :: InputEvent ; # [inline] fn deref (& self) -> & crate :: generated :: input_event :: InputEvent { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for InputEventScreenTouch { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: input_event :: InputEvent { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: input_event :: InputEvent > for InputEventScreenTouch { } unsafe impl SubClass < crate :: generated :: resource :: Resource > for InputEventScreenTouch { } unsafe impl SubClass < crate :: generated :: reference :: Reference > for InputEventScreenTouch { } unsafe impl SubClass < crate :: generated :: object :: Object > for InputEventScreenTouch { } impl Instanciable for InputEventScreenTouch { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { InputEventScreenTouch :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct InputEventScreenTouchMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_index : * mut sys :: godot_method_bind , pub get_position : * mut sys :: godot_method_bind , pub set_index : * mut sys :: godot_method_bind , pub set_position : * mut sys :: godot_method_bind , pub set_pressed : * mut sys :: godot_method_bind } impl InputEventScreenTouchMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : InputEventScreenTouchMethodTable = InputEventScreenTouchMethodTable { class_constructor : None , get_index : 0 as * mut sys :: godot_method_bind , get_position : 0 as * mut sys :: godot_method_bind , set_index : 0 as * mut sys :: godot_method_bind , set_position : 0 as * mut sys :: godot_method_bind , set_pressed : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { InputEventScreenTouchMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "InputEventScreenTouch\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_index = (gd_api . godot_method_bind_get_method) (class_name , "get_index\0" . as_ptr () as * const c_char) ; table . get_position = (gd_api . godot_method_bind_get_method) (class_name , "get_position\0" . as_ptr () as * const c_char) ; table . set_index = (gd_api . godot_method_bind_get_method) (class_name , "set_index\0" . as_ptr () as * const c_char) ; table . set_position = (gd_api . godot_method_bind_get_method) (class_name , "set_position\0" . as_ptr () as * const c_char) ; table . set_pressed = (gd_api . godot_method_bind_get_method) (class_name , "set_pressed\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:172:42531 [INFO] [stdout] | [INFO] [stdout] 172 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 172 | # [doc = "`core class CPUParticles2D` inherits `Node2D` (unsafe)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_cpuparticles2d.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nNon reference counted objects such as the ones of this type are usually owned by the engine.\n\n`CPUParticles2D` is a reference-only type. Persistent references can\nonly exist in the unsafe `Ref` form.\n\nIn the cases where Rust code owns an object of this type, for example if the object was just\ncreated on the Rust side and not passed to the engine yet, ownership should be either given\nto the engine or the object must be manually destroyed using `Ref::free`, or `Ref::queue_free`\nif it is a `Node`."] # [doc = "\n## Class hierarchy\n\nCPUParticles2D inherits methods from:\n - [Node2D](struct.Node2D.html)\n - [CanvasItem](struct.CanvasItem.html)\n - [Node](struct.Node.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct CPUParticles2D { this : RawObject < Self > , } # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct DrawOrder (pub i64) ; impl DrawOrder { pub const INDEX : DrawOrder = DrawOrder (0i64) ; pub const LIFETIME : DrawOrder = DrawOrder (1i64) ; } impl From < i64 > for DrawOrder { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < DrawOrder > for i64 { # [inline] fn from (v : DrawOrder) -> Self { v . 0 } } # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct EmissionShape (pub i64) ; impl EmissionShape { pub const POINT : EmissionShape = EmissionShape (0i64) ; pub const SPHERE : EmissionShape = EmissionShape (1i64) ; pub const RECTANGLE : EmissionShape = EmissionShape (2i64) ; pub const POINTS : EmissionShape = EmissionShape (3i64) ; pub const DIRECTED_POINTS : EmissionShape = EmissionShape (4i64) ; pub const MAX : EmissionShape = EmissionShape (5i64) ; } impl From < i64 > for EmissionShape { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < EmissionShape > for i64 { # [inline] fn from (v : EmissionShape) -> Self { v . 0 } } # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct Flags (pub i64) ; impl Flags { pub const ALIGN_Y_TO_VELOCITY : Flags = Flags (0i64) ; pub const ROTATE_Y : Flags = Flags (1i64) ; pub const DISABLE_Z : Flags = Flags (2i64) ; pub const MAX : Flags = Flags (3i64) ; } impl From < i64 > for Flags { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < Flags > for i64 { # [inline] fn from (v : Flags) -> Self { v . 0 } } # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct Parameter (pub i64) ; impl Parameter { pub const INITIAL_LINEAR_VELOCITY : Parameter = Parameter (0i64) ; pub const ANGULAR_VELOCITY : Parameter = Parameter (1i64) ; pub const ORBIT_VELOCITY : Parameter = Parameter (2i64) ; pub const LINEAR_ACCEL : Parameter = Parameter (3i64) ; pub const RADIAL_ACCEL : Parameter = Parameter (4i64) ; pub const TANGENTIAL_ACCEL : Parameter = Parameter (5i64) ; pub const DAMPING : Parameter = Parameter (6i64) ; pub const ANGLE : Parameter = Parameter (7i64) ; pub const SCALE : Parameter = Parameter (8i64) ; pub const HUE_VARIATION : Parameter = Parameter (9i64) ; pub const ANIM_SPEED : Parameter = Parameter (10i64) ; pub const ANIM_OFFSET : Parameter = Parameter (11i64) ; pub const MAX : Parameter = Parameter (12i64) ; } impl From < i64 > for Parameter { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < Parameter > for i64 { # [inline] fn from (v : Parameter) -> Self { v . 0 } } # [doc = "Constants"] # [allow (non_upper_case_globals)] impl CPUParticles2D { pub const DRAW_ORDER_INDEX : i64 = 0i64 ; pub const DRAW_ORDER_LIFETIME : i64 = 1i64 ; pub const EMISSION_SHAPE_DIRECTED_POINTS : i64 = 4i64 ; pub const EMISSION_SHAPE_MAX : i64 = 5i64 ; pub const EMISSION_SHAPE_POINT : i64 = 0i64 ; pub const EMISSION_SHAPE_POINTS : i64 = 3i64 ; pub const EMISSION_SHAPE_RECTANGLE : i64 = 2i64 ; pub const EMISSION_SHAPE_SPHERE : i64 = 1i64 ; pub const FLAG_ALIGN_Y_TO_VELOCITY : i64 = 0i64 ; pub const FLAG_DISABLE_Z : i64 = 2i64 ; pub const FLAG_MAX : i64 = 3i64 ; pub const FLAG_ROTATE_Y : i64 = 1i64 ; pub const PARAM_ANGLE : i64 = 7i64 ; pub const PARAM_ANGULAR_VELOCITY : i64 = 1i64 ; pub const PARAM_ANIM_OFFSET : i64 = 11i64 ; pub const PARAM_ANIM_SPEED : i64 = 10i64 ; pub const PARAM_DAMPING : i64 = 6i64 ; pub const PARAM_HUE_VARIATION : i64 = 9i64 ; pub const PARAM_INITIAL_LINEAR_VELOCITY : i64 = 0i64 ; pub const PARAM_LINEAR_ACCEL : i64 = 3i64 ; pub const PARAM_MAX : i64 = 12i64 ; pub const PARAM_ORBIT_VELOCITY : i64 = 2i64 ; pub const PARAM_RADIAL_ACCEL : i64 = 4i64 ; pub const PARAM_SCALE : i64 = 8i64 ; pub const PARAM_TANGENTIAL_ACCEL : i64 = 5i64 ; } impl CPUParticles2D { # [doc = "Creates a new instance of this object.\n\nBecause this type is not reference counted, the lifetime of the returned object\nis *not* automatically managed.\n\nImmediately after creation, the object is owned by the caller, and can be\npassed to the engine (in which case the engine will be responsible for\ndestroying the object) or destroyed manually using `Ref::free`, or preferably\n`Ref::queue_free` if it is a `Node`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = CPUParticles2DMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "Sets this node's properties to match a given [Particles2D] node with an assigned [ParticlesMaterial]."] # [doc = ""] # [inline] pub fn convert_from_particles (& self , particles : impl AsArg < crate :: generated :: node :: Node >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . convert_from_particles ; let ret = crate :: icalls :: icallptr_void_obj (method_bind , self . this . sys () . as_ptr () , particles . as_arg_ptr ()) ; } } # [doc = "Number of particles emitted in one emission cycle."] # [doc = ""] # [inline] pub fn amount (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . get_amount ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Each particle's initial color. If [member texture] is defined, it will be multiplied by this color."] # [doc = ""] # [inline] pub fn color (& self) -> Color { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . get_color ; let ret = crate :: icalls :: icallptr_color (method_bind , self . this . sys () . as_ptr ()) ; mem :: transmute (ret) } } # [doc = "Each particle's color will vary along this [Gradient]."] # [doc = ""] # [inline] pub fn color_ramp (& self) -> Option < Ref < crate :: generated :: gradient :: Gradient , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . get_color_ramp ; let ret = crate :: icalls :: icallptr_obj (method_bind , self . this . sys () . as_ptr ()) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: gradient :: Gradient , thread_access :: Shared >> :: move_from_sys (sys)) } } # [doc = "Unit vector specifying the particles' emission direction."] # [doc = ""] # [inline] pub fn direction (& self) -> Vector2 { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . get_direction ; let ret = crate :: icalls :: icallptr_vec2 (method_bind , self . this . sys () . as_ptr ()) ; mem :: transmute (ret) } } # [doc = "Particle draw order. Uses [enum DrawOrder] values."] # [doc = ""] # [inline] pub fn draw_order (& self) -> crate :: generated :: cpu_particles_2d :: DrawOrder { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . get_draw_order ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; crate :: generated :: cpu_particles_2d :: DrawOrder (ret) } } # [doc = "Sets the [Color]s to modulate particles by when using [constant EMISSION_SHAPE_POINTS] or [constant EMISSION_SHAPE_DIRECTED_POINTS]."] # [doc = ""] # [inline] pub fn emission_colors (& self) -> ColorArray { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . get_emission_colors ; let ret = crate :: icalls :: icallptr_colorarr (method_bind , self . this . sys () . as_ptr ()) ; ColorArray :: from_sys (ret) } } # [doc = "Sets the direction the particles will be emitted in when using [constant EMISSION_SHAPE_DIRECTED_POINTS]."] # [doc = ""] # [inline] pub fn emission_normals (& self) -> Vector2Array { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . get_emission_normals ; let ret = crate :: icalls :: icallptr_vec2arr (method_bind , self . this . sys () . as_ptr ()) ; Vector2Array :: from_sys (ret) } } # [doc = "Sets the initial positions to spawn particles when using [constant EMISSION_SHAPE_POINTS] or [constant EMISSION_SHAPE_DIRECTED_POINTS]."] # [doc = ""] # [inline] pub fn emission_points (& self) -> Vector2Array { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . get_emission_points ; let ret = crate :: icalls :: icallptr_vec2arr (method_bind , self . this . sys () . as_ptr ()) ; Vector2Array :: from_sys (ret) } } # [doc = "The rectangle's extents if [member emission_shape] is set to [constant EMISSION_SHAPE_RECTANGLE]."] # [doc = ""] # [inline] pub fn emission_rect_extents (& self) -> Vector2 { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . get_emission_rect_extents ; let ret = crate :: icalls :: icallptr_vec2 (method_bind , self . this . sys () . as_ptr ()) ; mem :: transmute (ret) } } # [doc = "Particles will be emitted inside this region. See [enum EmissionShape] for possible values."] # [doc = ""] # [inline] pub fn emission_shape (& self) -> crate :: generated :: cpu_particles_2d :: EmissionShape { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . get_emission_shape ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; crate :: generated :: cpu_particles_2d :: EmissionShape (ret) } } # [doc = "The sphere's radius if [member emission_shape] is set to [constant EMISSION_SHAPE_SPHERE]."] # [doc = ""] # [inline] pub fn emission_sphere_radius (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . get_emission_sphere_radius ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "How rapidly particles in an emission cycle are emitted. If greater than `0`, there will be a gap in emissions before the next cycle begins."] # [doc = ""] # [inline] pub fn explosiveness_ratio (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . get_explosiveness_ratio ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "The particle system's frame rate is fixed to a value. For instance, changing the value to 2 will make the particles render at 2 frames per second. Note this does not slow down the simulation of the particle system itself."] # [doc = ""] # [inline] pub fn fixed_fps (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . get_fixed_fps ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "If `true`, results in fractional delta calculation which has a smoother particles display effect."] # [doc = ""] # [inline] pub fn fractional_delta (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . get_fractional_delta ; let ret = crate :: icalls :: icallptr_bool (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Gravity applied to every particle."] # [doc = ""] # [inline] pub fn gravity (& self) -> Vector2 { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . get_gravity ; let ret = crate :: icalls :: icallptr_vec2 (method_bind , self . this . sys () . as_ptr ()) ; mem :: transmute (ret) } } # [doc = "Amount of time each particle will exist."] # [doc = ""] # [inline] pub fn lifetime (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . get_lifetime ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Particle lifetime randomness ratio."] # [doc = ""] # [inline] pub fn lifetime_randomness (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . get_lifetime_randomness ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Normal map to be used for the [member texture] property.\n**Note:** Godot expects the normal map to use X+, Y-, and Z+ coordinates. See [url=http://wiki.polycount.com/wiki/Normal_Map_Technical_Details#Common_Swizzle_Coordinates]this page[/url] for a comparison of normal map coordinates expected by popular engines."] # [doc = ""] # [inline] pub fn normalmap (& self) -> Option < Ref < crate :: generated :: texture :: Texture , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . get_normalmap ; let ret = crate :: icalls :: icallptr_obj (method_bind , self . this . sys () . as_ptr ()) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: texture :: Texture , thread_access :: Shared >> :: move_from_sys (sys)) } } # [doc = "If `true`, only one emission cycle occurs. If set `true` during a cycle, emission will stop at the cycle's end."] # [doc = ""] # [inline] pub fn one_shot (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . get_one_shot ; let ret = crate :: icalls :: icallptr_bool (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Tangential acceleration applied to each particle. Tangential acceleration is perpendicular to the particle's velocity giving the particles a swirling motion."] # [doc = ""] # [inline] pub fn param (& self , param : i64) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . get_param ; let ret = crate :: icalls :: icallptr_f64_i64 (method_bind , self . this . sys () . as_ptr () , param) ; ret as _ } } # [doc = "Each particle's tangential acceleration will vary along this [Curve]."] # [doc = ""] # [inline] pub fn param_curve (& self , param : i64) -> Option < Ref < crate :: generated :: curve :: Curve , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . get_param_curve ; let ret = crate :: icalls :: icallptr_obj_i64 (method_bind , self . this . sys () . as_ptr () , param) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: curve :: Curve , thread_access :: Shared >> :: move_from_sys (sys)) } } # [doc = "Tangential acceleration randomness ratio."] # [doc = ""] # [inline] pub fn param_randomness (& self , param : i64) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . get_param_randomness ; let ret = crate :: icalls :: icallptr_f64_i64 (method_bind , self . this . sys () . as_ptr () , param) ; ret as _ } } # [doc = "Align Y axis of particle with the direction of its velocity."] # [doc = ""] # [inline] pub fn particle_flag (& self , flag : i64) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . get_particle_flag ; let ret = crate :: icalls :: icallptr_bool_i64 (method_bind , self . this . sys () . as_ptr () , flag) ; ret as _ } } # [doc = "Particle system starts as if it had already run for this many seconds."] # [doc = ""] # [inline] pub fn pre_process_time (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . get_pre_process_time ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Emission lifetime randomness ratio."] # [doc = ""] # [inline] pub fn randomness_ratio (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . get_randomness_ratio ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Particle system's running speed scaling ratio. A value of `0` can be used to pause the particles."] # [doc = ""] # [inline] pub fn speed_scale (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . get_speed_scale ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Each particle's initial direction range from `+spread` to `-spread` degrees."] # [doc = ""] # [inline] pub fn spread (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . get_spread ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Particle texture. If `null`, particles will be squares."] # [doc = ""] # [inline] pub fn texture (& self) -> Option < Ref < crate :: generated :: texture :: Texture , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . get_texture ; let ret = crate :: icalls :: icallptr_obj (method_bind , self . this . sys () . as_ptr ()) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: texture :: Texture , thread_access :: Shared >> :: move_from_sys (sys)) } } # [doc = "If `true`, particles use the parent node's coordinate space. If `false`, they use global coordinates."] # [doc = ""] # [inline] pub fn use_local_coordinates (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . get_use_local_coordinates ; let ret = crate :: icalls :: icallptr_bool (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "If `true`, particles are being emitted."] # [doc = ""] # [inline] pub fn is_emitting (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . is_emitting ; let ret = crate :: icalls :: icallptr_bool (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Restarts the particle emitter."] # [doc = ""] # [inline] pub fn restart (& self) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . restart ; let ret = crate :: icalls :: icallptr_void (method_bind , self . this . sys () . as_ptr ()) ; } } # [doc = "Number of particles emitted in one emission cycle."] # [doc = ""] # [inline] pub fn set_amount (& self , amount : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . set_amount ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , amount) ; } } # [doc = "Each particle's initial color. If [member texture] is defined, it will be multiplied by this color."] # [doc = ""] # [inline] pub fn set_color (& self , color : Color) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . set_color ; let ret = crate :: icalls :: icallptr_void_color (method_bind , self . this . sys () . as_ptr () , color) ; } } # [doc = "Each particle's color will vary along this [Gradient]."] # [doc = ""] # [inline] pub fn set_color_ramp (& self , ramp : impl AsArg < crate :: generated :: gradient :: Gradient >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . set_color_ramp ; let ret = crate :: icalls :: icallptr_void_obj (method_bind , self . this . sys () . as_ptr () , ramp . as_arg_ptr ()) ; } } # [doc = "Unit vector specifying the particles' emission direction."] # [doc = ""] # [inline] pub fn set_direction (& self , direction : Vector2) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . set_direction ; let ret = crate :: icalls :: icallptr_void_vec2 (method_bind , self . this . sys () . as_ptr () , direction) ; } } # [doc = "Particle draw order. Uses [enum DrawOrder] values."] # [doc = ""] # [inline] pub fn set_draw_order (& self , order : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . set_draw_order ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , order) ; } } # [doc = "Sets the [Color]s to modulate particles by when using [constant EMISSION_SHAPE_POINTS] or [constant EMISSION_SHAPE_DIRECTED_POINTS]."] # [doc = ""] # [inline] pub fn set_emission_colors (& self , array : ColorArray) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . set_emission_colors ; let ret = crate :: icalls :: icallptr_void_colorarr (method_bind , self . this . sys () . as_ptr () , array) ; } } # [doc = "Sets the direction the particles will be emitted in when using [constant EMISSION_SHAPE_DIRECTED_POINTS]."] # [doc = ""] # [inline] pub fn set_emission_normals (& self , array : Vector2Array) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . set_emission_normals ; let ret = crate :: icalls :: icallptr_void_vec2arr (method_bind , self . this . sys () . as_ptr () , array) ; } } # [doc = "Sets the initial positions to spawn particles when using [constant EMISSION_SHAPE_POINTS] or [constant EMISSION_SHAPE_DIRECTED_POINTS]."] # [doc = ""] # [inline] pub fn set_emission_points (& self , array : Vector2Array) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . set_emission_points ; let ret = crate :: icalls :: icallptr_void_vec2arr (method_bind , self . this . sys () . as_ptr () , array) ; } } # [doc = "The rectangle's extents if [member emission_shape] is set to [constant EMISSION_SHAPE_RECTANGLE]."] # [doc = ""] # [inline] pub fn set_emission_rect_extents (& self , extents : Vector2) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . set_emission_rect_extents ; let ret = crate :: icalls :: icallptr_void_vec2 (method_bind , self . this . sys () . as_ptr () , extents) ; } } # [doc = "Particles will be emitted inside this region. See [enum EmissionShape] for possible values."] # [doc = ""] # [inline] pub fn set_emission_shape (& self , shape : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . set_emission_shape ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , shape) ; } } # [doc = "The sphere's radius if [member emission_shape] is set to [constant EMISSION_SHAPE_SPHERE]."] # [doc = ""] # [inline] pub fn set_emission_sphere_radius (& self , radius : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . set_emission_sphere_radius ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , radius) ; } } # [doc = "If `true`, particles are being emitted."] # [doc = ""] # [inline] pub fn set_emitting (& self , emitting : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . set_emitting ; let ret = crate :: icalls :: icallptr_void_bool (method_bind , self . this . sys () . as_ptr () , emitting) ; } } # [doc = "How rapidly particles in an emission cycle are emitted. If greater than `0`, there will be a gap in emissions before the next cycle begins."] # [doc = ""] # [inline] pub fn set_explosiveness_ratio (& self , ratio : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . set_explosiveness_ratio ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , ratio) ; } } # [doc = "The particle system's frame rate is fixed to a value. For instance, changing the value to 2 will make the particles render at 2 frames per second. Note this does not slow down the simulation of the particle system itself."] # [doc = ""] # [inline] pub fn set_fixed_fps (& self , fps : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . set_fixed_fps ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , fps) ; } } # [doc = "If `true`, results in fractional delta calculation which has a smoother particles display effect."] # [doc = ""] # [inline] pub fn set_fractional_delta (& self , enable : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . set_fractional_delta ; let ret = crate :: icalls :: icallptr_void_bool (method_bind , self . this . sys () . as_ptr () , enable) ; } } # [doc = "Gravity applied to every particle."] # [doc = ""] # [inline] pub fn set_gravity (& self , accel_vec : Vector2) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . set_gravity ; let ret = crate :: icalls :: icallptr_void_vec2 (method_bind , self . this . sys () . as_ptr () , accel_vec) ; } } # [doc = "Amount of time each particle will exist."] # [doc = ""] # [inline] pub fn set_lifetime (& self , secs : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . set_lifetime ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , secs) ; } } # [doc = "Particle lifetime randomness ratio."] # [doc = ""] # [inline] pub fn set_lifetime_randomness (& self , random : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . set_lifetime_randomness ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , random) ; } } # [doc = "Normal map to be used for the [member texture] property.\n**Note:** Godot expects the normal map to use X+, Y-, and Z+ coordinates. See [url=http://wiki.polycount.com/wiki/Normal_Map_Technical_Details#Common_Swizzle_Coordinates]this page[/url] for a comparison of normal map coordinates expected by popular engines."] # [doc = ""] # [inline] pub fn set_normalmap (& self , normalmap : impl AsArg < crate :: generated :: texture :: Texture >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . set_normalmap ; let ret = crate :: icalls :: icallptr_void_obj (method_bind , self . this . sys () . as_ptr () , normalmap . as_arg_ptr ()) ; } } # [doc = "If `true`, only one emission cycle occurs. If set `true` during a cycle, emission will stop at the cycle's end."] # [doc = ""] # [inline] pub fn set_one_shot (& self , enable : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . set_one_shot ; let ret = crate :: icalls :: icallptr_void_bool (method_bind , self . this . sys () . as_ptr () , enable) ; } } # [doc = "Tangential acceleration applied to each particle. Tangential acceleration is perpendicular to the particle's velocity giving the particles a swirling motion."] # [doc = ""] # [inline] pub fn set_param (& self , param : i64 , value : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . set_param ; let ret = crate :: icalls :: icallptr_void_i64_f64 (method_bind , self . this . sys () . as_ptr () , param , value) ; } } # [doc = "Each particle's tangential acceleration will vary along this [Curve]."] # [doc = ""] # [inline] pub fn set_param_curve (& self , param : i64 , curve : impl AsArg < crate :: generated :: curve :: Curve >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . set_param_curve ; let ret = crate :: icalls :: icallptr_void_i64_obj (method_bind , self . this . sys () . as_ptr () , param , curve . as_arg_ptr ()) ; } } # [doc = "Tangential acceleration randomness ratio."] # [doc = ""] # [inline] pub fn set_param_randomness (& self , param : i64 , randomness : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . set_param_randomness ; let ret = crate :: icalls :: icallptr_void_i64_f64 (method_bind , self . this . sys () . as_ptr () , param , randomness) ; } } # [doc = "Align Y axis of particle with the direction of its velocity."] # [doc = ""] # [inline] pub fn set_particle_flag (& self , flag : i64 , enable : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . set_particle_flag ; let ret = crate :: icalls :: icallptr_void_i64_bool (method_bind , self . this . sys () . as_ptr () , flag , enable) ; } } # [doc = "Particle system starts as if it had already run for this many seconds."] # [doc = ""] # [inline] pub fn set_pre_process_time (& self , secs : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . set_pre_process_time ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , secs) ; } } # [doc = "Emission lifetime randomness ratio."] # [doc = ""] # [inline] pub fn set_randomness_ratio (& self , ratio : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . set_randomness_ratio ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , ratio) ; } } # [doc = "Particle system's running speed scaling ratio. A value of `0` can be used to pause the particles."] # [doc = ""] # [inline] pub fn set_speed_scale (& self , scale : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . set_speed_scale ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , scale) ; } } # [doc = "Each particle's initial direction range from `+spread` to `-spread` degrees."] # [doc = ""] # [inline] pub fn set_spread (& self , degrees : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . set_spread ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , degrees) ; } } # [doc = "Particle texture. If `null`, particles will be squares."] # [doc = ""] # [inline] pub fn set_texture (& self , texture : impl AsArg < crate :: generated :: texture :: Texture >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . set_texture ; let ret = crate :: icalls :: icallptr_void_obj (method_bind , self . this . sys () . as_ptr () , texture . as_arg_ptr ()) ; } } # [doc = "If `true`, particles use the parent node's coordinate space. If `false`, they use global coordinates."] # [doc = ""] # [inline] pub fn set_use_local_coordinates (& self , enable : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . set_use_local_coordinates ; let ret = crate :: icalls :: icallptr_void_bool (method_bind , self . this . sys () . as_ptr () , enable) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for CPUParticles2D { } unsafe impl GodotObject for CPUParticles2D { type RefKind = ref_kind :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "CPUParticles2D" } } impl QueueFree for CPUParticles2D { # [inline] unsafe fn godot_queue_free (obj : * mut sys :: godot_object) { let method_bind : * mut sys :: godot_method_bind = crate :: generated :: node :: NodeMethodTable :: get (get_api ()) . queue_free ; crate :: icalls :: icallptr_void (method_bind , obj) } } impl std :: ops :: Deref for CPUParticles2D { type Target = crate :: generated :: node_2d :: Node2D ; # [inline] fn deref (& self) -> & crate :: generated :: node_2d :: Node2D { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for CPUParticles2D { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: node_2d :: Node2D { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: node_2d :: Node2D > for CPUParticles2D { } unsafe impl SubClass < crate :: generated :: canvas_item :: CanvasItem > for CPUParticles2D { } unsafe impl SubClass < crate :: generated :: node :: Node > for CPUParticles2D { } unsafe impl SubClass < crate :: generated :: object :: Object > for CPUParticles2D { } impl Instanciable for CPUParticles2D { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { CPUParticles2D :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct CPUParticles2DMethodTable { pub class_constructor : sys :: godot_class_constructor , pub convert_from_particles : * mut sys :: godot_method_bind , pub get_amount : * mut sys :: godot_method_bind , pub get_color : * mut sys :: godot_method_bind , pub get_color_ramp : * mut sys :: godot_method_bind , pub get_direction : * mut sys :: godot_method_bind , pub get_draw_order : * mut sys :: godot_method_bind , pub get_emission_colors : * mut sys :: godot_method_bind , pub get_emission_normals : * mut sys :: godot_method_bind , pub get_emission_points : * mut sys :: godot_method_bind , pub get_emission_rect_extents : * mut sys :: godot_method_bind , pub get_emission_shape : * mut sys :: godot_method_bind , pub get_emission_sphere_radius : * mut sys :: godot_method_bind , pub get_explosiveness_ratio : * mut sys :: godot_method_bind , pub get_fixed_fps : * mut sys :: godot_method_bind , pub get_fractional_delta : * mut sys :: godot_method_bind , pub get_gravity : * mut sys :: godot_method_bind , pub get_lifetime : * mut sys :: godot_method_bind , pub get_lifetime_randomness : * mut sys :: godot_method_bind , pub get_normalmap : * mut sys :: godot_method_bind , pub get_one_shot : * mut sys :: godot_method_bind , pub get_param : * mut sys :: godot_method_bind , pub get_param_curve : * mut sys :: godot_method_bind , pub get_param_randomness : * mut sys :: godot_method_bind , pub get_particle_flag : * mut sys :: godot_method_bind , pub get_pre_process_time : * mut sys :: godot_method_bind , pub get_randomness_ratio : * mut sys :: godot_method_bind , pub get_speed_scale : * mut sys :: godot_method_bind , pub get_spread : * mut sys :: godot_method_bind , pub get_texture : * mut sys :: godot_method_bind , pub get_use_local_coordinates : * mut sys :: godot_method_bind , pub is_emitting : * mut sys :: godot_method_bind , pub restart : * mut sys :: godot_method_bind , pub set_amount : * mut sys :: godot_method_bind , pub set_color : * mut sys :: godot_method_bind , pub set_color_ramp : * mut sys :: godot_method_bind , pub set_direction : * mut sys :: godot_method_bind , pub set_draw_order : * mut sys :: godot_method_bind , pub set_emission_colors : * mut sys :: godot_method_bind , pub set_emission_normals : * mut sys :: godot_method_bind , pub set_emission_points : * mut sys :: godot_method_bind , pub set_emission_rect_extents : * mut sys :: godot_method_bind , pub set_emission_shape : * mut sys :: godot_method_bind , pub set_emission_sphere_radius : * mut sys :: godot_method_bind , pub set_emitting : * mut sys :: godot_method_bind , pub set_explosiveness_ratio : * mut sys :: godot_method_bind , pub set_fixed_fps : * mut sys :: godot_method_bind , pub set_fractional_delta : * mut sys :: godot_method_bind , pub set_gravity : * mut sys :: godot_method_bind , pub set_lifetime : * mut sys :: godot_method_bind , pub set_lifetime_randomness : * mut sys :: godot_method_bind , pub set_normalmap : * mut sys :: godot_method_bind , pub set_one_shot : * mut sys :: godot_method_bind , pub set_param : * mut sys :: godot_method_bind , pub set_param_curve : * mut sys :: godot_method_bind , pub set_param_randomness : * mut sys :: godot_method_bind , pub set_particle_flag : * mut sys :: godot_method_bind , pub set_pre_process_time : * mut sys :: godot_method_bind , pub set_randomness_ratio : * mut sys :: godot_method_bind , pub set_speed_scale : * mut sys :: godot_method_bind , pub set_spread : * mut sys :: godot_method_bind , pub set_texture : * mut sys :: godot_method_bind , pub set_use_local_coordinates : * mut sys :: godot_method_bind } impl CPUParticles2DMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : CPUParticles2DMethodTable = CPUParticles2DMethodTable { class_constructor : None , convert_from_particles : 0 as * mut sys :: godot_method_bind , get_amount : 0 as * mut sys :: godot_method_bind , get_color : 0 as * mut sys :: godot_method_bind , get_color_ramp : 0 as * mut sys :: godot_method_bind , get_direction : 0 as * mut sys :: godot_method_bind , get_draw_order : 0 as * mut sys :: godot_method_bind , get_emission_colors : 0 as * mut sys :: godot_method_bind , get_emission_normals : 0 as * mut sys :: godot_method_bind , get_emission_points : 0 as * mut sys :: godot_method_bind , get_emission_rect_extents : 0 as * mut sys :: godot_method_bind , get_emission_shape : 0 as * mut sys :: godot_method_bind , get_emission_sphere_radius : 0 as * mut sys :: godot_method_bind , get_explosiveness_ratio : 0 as * mut sys :: godot_method_bind , get_fixed_fps : 0 as * mut sys :: godot_method_bind , get_fractional_delta : 0 as * mut sys :: godot_method_bind , get_gravity : 0 as * mut sys :: godot_method_bind , get_lifetime : 0 as * mut sys :: godot_method_bind , get_lifetime_randomness : 0 as * mut sys :: godot_method_bind , get_normalmap : 0 as * mut sys :: godot_method_bind , get_one_shot : 0 as * mut sys :: godot_method_bind , get_param : 0 as * mut sys :: godot_method_bind , get_param_curve : 0 as * mut sys :: godot_method_bind , get_param_randomness : 0 as * mut sys :: godot_method_bind , get_particle_flag : 0 as * mut sys :: godot_method_bind , get_pre_process_time : 0 as * mut sys :: godot_method_bind , get_randomness_ratio : 0 as * mut sys :: godot_method_bind , get_speed_scale : 0 as * mut sys :: godot_method_bind , get_spread : 0 as * mut sys :: godot_method_bind , get_texture : 0 as * mut sys :: godot_method_bind , get_use_local_coordinates : 0 as * mut sys :: godot_method_bind , is_emitting : 0 as * mut sys :: godot_method_bind , restart : 0 as * mut sys :: godot_method_bind , set_amount : 0 as * mut sys :: godot_method_bind , set_color : 0 as * mut sys :: godot_method_bind , set_color_ramp : 0 as * mut sys :: godot_method_bind , set_direction : 0 as * mut sys :: godot_method_bind , set_draw_order : 0 as * mut sys :: godot_method_bind , set_emission_colors : 0 as * mut sys :: godot_method_bind , set_emission_normals : 0 as * mut sys :: godot_method_bind , set_emission_points : 0 as * mut sys :: godot_method_bind , set_emission_rect_extents : 0 as * mut sys :: godot_method_bind , set_emission_shape : 0 as * mut sys :: godot_method_bind , set_emission_sphere_radius : 0 as * mut sys :: godot_method_bind , set_emitting : 0 as * mut sys :: godot_method_bind , set_explosiveness_ratio : 0 as * mut sys :: godot_method_bind , set_fixed_fps : 0 as * mut sys :: godot_method_bind , set_fractional_delta : 0 as * mut sys :: godot_method_bind , set_gravity : 0 as * mut sys :: godot_method_bind , set_lifetime : 0 as * mut sys :: godot_method_bind , set_lifetime_randomness : 0 as * mut sys :: godot_method_bind , set_normalmap : 0 as * mut sys :: godot_method_bind , set_one_shot : 0 as * mut sys :: godot_method_bind , set_param : 0 as * mut sys :: godot_method_bind , set_param_curve : 0 as * mut sys :: godot_method_bind , set_param_randomness : 0 as * mut sys :: godot_method_bind , set_particle_flag : 0 as * mut sys :: godot_method_bind , set_pre_process_time : 0 as * mut sys :: godot_method_bind , set_randomness_ratio : 0 as * mut sys :: godot_method_bind , set_speed_scale : 0 as * mut sys :: godot_method_bind , set_spread : 0 as * mut sys :: godot_method_bind , set_texture : 0 as * mut sys :: godot_method_bind , set_use_local_coordinates : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { CPUParticles2DMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "CPUParticles2D\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . convert_from_particles = (gd_api . godot_method_bind_get_method) (class_name , "convert_from_particles\0" . as_ptr () as * const c_char) ; table . get_amount = (gd_api . godot_method_bind_get_method) (class_name , "get_amount\0" . as_ptr () as * const c_char) ; table . get_color = (gd_api . godot_method_bind_get_method) (class_name , "get_color\0" . as_ptr () as * const c_char) ; table . get_color_ramp = (gd_api . godot_method_bind_get_method) (class_name , "get_color_ramp\0" . as_ptr () as * const c_char) ; table . get_direction = (gd_api . godot_method_bind_get_method) (class_name , "get_direction\0" . as_ptr () as * const c_char) ; table . get_draw_order = (gd_api . godot_method_bind_get_method) (class_name , "get_draw_order\0" . as_ptr () as * const c_char) ; table . get_emission_colors = (gd_api . godot_method_bind_get_method) (class_name , "get_emission_colors\0" . as_ptr () as * const c_char) ; table . get_emission_normals = (gd_api . godot_method_bind_get_method) (class_name , "get_emission_normals\0" . as_ptr () as * const c_char) ; table . get_emission_points = (gd_api . godot_method_bind_get_method) (class_name , "get_emission_points\0" . as_ptr () as * const c_char) ; table . get_emission_rect_extents = (gd_api . godot_method_bind_get_method) (class_name , "get_emission_rect_extents\0" . as_ptr () as * const c_char) ; table . get_emission_shape = (gd_api . godot_method_bind_get_method) (class_name , "get_emission_shape\0" . as_ptr () as * const c_char) ; table . get_emission_sphere_radius = (gd_api . godot_method_bind_get_method) (class_name , "get_emission_sphere_radius\0" . as_ptr () as * const c_char) ; table . get_explosiveness_ratio = (gd_api . godot_method_bind_get_method) (class_name , "get_explosiveness_ratio\0" . as_ptr () as * const c_char) ; table . get_fixed_fps = (gd_api . godot_method_bind_get_method) (class_name , "get_fixed_fps\0" . as_ptr () as * const c_char) ; table . get_fractional_delta = (gd_api . godot_method_bind_get_method) (class_name , "get_fractional_delta\0" . as_ptr () as * const c_char) ; table . get_gravity = (gd_api . godot_method_bind_get_method) (class_name , "get_gravity\0" . as_ptr () as * const c_char) ; table . get_lifetime = (gd_api . godot_method_bind_get_method) (class_name , "get_lifetime\0" . as_ptr () as * const c_char) ; table . get_lifetime_randomness = (gd_api . godot_method_bind_get_method) (class_name , "get_lifetime_randomness\0" . as_ptr () as * const c_char) ; table . get_normalmap = (gd_api . godot_method_bind_get_method) (class_name , "get_normalmap\0" . as_ptr () as * const c_char) ; table . get_one_shot = (gd_api . godot_method_bind_get_method) (class_name , "get_one_shot\0" . as_ptr () as * const c_char) ; table . get_param = (gd_api . godot_method_bind_get_method) (class_name , "get_param\0" . as_ptr () as * const c_char) ; table . get_param_curve = (gd_api . godot_method_bind_get_method) (class_name , "get_param_curve\0" . as_ptr () as * const c_char) ; table . get_param_randomness = (gd_api . godot_method_bind_get_method) (class_name , "get_param_randomness\0" . as_ptr () as * const c_char) ; table . get_particle_flag = (gd_api . godot_method_bind_get_method) (class_name , "get_particle_flag\0" . as_ptr () as * const c_char) ; table . get_pre_process_time = (gd_api . godot_method_bind_get_method) (class_name , "get_pre_process_time\0" . as_ptr () as * const c_char) ; table . get_randomness_ratio = (gd_api . godot_method_bind_get_method) (class_name , "get_randomness_ratio\0" . as_ptr () as * const c_char) ; table . get_speed_scale = (gd_api . godot_method_bind_get_method) (class_name , "get_speed_scale\0" . as_ptr () as * const c_char) ; table . get_spread = (gd_api . godot_method_bind_get_method) (class_name , "get_spread\0" . as_ptr () as * const c_char) ; table . get_texture = (gd_api . godot_method_bind_get_method) (class_name , "get_texture\0" . as_ptr () as * const c_char) ; table . get_use_local_coordinates = (gd_api . godot_method_bind_get_method) (class_name , "get_use_local_coordinates\0" . as_ptr () as * const c_char) ; table . is_emitting = (gd_api . godot_method_bind_get_method) (class_name , "is_emitting\0" . as_ptr () as * const c_char) ; table . restart = (gd_api . godot_method_bind_get_method) (class_name , "restart\0" . as_ptr () as * const c_char) ; table . set_amount = (gd_api . godot_method_bind_get_method) (class_name , "set_amount\0" . as_ptr () as * const c_char) ; table . set_color = (gd_api . godot_method_bind_get_method) (class_name , "set_color\0" . as_ptr () as * const c_char) ; table . set_color_ramp = (gd_api . godot_method_bind_get_method) (class_name , "set_color_ramp\0" . as_ptr () as * const c_char) ; table . set_direction = (gd_api . godot_method_bind_get_method) (class_name , "set_direction\0" . as_ptr () as * const c_char) ; table . set_draw_order = (gd_api . godot_method_bind_get_method) (class_name , "set_draw_order\0" . as_ptr () as * const c_char) ; table . set_emission_colors = (gd_api . godot_method_bind_get_method) (class_name , "set_emission_colors\0" . as_ptr () as * const c_char) ; table . set_emission_normals = (gd_api . godot_method_bind_get_method) (class_name , "set_emission_normals\0" . as_ptr () as * const c_char) ; table . set_emission_points = (gd_api . godot_method_bind_get_method) (class_name , "set_emission_points\0" . as_ptr () as * const c_char) ; table . set_emission_rect_extents = (gd_api . godot_method_bind_get_method) (class_name , "set_emission_rect_extents\0" . as_ptr () as * const c_char) ; table . set_emission_shape = (gd_api . godot_method_bind_get_method) (class_name , "set_emission_shape\0" . as_ptr () as * const c_char) ; table . set_emission_sphere_radius = (gd_api . godot_method_bind_get_method) (class_name , "set_emission_sphere_radius\0" . as_ptr () as * const c_char) ; table . set_emitting = (gd_api . godot_method_bind_get_method) (class_name , "set_emitting\0" . as_ptr () as * const c_char) ; table . set_explosiveness_ratio = (gd_api . godot_method_bind_get_method) (class_name , "set_explosiveness_ratio\0" . as_ptr () as * const c_char) ; table . set_fixed_fps = (gd_api . godot_method_bind_get_method) (class_name , "set_fixed_fps\0" . as_ptr () as * const c_char) ; table . set_fractional_delta = (gd_api . godot_method_bind_get_method) (class_name , "set_fractional_delta\0" . as_ptr () as * const c_char) ; table . set_gravity = (gd_api . godot_method_bind_get_method) (class_name , "set_gravity\0" . as_ptr () as * const c_char) ; table . set_lifetime = (gd_api . godot_method_bind_get_method) (class_name , "set_lifetime\0" . as_ptr () as * const c_char) ; table . set_lifetime_randomness = (gd_api . godot_method_bind_get_method) (class_name , "set_lifetime_randomness\0" . as_ptr () as * const c_char) ; table . set_normalmap = (gd_api . godot_method_bind_get_method) (class_name , "set_normalmap\0" . as_ptr () as * const c_char) ; table . set_one_shot = (gd_api . godot_method_bind_get_method) (class_name , "set_one_shot\0" . as_ptr () as * const c_char) ; table . set_param = (gd_api . godot_method_bind_get_method) (class_name , "set_param\0" . as_ptr () as * const c_char) ; table . set_param_curve = (gd_api . godot_method_bind_get_method) (class_name , "set_param_curve\0" . as_ptr () as * const c_char) ; table . set_param_randomness = (gd_api . godot_method_bind_get_method) (class_name , "set_param_randomness\0" . as_ptr () as * const c_char) ; table . set_particle_flag = (gd_api . godot_method_bind_get_method) (class_name , "set_particle_flag\0" . as_ptr () as * const c_char) ; table . set_pre_process_time = (gd_api . godot_method_bind_get_method) (class_name , "set_pre_process_time\0" . as_ptr () as * const c_char) ; table . set_randomness_ratio = (gd_api . godot_method_bind_get_method) (class_name , "set_randomness_ratio\0" . as_ptr () as * const c_char) ; table . set_speed_scale = (gd_api . godot_method_bind_get_method) (class_name , "set_speed_scale\0" . as_ptr () as * const c_char) ; table . set_spread = (gd_api . godot_method_bind_get_method) (class_name , "set_spread\0" . as_ptr () as * const c_char) ; table . set_texture = (gd_api . godot_method_bind_get_method) (class_name , "set_texture\0" . as_ptr () as * const c_char) ; table . set_use_local_coordinates = (gd_api . godot_method_bind_get_method) (class_name , "set_use_local_coordinates\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:178:4537 [INFO] [stdout] | [INFO] [stdout] 178 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 178 | # [doc = "`core class WebSocketMultiplayerPeer` inherits `NetworkedMultiplayerPeer` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_websocketmultiplayerpeer.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nWebSocketMultiplayerPeer inherits methods from:\n - [NetworkedMultiplayerPeer](struct.NetworkedMultiplayerPeer.html)\n - [PacketPeer](struct.PacketPeer.html)\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct WebSocketMultiplayerPeer { this : RawObject < Self > , } impl WebSocketMultiplayerPeer { # [doc = ""] # [doc = ""] # [inline] pub fn get_peer (& self , peer_id : i64) -> Option < Ref < crate :: generated :: web_socket_peer :: WebSocketPeer , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = WebSocketMultiplayerPeerMethodTable :: get (get_api ()) . get_peer ; let ret = crate :: icalls :: icallptr_obj_i64 (method_bind , self . this . sys () . as_ptr () , peer_id) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: web_socket_peer :: WebSocketPeer , thread_access :: Shared >> :: move_from_sys (sys)) } } # [doc = ""] # [doc = ""] # [inline] pub fn set_buffers (& self , input_buffer_size_kb : i64 , input_max_packets : i64 , output_buffer_size_kb : i64 , output_max_packets : i64) -> GodotResult { unsafe { let method_bind : * mut sys :: godot_method_bind = WebSocketMultiplayerPeerMethodTable :: get (get_api ()) . set_buffers ; let ret = crate :: icalls :: icallptr_i64_i64_i64_i64_i64 (method_bind , self . this . sys () . as_ptr () , input_buffer_size_kb , input_max_packets , output_buffer_size_kb , output_max_packets) ; GodotError :: result_from_sys (ret as _) } } } impl gdnative_core :: private :: godot_object :: Sealed for WebSocketMultiplayerPeer { } unsafe impl GodotObject for WebSocketMultiplayerPeer { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "WebSocketMultiplayerPeer" } } impl std :: ops :: Deref for WebSocketMultiplayerPeer { type Target = crate :: generated :: networked_multiplayer_peer :: NetworkedMultiplayerPeer ; # [inline] fn deref (& self) -> & crate :: generated :: networked_multiplayer_peer :: NetworkedMultiplayerPeer { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for WebSocketMultiplayerPeer { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: networked_multiplayer_peer :: NetworkedMultiplayerPeer { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: networked_multiplayer_peer :: NetworkedMultiplayerPeer > for WebSocketMultiplayerPeer { } unsafe impl SubClass < crate :: generated :: packet_peer :: PacketPeer > for WebSocketMultiplayerPeer { } unsafe impl SubClass < crate :: generated :: reference :: Reference > for WebSocketMultiplayerPeer { } unsafe impl SubClass < crate :: generated :: object :: Object > for WebSocketMultiplayerPeer { } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct WebSocketMultiplayerPeerMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_peer : * mut sys :: godot_method_bind , pub set_buffers : * mut sys :: godot_method_bind } impl WebSocketMultiplayerPeerMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : WebSocketMultiplayerPeerMethodTable = WebSocketMultiplayerPeerMethodTable { class_constructor : None , get_peer : 0 as * mut sys :: godot_method_bind , set_buffers : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { WebSocketMultiplayerPeerMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "WebSocketMultiplayerPeer\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_peer = (gd_api . godot_method_bind_get_method) (class_name , "get_peer\0" . as_ptr () as * const c_char) ; table . set_buffers = (gd_api . godot_method_bind_get_method) (class_name , "set_buffers\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:184:28818 [INFO] [stdout] | [INFO] [stdout] 184 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 184 | # [doc = "`core singleton class AudioServer` inherits `Object` (unsafe)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_audioserver.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = ""] # [doc = "\n## Class hierarchy\n\nAudioServer inherits methods from:\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct AudioServer { this : RawObject < Self > , } # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct SpeakerMode (pub i64) ; impl SpeakerMode { pub const MODE_STEREO : SpeakerMode = SpeakerMode (0i64) ; pub const SURROUND_31 : SpeakerMode = SpeakerMode (1i64) ; pub const SURROUND_51 : SpeakerMode = SpeakerMode (2i64) ; pub const SURROUND_71 : SpeakerMode = SpeakerMode (3i64) ; } impl From < i64 > for SpeakerMode { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < SpeakerMode > for i64 { # [inline] fn from (v : SpeakerMode) -> Self { v . 0 } } # [doc = "Constants"] # [allow (non_upper_case_globals)] impl AudioServer { pub const SPEAKER_MODE_STEREO : i64 = 0i64 ; pub const SPEAKER_SURROUND_31 : i64 = 1i64 ; pub const SPEAKER_SURROUND_51 : i64 = 2i64 ; pub const SPEAKER_SURROUND_71 : i64 = 3i64 ; } impl AudioServer { # [doc = "Returns a reference to the singleton instance."] # [inline] pub fn godot_singleton () -> & 'static Self { unsafe { let this = (get_api () . godot_global_get_singleton) ("AudioServer\0" . as_ptr () as * mut _) ; let this = ptr :: NonNull :: new (this) . expect ("singleton should not be null") ; let this = RawObject :: from_sys_ref_unchecked :: < 'static > (this) ; Self :: cast_ref (this) } } # [doc = "Adds a bus at `at_position`.\n# Default Arguments\n* `at_position` - `-1`"] # [doc = ""] # [inline] pub fn add_bus (& self , at_position : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioServerMethodTable :: get (get_api ()) . add_bus ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , at_position) ; } } # [doc = "Adds an [AudioEffect] effect to the bus `bus_idx` at `at_position`.\n# Default Arguments\n* `at_position` - `-1`"] # [doc = ""] # [inline] pub fn add_bus_effect (& self , bus_idx : i64 , effect : impl AsArg < crate :: generated :: audio_effect :: AudioEffect > , at_position : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioServerMethodTable :: get (get_api ()) . add_bus_effect ; let ret = crate :: icalls :: icallptr_void_i64_obj_i64 (method_bind , self . this . sys () . as_ptr () , bus_idx , effect . as_arg_ptr () , at_position) ; } } # [doc = "Name of the current device for audio input (see [method capture_get_device_list])."] # [doc = ""] # [inline] pub fn capture_get_device (& self) -> GodotString { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioServerMethodTable :: get (get_api ()) . capture_get_device ; let ret = crate :: icalls :: icallptr_str (method_bind , self . this . sys () . as_ptr ()) ; GodotString :: from_sys (ret) } } # [doc = "Returns the names of all audio input devices detected on the system."] # [doc = ""] # [inline] pub fn capture_get_device_list (& self) -> VariantArray { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioServerMethodTable :: get (get_api ()) . capture_get_device_list ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < VariantArray > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Sets which audio input device is used for audio capture."] # [doc = ""] # [inline] pub fn capture_set_device (& self , name : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioServerMethodTable :: get (get_api ()) . capture_set_device ; let ret = crate :: icalls :: icallptr_void_str (method_bind , self . this . sys () . as_ptr () , name . into ()) ; } } # [doc = "Generates an [AudioBusLayout] using the available buses and effects."] # [doc = ""] # [inline] pub fn generate_bus_layout (& self) -> Option < Ref < crate :: generated :: audio_bus_layout :: AudioBusLayout , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioServerMethodTable :: get (get_api ()) . generate_bus_layout ; let ret = crate :: icalls :: icallptr_obj (method_bind , self . this . sys () . as_ptr ()) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: audio_bus_layout :: AudioBusLayout , thread_access :: Shared >> :: move_from_sys (sys)) } } # [doc = "Returns the amount of channels of the bus at index `bus_idx`."] # [doc = ""] # [inline] pub fn get_bus_channels (& self , bus_idx : i64) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioServerMethodTable :: get (get_api ()) . get_bus_channels ; let ret = crate :: icalls :: icallptr_i64_i64 (method_bind , self . this . sys () . as_ptr () , bus_idx) ; ret as _ } } # [doc = "Number of available audio buses."] # [doc = ""] # [inline] pub fn bus_count (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioServerMethodTable :: get (get_api ()) . get_bus_count ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Returns the [AudioEffect] at position `effect_idx` in bus `bus_idx`."] # [doc = ""] # [inline] pub fn get_bus_effect (& self , bus_idx : i64 , effect_idx : i64) -> Option < Ref < crate :: generated :: audio_effect :: AudioEffect , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioServerMethodTable :: get (get_api ()) . get_bus_effect ; let ret = crate :: icalls :: icallptr_obj_i64_i64 (method_bind , self . this . sys () . as_ptr () , bus_idx , effect_idx) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: audio_effect :: AudioEffect , thread_access :: Shared >> :: move_from_sys (sys)) } } # [doc = "Returns the number of effects on the bus at `bus_idx`."] # [doc = ""] # [inline] pub fn get_bus_effect_count (& self , bus_idx : i64) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioServerMethodTable :: get (get_api ()) . get_bus_effect_count ; let ret = crate :: icalls :: icallptr_i64_i64 (method_bind , self . this . sys () . as_ptr () , bus_idx) ; ret as _ } } # [doc = "Returns the [AudioEffectInstance] assigned to the given bus and effect indices (and optionally channel).\n# Default Arguments\n* `channel` - `0`"] # [doc = ""] # [inline] pub fn get_bus_effect_instance (& self , bus_idx : i64 , effect_idx : i64 , channel : i64) -> Option < Ref < crate :: generated :: audio_effect_instance :: AudioEffectInstance , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioServerMethodTable :: get (get_api ()) . get_bus_effect_instance ; let ret = crate :: icalls :: icallptr_obj_i64_i64_i64 (method_bind , self . this . sys () . as_ptr () , bus_idx , effect_idx , channel) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: audio_effect_instance :: AudioEffectInstance , thread_access :: Shared >> :: move_from_sys (sys)) } } # [doc = "Returns the index of the bus with the name `bus_name`."] # [doc = ""] # [inline] pub fn get_bus_index (& self , bus_name : impl Into < GodotString >) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioServerMethodTable :: get (get_api ()) . get_bus_index ; let ret = crate :: icalls :: icallptr_i64_str (method_bind , self . this . sys () . as_ptr () , bus_name . into ()) ; ret as _ } } # [doc = "Returns the name of the bus with the index `bus_idx`."] # [doc = ""] # [inline] pub fn get_bus_name (& self , bus_idx : i64) -> GodotString { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioServerMethodTable :: get (get_api ()) . get_bus_name ; let ret = crate :: icalls :: icallptr_str_i64 (method_bind , self . this . sys () . as_ptr () , bus_idx) ; GodotString :: from_sys (ret) } } # [doc = "Returns the peak volume of the left speaker at bus index `bus_idx` and channel index `channel`."] # [doc = ""] # [inline] pub fn get_bus_peak_volume_left_db (& self , bus_idx : i64 , channel : i64) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioServerMethodTable :: get (get_api ()) . get_bus_peak_volume_left_db ; let ret = crate :: icalls :: icallptr_f64_i64_i64 (method_bind , self . this . sys () . as_ptr () , bus_idx , channel) ; ret as _ } } # [doc = "Returns the peak volume of the right speaker at bus index `bus_idx` and channel index `channel`."] # [doc = ""] # [inline] pub fn get_bus_peak_volume_right_db (& self , bus_idx : i64 , channel : i64) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioServerMethodTable :: get (get_api ()) . get_bus_peak_volume_right_db ; let ret = crate :: icalls :: icallptr_f64_i64_i64 (method_bind , self . this . sys () . as_ptr () , bus_idx , channel) ; ret as _ } } # [doc = "Returns the name of the bus that the bus at index `bus_idx` sends to."] # [doc = ""] # [inline] pub fn get_bus_send (& self , bus_idx : i64) -> GodotString { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioServerMethodTable :: get (get_api ()) . get_bus_send ; let ret = crate :: icalls :: icallptr_str_i64 (method_bind , self . this . sys () . as_ptr () , bus_idx) ; GodotString :: from_sys (ret) } } # [doc = "Returns the volume of the bus at index `bus_idx` in dB."] # [doc = ""] # [inline] pub fn get_bus_volume_db (& self , bus_idx : i64) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioServerMethodTable :: get (get_api ()) . get_bus_volume_db ; let ret = crate :: icalls :: icallptr_f64_i64 (method_bind , self . this . sys () . as_ptr () , bus_idx) ; ret as _ } } # [doc = "Name of the current device for audio output (see [method get_device_list])."] # [doc = ""] # [inline] pub fn device (& self) -> GodotString { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioServerMethodTable :: get (get_api ()) . get_device ; let ret = crate :: icalls :: icallptr_str (method_bind , self . this . sys () . as_ptr ()) ; GodotString :: from_sys (ret) } } # [doc = "Returns the names of all audio devices detected on the system."] # [doc = ""] # [inline] pub fn get_device_list (& self) -> VariantArray { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioServerMethodTable :: get (get_api ()) . get_device_list ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < VariantArray > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Scales the rate at which audio is played (i.e. setting it to `0.5` will make the audio be played twice as fast)."] # [doc = ""] # [inline] pub fn global_rate_scale (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioServerMethodTable :: get (get_api ()) . get_global_rate_scale ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Returns the sample rate at the output of the [AudioServer]."] # [doc = ""] # [inline] pub fn get_mix_rate (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioServerMethodTable :: get (get_api ()) . get_mix_rate ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Returns the audio driver's output latency."] # [doc = ""] # [inline] pub fn get_output_latency (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioServerMethodTable :: get (get_api ()) . get_output_latency ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Returns the speaker configuration."] # [doc = ""] # [inline] pub fn get_speaker_mode (& self) -> crate :: generated :: audio_server :: SpeakerMode { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioServerMethodTable :: get (get_api ()) . get_speaker_mode ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; crate :: generated :: audio_server :: SpeakerMode (ret) } } # [doc = "Returns the relative time since the last mix occurred."] # [doc = ""] # [inline] pub fn get_time_since_last_mix (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioServerMethodTable :: get (get_api ()) . get_time_since_last_mix ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Returns the relative time until the next mix occurs."] # [doc = ""] # [inline] pub fn get_time_to_next_mix (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioServerMethodTable :: get (get_api ()) . get_time_to_next_mix ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "If `true`, the bus at index `bus_idx` is bypassing effects."] # [doc = ""] # [inline] pub fn is_bus_bypassing_effects (& self , bus_idx : i64) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioServerMethodTable :: get (get_api ()) . is_bus_bypassing_effects ; let ret = crate :: icalls :: icallptr_bool_i64 (method_bind , self . this . sys () . as_ptr () , bus_idx) ; ret as _ } } # [doc = "If `true`, the effect at index `effect_idx` on the bus at index `bus_idx` is enabled."] # [doc = ""] # [inline] pub fn is_bus_effect_enabled (& self , bus_idx : i64 , effect_idx : i64) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioServerMethodTable :: get (get_api ()) . is_bus_effect_enabled ; let ret = crate :: icalls :: icallptr_bool_i64_i64 (method_bind , self . this . sys () . as_ptr () , bus_idx , effect_idx) ; ret as _ } } # [doc = "If `true`, the bus at index `bus_idx` is muted."] # [doc = ""] # [inline] pub fn is_bus_mute (& self , bus_idx : i64) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioServerMethodTable :: get (get_api ()) . is_bus_mute ; let ret = crate :: icalls :: icallptr_bool_i64 (method_bind , self . this . sys () . as_ptr () , bus_idx) ; ret as _ } } # [doc = "If `true`, the bus at index `bus_idx` is in solo mode."] # [doc = ""] # [inline] pub fn is_bus_solo (& self , bus_idx : i64) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioServerMethodTable :: get (get_api ()) . is_bus_solo ; let ret = crate :: icalls :: icallptr_bool_i64 (method_bind , self . this . sys () . as_ptr () , bus_idx) ; ret as _ } } # [doc = "Locks the audio driver's main loop.\n**Note:** Remember to unlock it afterwards."] # [doc = ""] # [inline] pub fn lock (& self) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioServerMethodTable :: get (get_api ()) . lock ; let ret = crate :: icalls :: icallptr_void (method_bind , self . this . sys () . as_ptr ()) ; } } # [doc = "Moves the bus from index `index` to index `to_index`."] # [doc = ""] # [inline] pub fn move_bus (& self , index : i64 , to_index : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioServerMethodTable :: get (get_api ()) . move_bus ; let ret = crate :: icalls :: icallptr_void_i64_i64 (method_bind , self . this . sys () . as_ptr () , index , to_index) ; } } # [doc = "Removes the bus at index `index`."] # [doc = ""] # [inline] pub fn remove_bus (& self , index : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioServerMethodTable :: get (get_api ()) . remove_bus ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , index) ; } } # [doc = "Removes the effect at index `effect_idx` from the bus at index `bus_idx`."] # [doc = ""] # [inline] pub fn remove_bus_effect (& self , bus_idx : i64 , effect_idx : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioServerMethodTable :: get (get_api ()) . remove_bus_effect ; let ret = crate :: icalls :: icallptr_void_i64_i64 (method_bind , self . this . sys () . as_ptr () , bus_idx , effect_idx) ; } } # [doc = "If `true`, the bus at index `bus_idx` is bypassing effects."] # [doc = ""] # [inline] pub fn set_bus_bypass_effects (& self , bus_idx : i64 , enable : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioServerMethodTable :: get (get_api ()) . set_bus_bypass_effects ; let ret = crate :: icalls :: icallptr_void_i64_bool (method_bind , self . this . sys () . as_ptr () , bus_idx , enable) ; } } # [doc = "Number of available audio buses."] # [doc = ""] # [inline] pub fn set_bus_count (& self , amount : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioServerMethodTable :: get (get_api ()) . set_bus_count ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , amount) ; } } # [doc = "If `true`, the effect at index `effect_idx` on the bus at index `bus_idx` is enabled."] # [doc = ""] # [inline] pub fn set_bus_effect_enabled (& self , bus_idx : i64 , effect_idx : i64 , enabled : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioServerMethodTable :: get (get_api ()) . set_bus_effect_enabled ; let ret = crate :: icalls :: icallptr_void_i64_i64_bool (method_bind , self . this . sys () . as_ptr () , bus_idx , effect_idx , enabled) ; } } # [doc = "Overwrites the currently used [AudioBusLayout]."] # [doc = ""] # [inline] pub fn set_bus_layout (& self , bus_layout : impl AsArg < crate :: generated :: audio_bus_layout :: AudioBusLayout >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioServerMethodTable :: get (get_api ()) . set_bus_layout ; let ret = crate :: icalls :: icallptr_void_obj (method_bind , self . this . sys () . as_ptr () , bus_layout . as_arg_ptr ()) ; } } # [doc = "If `true`, the bus at index `bus_idx` is muted."] # [doc = ""] # [inline] pub fn set_bus_mute (& self , bus_idx : i64 , enable : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioServerMethodTable :: get (get_api ()) . set_bus_mute ; let ret = crate :: icalls :: icallptr_void_i64_bool (method_bind , self . this . sys () . as_ptr () , bus_idx , enable) ; } } # [doc = "Sets the name of the bus at index `bus_idx` to `name`."] # [doc = ""] # [inline] pub fn set_bus_name (& self , bus_idx : i64 , name : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioServerMethodTable :: get (get_api ()) . set_bus_name ; let ret = crate :: icalls :: icallptr_void_i64_str (method_bind , self . this . sys () . as_ptr () , bus_idx , name . into ()) ; } } # [doc = "Connects the output of the bus at `bus_idx` to the bus named `send`."] # [doc = ""] # [inline] pub fn set_bus_send (& self , bus_idx : i64 , send : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioServerMethodTable :: get (get_api ()) . set_bus_send ; let ret = crate :: icalls :: icallptr_void_i64_str (method_bind , self . this . sys () . as_ptr () , bus_idx , send . into ()) ; } } # [doc = "If `true`, the bus at index `bus_idx` is in solo mode."] # [doc = ""] # [inline] pub fn set_bus_solo (& self , bus_idx : i64 , enable : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioServerMethodTable :: get (get_api ()) . set_bus_solo ; let ret = crate :: icalls :: icallptr_void_i64_bool (method_bind , self . this . sys () . as_ptr () , bus_idx , enable) ; } } # [doc = "Sets the volume of the bus at index `bus_idx` to `volume_db`."] # [doc = ""] # [inline] pub fn set_bus_volume_db (& self , bus_idx : i64 , volume_db : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioServerMethodTable :: get (get_api ()) . set_bus_volume_db ; let ret = crate :: icalls :: icallptr_void_i64_f64 (method_bind , self . this . sys () . as_ptr () , bus_idx , volume_db) ; } } # [doc = "Name of the current device for audio output (see [method get_device_list])."] # [doc = ""] # [inline] pub fn set_device (& self , device : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioServerMethodTable :: get (get_api ()) . set_device ; let ret = crate :: icalls :: icallptr_void_str (method_bind , self . this . sys () . as_ptr () , device . into ()) ; } } # [doc = "Scales the rate at which audio is played (i.e. setting it to `0.5` will make the audio be played twice as fast)."] # [doc = ""] # [inline] pub fn set_global_rate_scale (& self , scale : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioServerMethodTable :: get (get_api ()) . set_global_rate_scale ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , scale) ; } } # [doc = "Swaps the position of two effects in bus `bus_idx`."] # [doc = ""] # [inline] pub fn swap_bus_effects (& self , bus_idx : i64 , effect_idx : i64 , by_effect_idx : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioServerMethodTable :: get (get_api ()) . swap_bus_effects ; let ret = crate :: icalls :: icallptr_void_i64_i64_i64 (method_bind , self . this . sys () . as_ptr () , bus_idx , effect_idx , by_effect_idx) ; } } # [doc = "Unlocks the audio driver's main loop. (After locking it, you should always unlock it.)"] # [doc = ""] # [inline] pub fn unlock (& self) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioServerMethodTable :: get (get_api ()) . unlock ; let ret = crate :: icalls :: icallptr_void (method_bind , self . this . sys () . as_ptr ()) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for AudioServer { } unsafe impl GodotObject for AudioServer { type RefKind = ref_kind :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "AudioServer" } } impl std :: ops :: Deref for AudioServer { type Target = crate :: generated :: object :: Object ; # [inline] fn deref (& self) -> & crate :: generated :: object :: Object { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AudioServer { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: object :: Object { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: object :: Object > for AudioServer { } unsafe impl Send for AudioServer { } unsafe impl Sync for AudioServer { } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AudioServerMethodTable { pub class_constructor : sys :: godot_class_constructor , pub add_bus : * mut sys :: godot_method_bind , pub add_bus_effect : * mut sys :: godot_method_bind , pub capture_get_device : * mut sys :: godot_method_bind , pub capture_get_device_list : * mut sys :: godot_method_bind , pub capture_set_device : * mut sys :: godot_method_bind , pub generate_bus_layout : * mut sys :: godot_method_bind , pub get_bus_channels : * mut sys :: godot_method_bind , pub get_bus_count : * mut sys :: godot_method_bind , pub get_bus_effect : * mut sys :: godot_method_bind , pub get_bus_effect_count : * mut sys :: godot_method_bind , pub get_bus_effect_instance : * mut sys :: godot_method_bind , pub get_bus_index : * mut sys :: godot_method_bind , pub get_bus_name : * mut sys :: godot_method_bind , pub get_bus_peak_volume_left_db : * mut sys :: godot_method_bind , pub get_bus_peak_volume_right_db : * mut sys :: godot_method_bind , pub get_bus_send : * mut sys :: godot_method_bind , pub get_bus_volume_db : * mut sys :: godot_method_bind , pub get_device : * mut sys :: godot_method_bind , pub get_device_list : * mut sys :: godot_method_bind , pub get_global_rate_scale : * mut sys :: godot_method_bind , pub get_mix_rate : * mut sys :: godot_method_bind , pub get_output_latency : * mut sys :: godot_method_bind , pub get_speaker_mode : * mut sys :: godot_method_bind , pub get_time_since_last_mix : * mut sys :: godot_method_bind , pub get_time_to_next_mix : * mut sys :: godot_method_bind , pub is_bus_bypassing_effects : * mut sys :: godot_method_bind , pub is_bus_effect_enabled : * mut sys :: godot_method_bind , pub is_bus_mute : * mut sys :: godot_method_bind , pub is_bus_solo : * mut sys :: godot_method_bind , pub lock : * mut sys :: godot_method_bind , pub move_bus : * mut sys :: godot_method_bind , pub remove_bus : * mut sys :: godot_method_bind , pub remove_bus_effect : * mut sys :: godot_method_bind , pub set_bus_bypass_effects : * mut sys :: godot_method_bind , pub set_bus_count : * mut sys :: godot_method_bind , pub set_bus_effect_enabled : * mut sys :: godot_method_bind , pub set_bus_layout : * mut sys :: godot_method_bind , pub set_bus_mute : * mut sys :: godot_method_bind , pub set_bus_name : * mut sys :: godot_method_bind , pub set_bus_send : * mut sys :: godot_method_bind , pub set_bus_solo : * mut sys :: godot_method_bind , pub set_bus_volume_db : * mut sys :: godot_method_bind , pub set_device : * mut sys :: godot_method_bind , pub set_global_rate_scale : * mut sys :: godot_method_bind , pub swap_bus_effects : * mut sys :: godot_method_bind , pub unlock : * mut sys :: godot_method_bind } impl AudioServerMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AudioServerMethodTable = AudioServerMethodTable { class_constructor : None , add_bus : 0 as * mut sys :: godot_method_bind , add_bus_effect : 0 as * mut sys :: godot_method_bind , capture_get_device : 0 as * mut sys :: godot_method_bind , capture_get_device_list : 0 as * mut sys :: godot_method_bind , capture_set_device : 0 as * mut sys :: godot_method_bind , generate_bus_layout : 0 as * mut sys :: godot_method_bind , get_bus_channels : 0 as * mut sys :: godot_method_bind , get_bus_count : 0 as * mut sys :: godot_method_bind , get_bus_effect : 0 as * mut sys :: godot_method_bind , get_bus_effect_count : 0 as * mut sys :: godot_method_bind , get_bus_effect_instance : 0 as * mut sys :: godot_method_bind , get_bus_index : 0 as * mut sys :: godot_method_bind , get_bus_name : 0 as * mut sys :: godot_method_bind , get_bus_peak_volume_left_db : 0 as * mut sys :: godot_method_bind , get_bus_peak_volume_right_db : 0 as * mut sys :: godot_method_bind , get_bus_send : 0 as * mut sys :: godot_method_bind , get_bus_volume_db : 0 as * mut sys :: godot_method_bind , get_device : 0 as * mut sys :: godot_method_bind , get_device_list : 0 as * mut sys :: godot_method_bind , get_global_rate_scale : 0 as * mut sys :: godot_method_bind , get_mix_rate : 0 as * mut sys :: godot_method_bind , get_output_latency : 0 as * mut sys :: godot_method_bind , get_speaker_mode : 0 as * mut sys :: godot_method_bind , get_time_since_last_mix : 0 as * mut sys :: godot_method_bind , get_time_to_next_mix : 0 as * mut sys :: godot_method_bind , is_bus_bypassing_effects : 0 as * mut sys :: godot_method_bind , is_bus_effect_enabled : 0 as * mut sys :: godot_method_bind , is_bus_mute : 0 as * mut sys :: godot_method_bind , is_bus_solo : 0 as * mut sys :: godot_method_bind , lock : 0 as * mut sys :: godot_method_bind , move_bus : 0 as * mut sys :: godot_method_bind , remove_bus : 0 as * mut sys :: godot_method_bind , remove_bus_effect : 0 as * mut sys :: godot_method_bind , set_bus_bypass_effects : 0 as * mut sys :: godot_method_bind , set_bus_count : 0 as * mut sys :: godot_method_bind , set_bus_effect_enabled : 0 as * mut sys :: godot_method_bind , set_bus_layout : 0 as * mut sys :: godot_method_bind , set_bus_mute : 0 as * mut sys :: godot_method_bind , set_bus_name : 0 as * mut sys :: godot_method_bind , set_bus_send : 0 as * mut sys :: godot_method_bind , set_bus_solo : 0 as * mut sys :: godot_method_bind , set_bus_volume_db : 0 as * mut sys :: godot_method_bind , set_device : 0 as * mut sys :: godot_method_bind , set_global_rate_scale : 0 as * mut sys :: godot_method_bind , swap_bus_effects : 0 as * mut sys :: godot_method_bind , unlock : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { AudioServerMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AudioServer\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . add_bus = (gd_api . godot_method_bind_get_method) (class_name , "add_bus\0" . as_ptr () as * const c_char) ; table . add_bus_effect = (gd_api . godot_method_bind_get_method) (class_name , "add_bus_effect\0" . as_ptr () as * const c_char) ; table . capture_get_device = (gd_api . godot_method_bind_get_method) (class_name , "capture_get_device\0" . as_ptr () as * const c_char) ; table . capture_get_device_list = (gd_api . godot_method_bind_get_method) (class_name , "capture_get_device_list\0" . as_ptr () as * const c_char) ; table . capture_set_device = (gd_api . godot_method_bind_get_method) (class_name , "capture_set_device\0" . as_ptr () as * const c_char) ; table . generate_bus_layout = (gd_api . godot_method_bind_get_method) (class_name , "generate_bus_layout\0" . as_ptr () as * const c_char) ; table . get_bus_channels = (gd_api . godot_method_bind_get_method) (class_name , "get_bus_channels\0" . as_ptr () as * const c_char) ; table . get_bus_count = (gd_api . godot_method_bind_get_method) (class_name , "get_bus_count\0" . as_ptr () as * const c_char) ; table . get_bus_effect = (gd_api . godot_method_bind_get_method) (class_name , "get_bus_effect\0" . as_ptr () as * const c_char) ; table . get_bus_effect_count = (gd_api . godot_method_bind_get_method) (class_name , "get_bus_effect_count\0" . as_ptr () as * const c_char) ; table . get_bus_effect_instance = (gd_api . godot_method_bind_get_method) (class_name , "get_bus_effect_instance\0" . as_ptr () as * const c_char) ; table . get_bus_index = (gd_api . godot_method_bind_get_method) (class_name , "get_bus_index\0" . as_ptr () as * const c_char) ; table . get_bus_name = (gd_api . godot_method_bind_get_method) (class_name , "get_bus_name\0" . as_ptr () as * const c_char) ; table . get_bus_peak_volume_left_db = (gd_api . godot_method_bind_get_method) (class_name , "get_bus_peak_volume_left_db\0" . as_ptr () as * const c_char) ; table . get_bus_peak_volume_right_db = (gd_api . godot_method_bind_get_method) (class_name , "get_bus_peak_volume_right_db\0" . as_ptr () as * const c_char) ; table . get_bus_send = (gd_api . godot_method_bind_get_method) (class_name , "get_bus_send\0" . as_ptr () as * const c_char) ; table . get_bus_volume_db = (gd_api . godot_method_bind_get_method) (class_name , "get_bus_volume_db\0" . as_ptr () as * const c_char) ; table . get_device = (gd_api . godot_method_bind_get_method) (class_name , "get_device\0" . as_ptr () as * const c_char) ; table . get_device_list = (gd_api . godot_method_bind_get_method) (class_name , "get_device_list\0" . as_ptr () as * const c_char) ; table . get_global_rate_scale = (gd_api . godot_method_bind_get_method) (class_name , "get_global_rate_scale\0" . as_ptr () as * const c_char) ; table . get_mix_rate = (gd_api . godot_method_bind_get_method) (class_name , "get_mix_rate\0" . as_ptr () as * const c_char) ; table . get_output_latency = (gd_api . godot_method_bind_get_method) (class_name , "get_output_latency\0" . as_ptr () as * const c_char) ; table . get_speaker_mode = (gd_api . godot_method_bind_get_method) (class_name , "get_speaker_mode\0" . as_ptr () as * const c_char) ; table . get_time_since_last_mix = (gd_api . godot_method_bind_get_method) (class_name , "get_time_since_last_mix\0" . as_ptr () as * const c_char) ; table . get_time_to_next_mix = (gd_api . godot_method_bind_get_method) (class_name , "get_time_to_next_mix\0" . as_ptr () as * const c_char) ; table . is_bus_bypassing_effects = (gd_api . godot_method_bind_get_method) (class_name , "is_bus_bypassing_effects\0" . as_ptr () as * const c_char) ; table . is_bus_effect_enabled = (gd_api . godot_method_bind_get_method) (class_name , "is_bus_effect_enabled\0" . as_ptr () as * const c_char) ; table . is_bus_mute = (gd_api . godot_method_bind_get_method) (class_name , "is_bus_mute\0" . as_ptr () as * const c_char) ; table . is_bus_solo = (gd_api . godot_method_bind_get_method) (class_name , "is_bus_solo\0" . as_ptr () as * const c_char) ; table . lock = (gd_api . godot_method_bind_get_method) (class_name , "lock\0" . as_ptr () as * const c_char) ; table . move_bus = (gd_api . godot_method_bind_get_method) (class_name , "move_bus\0" . as_ptr () as * const c_char) ; table . remove_bus = (gd_api . godot_method_bind_get_method) (class_name , "remove_bus\0" . as_ptr () as * const c_char) ; table . remove_bus_effect = (gd_api . godot_method_bind_get_method) (class_name , "remove_bus_effect\0" . as_ptr () as * const c_char) ; table . set_bus_bypass_effects = (gd_api . godot_method_bind_get_method) (class_name , "set_bus_bypass_effects\0" . as_ptr () as * const c_char) ; table . set_bus_count = (gd_api . godot_method_bind_get_method) (class_name , "set_bus_count\0" . as_ptr () as * const c_char) ; table . set_bus_effect_enabled = (gd_api . godot_method_bind_get_method) (class_name , "set_bus_effect_enabled\0" . as_ptr () as * const c_char) ; table . set_bus_layout = (gd_api . godot_method_bind_get_method) (class_name , "set_bus_layout\0" . as_ptr () as * const c_char) ; table . set_bus_mute = (gd_api . godot_method_bind_get_method) (class_name , "set_bus_mute\0" . as_ptr () as * const c_char) ; table . set_bus_name = (gd_api . godot_method_bind_get_method) (class_name , "set_bus_name\0" . as_ptr () as * const c_char) ; table . set_bus_send = (gd_api . godot_method_bind_get_method) (class_name , "set_bus_send\0" . as_ptr () as * const c_char) ; table . set_bus_solo = (gd_api . godot_method_bind_get_method) (class_name , "set_bus_solo\0" . as_ptr () as * const c_char) ; table . set_bus_volume_db = (gd_api . godot_method_bind_get_method) (class_name , "set_bus_volume_db\0" . as_ptr () as * const c_char) ; table . set_device = (gd_api . godot_method_bind_get_method) (class_name , "set_device\0" . as_ptr () as * const c_char) ; table . set_global_rate_scale = (gd_api . godot_method_bind_get_method) (class_name , "set_global_rate_scale\0" . as_ptr () as * const c_char) ; table . swap_bus_effects = (gd_api . godot_method_bind_get_method) (class_name , "swap_bus_effects\0" . as_ptr () as * const c_char) ; table . unlock = (gd_api . godot_method_bind_get_method) (class_name , "unlock\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:190:6499 [INFO] [stdout] | [INFO] [stdout] 190 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 190 | # [doc = "`core class PacketPeerStream` inherits `PacketPeer` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_packetpeerstream.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nPacketPeerStream inherits methods from:\n - [PacketPeer](struct.PacketPeer.html)\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct PacketPeerStream { this : RawObject < Self > , } impl PacketPeerStream { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = PacketPeerStreamMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = ""] # [doc = ""] # [inline] pub fn input_buffer_max_size (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = PacketPeerStreamMethodTable :: get (get_api ()) . get_input_buffer_max_size ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = ""] # [doc = ""] # [inline] pub fn output_buffer_max_size (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = PacketPeerStreamMethodTable :: get (get_api ()) . get_output_buffer_max_size ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "The wrapped [StreamPeer] object."] # [doc = ""] # [inline] pub fn stream_peer (& self) -> Option < Ref < crate :: generated :: stream_peer :: StreamPeer , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = PacketPeerStreamMethodTable :: get (get_api ()) . get_stream_peer ; let ret = crate :: icalls :: icallptr_obj (method_bind , self . this . sys () . as_ptr ()) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: stream_peer :: StreamPeer , thread_access :: Shared >> :: move_from_sys (sys)) } } # [doc = ""] # [doc = ""] # [inline] pub fn set_input_buffer_max_size (& self , max_size_bytes : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = PacketPeerStreamMethodTable :: get (get_api ()) . set_input_buffer_max_size ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , max_size_bytes) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn set_output_buffer_max_size (& self , max_size_bytes : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = PacketPeerStreamMethodTable :: get (get_api ()) . set_output_buffer_max_size ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , max_size_bytes) ; } } # [doc = "The wrapped [StreamPeer] object."] # [doc = ""] # [inline] pub fn set_stream_peer (& self , peer : impl AsArg < crate :: generated :: stream_peer :: StreamPeer >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = PacketPeerStreamMethodTable :: get (get_api ()) . set_stream_peer ; let ret = crate :: icalls :: icallptr_void_obj (method_bind , self . this . sys () . as_ptr () , peer . as_arg_ptr ()) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for PacketPeerStream { } unsafe impl GodotObject for PacketPeerStream { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "PacketPeerStream" } } impl std :: ops :: Deref for PacketPeerStream { type Target = crate :: generated :: packet_peer :: PacketPeer ; # [inline] fn deref (& self) -> & crate :: generated :: packet_peer :: PacketPeer { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for PacketPeerStream { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: packet_peer :: PacketPeer { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: packet_peer :: PacketPeer > for PacketPeerStream { } unsafe impl SubClass < crate :: generated :: reference :: Reference > for PacketPeerStream { } unsafe impl SubClass < crate :: generated :: object :: Object > for PacketPeerStream { } impl Instanciable for PacketPeerStream { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { PacketPeerStream :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct PacketPeerStreamMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_input_buffer_max_size : * mut sys :: godot_method_bind , pub get_output_buffer_max_size : * mut sys :: godot_method_bind , pub get_stream_peer : * mut sys :: godot_method_bind , pub set_input_buffer_max_size : * mut sys :: godot_method_bind , pub set_output_buffer_max_size : * mut sys :: godot_method_bind , pub set_stream_peer : * mut sys :: godot_method_bind } impl PacketPeerStreamMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : PacketPeerStreamMethodTable = PacketPeerStreamMethodTable { class_constructor : None , get_input_buffer_max_size : 0 as * mut sys :: godot_method_bind , get_output_buffer_max_size : 0 as * mut sys :: godot_method_bind , get_stream_peer : 0 as * mut sys :: godot_method_bind , set_input_buffer_max_size : 0 as * mut sys :: godot_method_bind , set_output_buffer_max_size : 0 as * mut sys :: godot_method_bind , set_stream_peer : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { PacketPeerStreamMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "PacketPeerStream\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_input_buffer_max_size = (gd_api . godot_method_bind_get_method) (class_name , "get_input_buffer_max_size\0" . as_ptr () as * const c_char) ; table . get_output_buffer_max_size = (gd_api . godot_method_bind_get_method) (class_name , "get_output_buffer_max_size\0" . as_ptr () as * const c_char) ; table . get_stream_peer = (gd_api . godot_method_bind_get_method) (class_name , "get_stream_peer\0" . as_ptr () as * const c_char) ; table . set_input_buffer_max_size = (gd_api . godot_method_bind_get_method) (class_name , "set_input_buffer_max_size\0" . as_ptr () as * const c_char) ; table . set_output_buffer_max_size = (gd_api . godot_method_bind_get_method) (class_name , "set_output_buffer_max_size\0" . as_ptr () as * const c_char) ; table . set_stream_peer = (gd_api . godot_method_bind_get_method) (class_name , "set_stream_peer\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:196:12183 [INFO] [stdout] | [INFO] [stdout] 196 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 196 | # [doc = "`core class PacketPeerUDP` inherits `PacketPeer` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_packetpeerudp.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nPacketPeerUDP inherits methods from:\n - [PacketPeer](struct.PacketPeer.html)\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct PacketPeerUDP { this : RawObject < Self > , } impl PacketPeerUDP { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = PacketPeerUDPMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "Closes the UDP socket the [PacketPeerUDP] is currently listening on."] # [doc = ""] # [inline] pub fn close (& self) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = PacketPeerUDPMethodTable :: get (get_api ()) . close ; let ret = crate :: icalls :: icallptr_void (method_bind , self . this . sys () . as_ptr ()) ; } } # [doc = "Calling this method connects this UDP peer to the given `host`/`port` pair. UDP is in reality connectionless, so this option only means that incoming packets from different addresses are automatically discarded, and that outgoing packets are always sent to the connected address (future calls to [method set_dest_address] are not allowed). This method does not send any data to the remote peer, to do that, use [method PacketPeer.put_var] or [method PacketPeer.put_packet] as usual. See also [UDPServer].\nNote: Connecting to the remote peer does not help to protect from malicious attacks like IP spoofing, etc. Think about using an encryption technique like SSL or DTLS if you feel like your application is transfering sensitive information."] # [doc = ""] # [inline] pub fn connect_to_host (& self , host : impl Into < GodotString > , port : i64) -> GodotResult { unsafe { let method_bind : * mut sys :: godot_method_bind = PacketPeerUDPMethodTable :: get (get_api ()) . connect_to_host ; let ret = crate :: icalls :: icallptr_i64_str_i64 (method_bind , self . this . sys () . as_ptr () , host . into () , port) ; GodotError :: result_from_sys (ret as _) } } # [doc = "Returns the IP of the remote peer that sent the last packet(that was received with [method PacketPeer.get_packet] or [method PacketPeer.get_var])."] # [doc = ""] # [inline] pub fn get_packet_ip (& self) -> GodotString { unsafe { let method_bind : * mut sys :: godot_method_bind = PacketPeerUDPMethodTable :: get (get_api ()) . get_packet_ip ; let ret = crate :: icalls :: icallptr_str (method_bind , self . this . sys () . as_ptr ()) ; GodotString :: from_sys (ret) } } # [doc = "Returns the port of the remote peer that sent the last packet(that was received with [method PacketPeer.get_packet] or [method PacketPeer.get_var])."] # [doc = ""] # [inline] pub fn get_packet_port (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = PacketPeerUDPMethodTable :: get (get_api ()) . get_packet_port ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Returns `true` if the UDP socket is open and has been connected to a remote address. See [method connect_to_host]."] # [doc = ""] # [inline] pub fn is_connected_to_host (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = PacketPeerUDPMethodTable :: get (get_api ()) . is_connected_to_host ; let ret = crate :: icalls :: icallptr_bool (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Returns whether this [PacketPeerUDP] is listening."] # [doc = ""] # [inline] pub fn is_listening (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = PacketPeerUDPMethodTable :: get (get_api ()) . is_listening ; let ret = crate :: icalls :: icallptr_bool (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Joins the multicast group specified by `multicast_address` using the interface identified by `interface_name`.\nYou can join the same multicast group with multiple interfaces. Use [method IP.get_local_interfaces] to know which are available.\nNote: Some Android devices might require the `CHANGE_WIFI_MULTICAST_STATE` permission for multicast to work."] # [doc = ""] # [inline] pub fn join_multicast_group (& self , multicast_address : impl Into < GodotString > , interface_name : impl Into < GodotString >) -> GodotResult { unsafe { let method_bind : * mut sys :: godot_method_bind = PacketPeerUDPMethodTable :: get (get_api ()) . join_multicast_group ; let ret = crate :: icalls :: icallptr_i64_str_str (method_bind , self . this . sys () . as_ptr () , multicast_address . into () , interface_name . into ()) ; GodotError :: result_from_sys (ret as _) } } # [doc = "Removes the interface identified by `interface_name` from the multicast group specified by `multicast_address`."] # [doc = ""] # [inline] pub fn leave_multicast_group (& self , multicast_address : impl Into < GodotString > , interface_name : impl Into < GodotString >) -> GodotResult { unsafe { let method_bind : * mut sys :: godot_method_bind = PacketPeerUDPMethodTable :: get (get_api ()) . leave_multicast_group ; let ret = crate :: icalls :: icallptr_i64_str_str (method_bind , self . this . sys () . as_ptr () , multicast_address . into () , interface_name . into ()) ; GodotError :: result_from_sys (ret as _) } } # [doc = "Makes this [PacketPeerUDP] listen on the `port` binding to `bind_address` with a buffer size `recv_buf_size`.\nIf `bind_address` is set to `\"*\"` (default), the peer will listen on all available addresses (both IPv4 and IPv6).\nIf `bind_address` is set to `\"0.0.0.0\"` (for IPv4) or `\"::\"` (for IPv6), the peer will listen on all available addresses matching that IP type.\nIf `bind_address` is set to any valid address (e.g. `\"192.168.1.101\"`, `\"::1\"`, etc), the peer will only listen on the interface with that addresses (or fail if no interface with the given address exists).\n# Default Arguments\n* `bind_address` - `\"*\"`\n* `recv_buf_size` - `65536`"] # [doc = ""] # [inline] pub fn listen (& self , port : i64 , bind_address : impl Into < GodotString > , recv_buf_size : i64) -> GodotResult { unsafe { let method_bind : * mut sys :: godot_method_bind = PacketPeerUDPMethodTable :: get (get_api ()) . listen ; let ret = crate :: icalls :: icallptr_i64_i64_str_i64 (method_bind , self . this . sys () . as_ptr () , port , bind_address . into () , recv_buf_size) ; GodotError :: result_from_sys (ret as _) } } # [doc = "Enable or disable sending of broadcast packets (e.g. `set_dest_address(\"255.255.255.255\", 4343)`. This option is disabled by default.\nNote: Some Android devices might require the `CHANGE_WIFI_MULTICAST_STATE` permission and this option to be enabled to receive broadcast packets too."] # [doc = ""] # [inline] pub fn set_broadcast_enabled (& self , enabled : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = PacketPeerUDPMethodTable :: get (get_api ()) . set_broadcast_enabled ; let ret = crate :: icalls :: icallptr_void_bool (method_bind , self . this . sys () . as_ptr () , enabled) ; } } # [doc = "Sets the destination address and port for sending packets and variables. A hostname will be resolved using DNS if needed.\nNote: [method set_broadcast_enabled] must be enabled before sending packets to a broadcast address (e.g. `255.255.255.255`)."] # [doc = ""] # [inline] pub fn set_dest_address (& self , host : impl Into < GodotString > , port : i64) -> GodotResult { unsafe { let method_bind : * mut sys :: godot_method_bind = PacketPeerUDPMethodTable :: get (get_api ()) . set_dest_address ; let ret = crate :: icalls :: icallptr_i64_str_i64 (method_bind , self . this . sys () . as_ptr () , host . into () , port) ; GodotError :: result_from_sys (ret as _) } } # [doc = "Waits for a packet to arrive on the listening port. See [method listen]."] # [doc = ""] # [inline] pub fn wait (& self) -> GodotResult { unsafe { let method_bind : * mut sys :: godot_method_bind = PacketPeerUDPMethodTable :: get (get_api ()) . wait ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; GodotError :: result_from_sys (ret as _) } } } impl gdnative_core :: private :: godot_object :: Sealed for PacketPeerUDP { } unsafe impl GodotObject for PacketPeerUDP { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "PacketPeerUDP" } } impl std :: ops :: Deref for PacketPeerUDP { type Target = crate :: generated :: packet_peer :: PacketPeer ; # [inline] fn deref (& self) -> & crate :: generated :: packet_peer :: PacketPeer { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for PacketPeerUDP { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: packet_peer :: PacketPeer { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: packet_peer :: PacketPeer > for PacketPeerUDP { } unsafe impl SubClass < crate :: generated :: reference :: Reference > for PacketPeerUDP { } unsafe impl SubClass < crate :: generated :: object :: Object > for PacketPeerUDP { } impl Instanciable for PacketPeerUDP { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { PacketPeerUDP :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct PacketPeerUDPMethodTable { pub class_constructor : sys :: godot_class_constructor , pub close : * mut sys :: godot_method_bind , pub connect_to_host : * mut sys :: godot_method_bind , pub get_packet_ip : * mut sys :: godot_method_bind , pub get_packet_port : * mut sys :: godot_method_bind , pub is_connected_to_host : * mut sys :: godot_method_bind , pub is_listening : * mut sys :: godot_method_bind , pub join_multicast_group : * mut sys :: godot_method_bind , pub leave_multicast_group : * mut sys :: godot_method_bind , pub listen : * mut sys :: godot_method_bind , pub set_broadcast_enabled : * mut sys :: godot_method_bind , pub set_dest_address : * mut sys :: godot_method_bind , pub wait : * mut sys :: godot_method_bind } impl PacketPeerUDPMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : PacketPeerUDPMethodTable = PacketPeerUDPMethodTable { class_constructor : None , close : 0 as * mut sys :: godot_method_bind , connect_to_host : 0 as * mut sys :: godot_method_bind , get_packet_ip : 0 as * mut sys :: godot_method_bind , get_packet_port : 0 as * mut sys :: godot_method_bind , is_connected_to_host : 0 as * mut sys :: godot_method_bind , is_listening : 0 as * mut sys :: godot_method_bind , join_multicast_group : 0 as * mut sys :: godot_method_bind , leave_multicast_group : 0 as * mut sys :: godot_method_bind , listen : 0 as * mut sys :: godot_method_bind , set_broadcast_enabled : 0 as * mut sys :: godot_method_bind , set_dest_address : 0 as * mut sys :: godot_method_bind , wait : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { PacketPeerUDPMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "PacketPeerUDP\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . close = (gd_api . godot_method_bind_get_method) (class_name , "close\0" . as_ptr () as * const c_char) ; table . connect_to_host = (gd_api . godot_method_bind_get_method) (class_name , "connect_to_host\0" . as_ptr () as * const c_char) ; table . get_packet_ip = (gd_api . godot_method_bind_get_method) (class_name , "get_packet_ip\0" . as_ptr () as * const c_char) ; table . get_packet_port = (gd_api . godot_method_bind_get_method) (class_name , "get_packet_port\0" . as_ptr () as * const c_char) ; table . is_connected_to_host = (gd_api . godot_method_bind_get_method) (class_name , "is_connected_to_host\0" . as_ptr () as * const c_char) ; table . is_listening = (gd_api . godot_method_bind_get_method) (class_name , "is_listening\0" . as_ptr () as * const c_char) ; table . join_multicast_group = (gd_api . godot_method_bind_get_method) (class_name , "join_multicast_group\0" . as_ptr () as * const c_char) ; table . leave_multicast_group = (gd_api . godot_method_bind_get_method) (class_name , "leave_multicast_group\0" . as_ptr () as * const c_char) ; table . listen = (gd_api . godot_method_bind_get_method) (class_name , "listen\0" . as_ptr () as * const c_char) ; table . set_broadcast_enabled = (gd_api . godot_method_bind_get_method) (class_name , "set_broadcast_enabled\0" . as_ptr () as * const c_char) ; table . set_dest_address = (gd_api . godot_method_bind_get_method) (class_name , "set_dest_address\0" . as_ptr () as * const c_char) ; table . wait = (gd_api . godot_method_bind_get_method) (class_name , "wait\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:202:4533 [INFO] [stdout] | [INFO] [stdout] 202 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 202 | # [doc = "`tools class ScriptCreateDialog` inherits `ConfirmationDialog` (unsafe)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_scriptcreatedialog.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = ""] # [doc = "\n## Class hierarchy\n\nScriptCreateDialog inherits methods from:\n - [ConfirmationDialog](struct.ConfirmationDialog.html)\n - [AcceptDialog](struct.AcceptDialog.html)\n - [WindowDialog](struct.WindowDialog.html)\n - [Popup](struct.Popup.html)\n - [Control](struct.Control.html)\n - [CanvasItem](struct.CanvasItem.html)\n - [Node](struct.Node.html)\n - [Object](struct.Object.html)\n"] # [doc = "\n## Tool\n\nThis class is used to interact with Godot's editor."] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct ScriptCreateDialog { this : RawObject < Self > , } impl ScriptCreateDialog { # [doc = "Prefills required fields to configure the ScriptCreateDialog for use.\n# Default Arguments\n* `built_in_enabled` - `true`\n* `load_enabled` - `true`"] # [doc = ""] # [inline] pub fn config (& self , inherits : impl Into < GodotString > , path : impl Into < GodotString > , built_in_enabled : bool , load_enabled : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = ScriptCreateDialogMethodTable :: get (get_api ()) . config ; let ret = crate :: icalls :: icallptr_void_str_str_bool_bool (method_bind , self . this . sys () . as_ptr () , inherits . into () , path . into () , built_in_enabled , load_enabled) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for ScriptCreateDialog { } unsafe impl GodotObject for ScriptCreateDialog { type RefKind = ref_kind :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "ScriptCreateDialog" } } impl QueueFree for ScriptCreateDialog { # [inline] unsafe fn godot_queue_free (obj : * mut sys :: godot_object) { let method_bind : * mut sys :: godot_method_bind = crate :: generated :: node :: NodeMethodTable :: get (get_api ()) . queue_free ; crate :: icalls :: icallptr_void (method_bind , obj) } } impl std :: ops :: Deref for ScriptCreateDialog { type Target = crate :: generated :: confirmation_dialog :: ConfirmationDialog ; # [inline] fn deref (& self) -> & crate :: generated :: confirmation_dialog :: ConfirmationDialog { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for ScriptCreateDialog { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: confirmation_dialog :: ConfirmationDialog { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: confirmation_dialog :: ConfirmationDialog > for ScriptCreateDialog { } unsafe impl SubClass < crate :: generated :: accept_dialog :: AcceptDialog > for ScriptCreateDialog { } unsafe impl SubClass < crate :: generated :: window_dialog :: WindowDialog > for ScriptCreateDialog { } unsafe impl SubClass < crate :: generated :: popup :: Popup > for ScriptCreateDialog { } unsafe impl SubClass < crate :: generated :: control :: Control > for ScriptCreateDialog { } unsafe impl SubClass < crate :: generated :: canvas_item :: CanvasItem > for ScriptCreateDialog { } unsafe impl SubClass < crate :: generated :: node :: Node > for ScriptCreateDialog { } unsafe impl SubClass < crate :: generated :: object :: Object > for ScriptCreateDialog { } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct ScriptCreateDialogMethodTable { pub class_constructor : sys :: godot_class_constructor , pub config : * mut sys :: godot_method_bind } impl ScriptCreateDialogMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : ScriptCreateDialogMethodTable = ScriptCreateDialogMethodTable { class_constructor : None , config : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { ScriptCreateDialogMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "ScriptCreateDialog\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . config = (gd_api . godot_method_bind_get_method) (class_name , "config\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:208:7943 [INFO] [stdout] | [INFO] [stdout] 208 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 208 | # [doc = "`core class StyleBox` inherits `Resource` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_stylebox.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nStyleBox inherits methods from:\n - [Resource](struct.Resource.html)\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct StyleBox { this : RawObject < Self > , } impl StyleBox { # [doc = "Draws this stylebox using a [CanvasItem] with given [RID].\nYou can get a [RID] value using [method Object.get_instance_id] on a [CanvasItem]-derived node."] # [doc = ""] # [inline] pub fn draw (& self , canvas_item : Rid , rect : Rect2) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = StyleBoxMethodTable :: get (get_api ()) . draw ; let ret = crate :: icalls :: icallptr_void_rid_rect2 (method_bind , self . this . sys () . as_ptr () , canvas_item , rect) ; } } # [doc = "Returns the size of this [StyleBox] without the margins."] # [doc = ""] # [inline] pub fn get_center_size (& self) -> Vector2 { unsafe { let method_bind : * mut sys :: godot_method_bind = StyleBoxMethodTable :: get (get_api ()) . get_center_size ; let ret = crate :: icalls :: icallptr_vec2 (method_bind , self . this . sys () . as_ptr ()) ; mem :: transmute (ret) } } # [doc = "Returns the [CanvasItem] that handles its [constant CanvasItem.NOTIFICATION_DRAW] or [method CanvasItem._draw] callback at this moment."] # [doc = ""] # [inline] pub fn get_current_item_drawn (& self) -> Option < Ref < crate :: generated :: canvas_item :: CanvasItem , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = StyleBoxMethodTable :: get (get_api ()) . get_current_item_drawn ; let ret = crate :: icalls :: icallptr_obj (method_bind , self . this . sys () . as_ptr ()) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: canvas_item :: CanvasItem , thread_access :: Shared >> :: move_from_sys (sys)) } } # [doc = "The top margin for the contents of this style box. Increasing this value reduces the space available to the contents from the top.\nRefer to [member content_margin_bottom] for extra considerations."] # [doc = ""] # [inline] pub fn default_margin (& self , margin : i64) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = StyleBoxMethodTable :: get (get_api ()) . get_default_margin ; let ret = crate :: icalls :: icallptr_f64_i64 (method_bind , self . this . sys () . as_ptr () , margin) ; ret as _ } } # [doc = "Returns the content margin offset for the specified [enum Margin].\nPositive values reduce size inwards, unlike [Control]'s margin values."] # [doc = ""] # [inline] pub fn get_margin (& self , margin : i64) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = StyleBoxMethodTable :: get (get_api ()) . get_margin ; let ret = crate :: icalls :: icallptr_f64_i64 (method_bind , self . this . sys () . as_ptr () , margin) ; ret as _ } } # [doc = "Returns the minimum size that this stylebox can be shrunk to."] # [doc = ""] # [inline] pub fn get_minimum_size (& self) -> Vector2 { unsafe { let method_bind : * mut sys :: godot_method_bind = StyleBoxMethodTable :: get (get_api ()) . get_minimum_size ; let ret = crate :: icalls :: icallptr_vec2 (method_bind , self . this . sys () . as_ptr ()) ; mem :: transmute (ret) } } # [doc = "Returns the \"offset\" of a stylebox. This helper function returns a value equivalent to `Vector2(style.get_margin(MARGIN_LEFT), style.get_margin(MARGIN_TOP))`."] # [doc = ""] # [inline] pub fn get_offset (& self) -> Vector2 { unsafe { let method_bind : * mut sys :: godot_method_bind = StyleBoxMethodTable :: get (get_api ()) . get_offset ; let ret = crate :: icalls :: icallptr_vec2 (method_bind , self . this . sys () . as_ptr ()) ; mem :: transmute (ret) } } # [doc = "The top margin for the contents of this style box. Increasing this value reduces the space available to the contents from the top.\nRefer to [member content_margin_bottom] for extra considerations."] # [doc = ""] # [inline] pub fn set_default_margin (& self , margin : i64 , offset : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = StyleBoxMethodTable :: get (get_api ()) . set_default_margin ; let ret = crate :: icalls :: icallptr_void_i64_f64 (method_bind , self . this . sys () . as_ptr () , margin , offset) ; } } # [doc = "Test a position in a rectangle, return whether it passes the mask test."] # [doc = ""] # [inline] pub fn test_mask (& self , point : Vector2 , rect : Rect2) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = StyleBoxMethodTable :: get (get_api ()) . test_mask ; let ret = crate :: icalls :: icallptr_bool_vec2_rect2 (method_bind , self . this . sys () . as_ptr () , point , rect) ; ret as _ } } } impl gdnative_core :: private :: godot_object :: Sealed for StyleBox { } unsafe impl GodotObject for StyleBox { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "StyleBox" } } impl std :: ops :: Deref for StyleBox { type Target = crate :: generated :: resource :: Resource ; # [inline] fn deref (& self) -> & crate :: generated :: resource :: Resource { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for StyleBox { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: resource :: Resource { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: resource :: Resource > for StyleBox { } unsafe impl SubClass < crate :: generated :: reference :: Reference > for StyleBox { } unsafe impl SubClass < crate :: generated :: object :: Object > for StyleBox { } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct StyleBoxMethodTable { pub class_constructor : sys :: godot_class_constructor , pub draw : * mut sys :: godot_method_bind , pub get_center_size : * mut sys :: godot_method_bind , pub get_current_item_drawn : * mut sys :: godot_method_bind , pub get_default_margin : * mut sys :: godot_method_bind , pub get_margin : * mut sys :: godot_method_bind , pub get_minimum_size : * mut sys :: godot_method_bind , pub get_offset : * mut sys :: godot_method_bind , pub set_default_margin : * mut sys :: godot_method_bind , pub test_mask : * mut sys :: godot_method_bind } impl StyleBoxMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : StyleBoxMethodTable = StyleBoxMethodTable { class_constructor : None , draw : 0 as * mut sys :: godot_method_bind , get_center_size : 0 as * mut sys :: godot_method_bind , get_current_item_drawn : 0 as * mut sys :: godot_method_bind , get_default_margin : 0 as * mut sys :: godot_method_bind , get_margin : 0 as * mut sys :: godot_method_bind , get_minimum_size : 0 as * mut sys :: godot_method_bind , get_offset : 0 as * mut sys :: godot_method_bind , set_default_margin : 0 as * mut sys :: godot_method_bind , test_mask : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { StyleBoxMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "StyleBox\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . draw = (gd_api . godot_method_bind_get_method) (class_name , "draw\0" . as_ptr () as * const c_char) ; table . get_center_size = (gd_api . godot_method_bind_get_method) (class_name , "get_center_size\0" . as_ptr () as * const c_char) ; table . get_current_item_drawn = (gd_api . godot_method_bind_get_method) (class_name , "get_current_item_drawn\0" . as_ptr () as * const c_char) ; table . get_default_margin = (gd_api . godot_method_bind_get_method) (class_name , "get_default_margin\0" . as_ptr () as * const c_char) ; table . get_margin = (gd_api . godot_method_bind_get_method) (class_name , "get_margin\0" . as_ptr () as * const c_char) ; table . get_minimum_size = (gd_api . godot_method_bind_get_method) (class_name , "get_minimum_size\0" . as_ptr () as * const c_char) ; table . get_offset = (gd_api . godot_method_bind_get_method) (class_name , "get_offset\0" . as_ptr () as * const c_char) ; table . set_default_margin = (gd_api . godot_method_bind_get_method) (class_name , "set_default_margin\0" . as_ptr () as * const c_char) ; table . test_mask = (gd_api . godot_method_bind_get_method) (class_name , "test_mask\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:214:26008 [INFO] [stdout] | [INFO] [stdout] 214 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 214 | # [doc = "`core class VisualScript` inherits `Script` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_visualscript.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nVisualScript inherits methods from:\n - [Script](struct.Script.html)\n - [Resource](struct.Resource.html)\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct VisualScript { this : RawObject < Self > , } impl VisualScript { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = VisualScriptMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = ""] # [doc = ""] # [inline] pub fn add_custom_signal (& self , name : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualScriptMethodTable :: get (get_api ()) . add_custom_signal ; let ret = crate :: icalls :: icallptr_void_str (method_bind , self . this . sys () . as_ptr () , name . into ()) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn add_function (& self , name : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualScriptMethodTable :: get (get_api ()) . add_function ; let ret = crate :: icalls :: icallptr_void_str (method_bind , self . this . sys () . as_ptr () , name . into ()) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn add_node (& self , func : impl Into < GodotString > , id : i64 , node : impl AsArg < crate :: generated :: visual_script_node :: VisualScriptNode > , position : Vector2) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualScriptMethodTable :: get (get_api ()) . add_node ; let ret = crate :: icalls :: icallptr_void_str_i64_obj_vec2 (method_bind , self . this . sys () . as_ptr () , func . into () , id , node . as_arg_ptr () , position) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn add_variable (& self , name : impl Into < GodotString > , default_value : impl OwnedToVariant , export : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualScriptMethodTable :: get (get_api ()) . add_variable ; let ret = crate :: icalls :: icallptr_void_str_var_bool (method_bind , self . this . sys () . as_ptr () , name . into () , default_value . owned_to_variant () , export) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn custom_signal_add_argument (& self , name : impl Into < GodotString > , _type : i64 , argname : impl Into < GodotString > , index : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualScriptMethodTable :: get (get_api ()) . custom_signal_add_argument ; let ret = crate :: icalls :: icallptr_void_str_i64_str_i64 (method_bind , self . this . sys () . as_ptr () , name . into () , _type , argname . into () , index) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn custom_signal_get_argument_count (& self , name : impl Into < GodotString >) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualScriptMethodTable :: get (get_api ()) . custom_signal_get_argument_count ; let ret = crate :: icalls :: icallptr_i64_str (method_bind , self . this . sys () . as_ptr () , name . into ()) ; ret as _ } } # [doc = ""] # [doc = ""] # [inline] pub fn custom_signal_get_argument_name (& self , name : impl Into < GodotString > , argidx : i64) -> GodotString { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualScriptMethodTable :: get (get_api ()) . custom_signal_get_argument_name ; let ret = crate :: icalls :: icallptr_str_str_i64 (method_bind , self . this . sys () . as_ptr () , name . into () , argidx) ; GodotString :: from_sys (ret) } } # [doc = ""] # [doc = ""] # [inline] pub fn custom_signal_get_argument_type (& self , name : impl Into < GodotString > , argidx : i64) -> VariantType { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualScriptMethodTable :: get (get_api ()) . custom_signal_get_argument_type ; let ret = crate :: icalls :: icallptr_i64_str_i64 (method_bind , self . this . sys () . as_ptr () , name . into () , argidx) ; VariantType :: from_sys (ret as _) } } # [doc = ""] # [doc = ""] # [inline] pub fn custom_signal_remove_argument (& self , name : impl Into < GodotString > , argidx : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualScriptMethodTable :: get (get_api ()) . custom_signal_remove_argument ; let ret = crate :: icalls :: icallptr_void_str_i64 (method_bind , self . this . sys () . as_ptr () , name . into () , argidx) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn custom_signal_set_argument_name (& self , name : impl Into < GodotString > , argidx : i64 , argname : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualScriptMethodTable :: get (get_api ()) . custom_signal_set_argument_name ; let ret = crate :: icalls :: icallptr_void_str_i64_str (method_bind , self . this . sys () . as_ptr () , name . into () , argidx , argname . into ()) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn custom_signal_set_argument_type (& self , name : impl Into < GodotString > , argidx : i64 , _type : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualScriptMethodTable :: get (get_api ()) . custom_signal_set_argument_type ; let ret = crate :: icalls :: icallptr_void_str_i64_i64 (method_bind , self . this . sys () . as_ptr () , name . into () , argidx , _type) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn custom_signal_swap_argument (& self , name : impl Into < GodotString > , argidx : i64 , withidx : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualScriptMethodTable :: get (get_api ()) . custom_signal_swap_argument ; let ret = crate :: icalls :: icallptr_void_str_i64_i64 (method_bind , self . this . sys () . as_ptr () , name . into () , argidx , withidx) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn data_connect (& self , func : impl Into < GodotString > , from_node : i64 , from_port : i64 , to_node : i64 , to_port : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualScriptMethodTable :: get (get_api ()) . data_connect ; let ret = crate :: icalls :: icallptr_void_str_i64_i64_i64_i64 (method_bind , self . this . sys () . as_ptr () , func . into () , from_node , from_port , to_node , to_port) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn data_disconnect (& self , func : impl Into < GodotString > , from_node : i64 , from_port : i64 , to_node : i64 , to_port : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualScriptMethodTable :: get (get_api ()) . data_disconnect ; let ret = crate :: icalls :: icallptr_void_str_i64_i64_i64_i64 (method_bind , self . this . sys () . as_ptr () , func . into () , from_node , from_port , to_node , to_port) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn get_function_node_id (& self , name : impl Into < GodotString >) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualScriptMethodTable :: get (get_api ()) . get_function_node_id ; let ret = crate :: icalls :: icallptr_i64_str (method_bind , self . this . sys () . as_ptr () , name . into ()) ; ret as _ } } # [doc = ""] # [doc = ""] # [inline] pub fn get_function_scroll (& self , name : impl Into < GodotString >) -> Vector2 { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualScriptMethodTable :: get (get_api ()) . get_function_scroll ; let ret = crate :: icalls :: icallptr_vec2_str (method_bind , self . this . sys () . as_ptr () , name . into ()) ; mem :: transmute (ret) } } # [doc = ""] # [doc = ""] # [inline] pub fn get_node (& self , func : impl Into < GodotString > , id : i64) -> Option < Ref < crate :: generated :: visual_script_node :: VisualScriptNode , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualScriptMethodTable :: get (get_api ()) . get_node ; let ret = crate :: icalls :: icallptr_obj_str_i64 (method_bind , self . this . sys () . as_ptr () , func . into () , id) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: visual_script_node :: VisualScriptNode , thread_access :: Shared >> :: move_from_sys (sys)) } } # [doc = ""] # [doc = ""] # [inline] pub fn get_node_position (& self , func : impl Into < GodotString > , id : i64) -> Vector2 { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualScriptMethodTable :: get (get_api ()) . get_node_position ; let ret = crate :: icalls :: icallptr_vec2_str_i64 (method_bind , self . this . sys () . as_ptr () , func . into () , id) ; mem :: transmute (ret) } } # [doc = ""] # [doc = ""] # [inline] pub fn get_variable_default_value (& self , name : impl Into < GodotString >) -> Variant { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualScriptMethodTable :: get (get_api ()) . get_variable_default_value ; let ret = crate :: icalls :: icallptr_var_str (method_bind , self . this . sys () . as_ptr () , name . into ()) ; Variant :: from_sys (ret) } } # [doc = ""] # [doc = ""] # [inline] pub fn get_variable_export (& self , name : impl Into < GodotString >) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualScriptMethodTable :: get (get_api ()) . get_variable_export ; let ret = crate :: icalls :: icallptr_bool_str (method_bind , self . this . sys () . as_ptr () , name . into ()) ; ret as _ } } # [doc = ""] # [doc = ""] # [inline] pub fn get_variable_info (& self , name : impl Into < GodotString >) -> Dictionary { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualScriptMethodTable :: get (get_api ()) . get_variable_info ; let ret = crate :: icalls :: icallptr_dict_str (method_bind , self . this . sys () . as_ptr () , name . into ()) ; Dictionary :: from_sys (ret) } } # [doc = ""] # [doc = ""] # [inline] pub fn has_custom_signal (& self , name : impl Into < GodotString >) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualScriptMethodTable :: get (get_api ()) . has_custom_signal ; let ret = crate :: icalls :: icallptr_bool_str (method_bind , self . this . sys () . as_ptr () , name . into ()) ; ret as _ } } # [doc = ""] # [doc = ""] # [inline] pub fn has_data_connection (& self , func : impl Into < GodotString > , from_node : i64 , from_port : i64 , to_node : i64 , to_port : i64) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualScriptMethodTable :: get (get_api ()) . has_data_connection ; let ret = crate :: icalls :: icallptr_bool_str_i64_i64_i64_i64 (method_bind , self . this . sys () . as_ptr () , func . into () , from_node , from_port , to_node , to_port) ; ret as _ } } # [doc = ""] # [doc = ""] # [inline] pub fn has_function (& self , name : impl Into < GodotString >) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualScriptMethodTable :: get (get_api ()) . has_function ; let ret = crate :: icalls :: icallptr_bool_str (method_bind , self . this . sys () . as_ptr () , name . into ()) ; ret as _ } } # [doc = ""] # [doc = ""] # [inline] pub fn has_node (& self , func : impl Into < GodotString > , id : i64) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualScriptMethodTable :: get (get_api ()) . has_node ; let ret = crate :: icalls :: icallptr_bool_str_i64 (method_bind , self . this . sys () . as_ptr () , func . into () , id) ; ret as _ } } # [doc = ""] # [doc = ""] # [inline] pub fn has_sequence_connection (& self , func : impl Into < GodotString > , from_node : i64 , from_output : i64 , to_node : i64) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualScriptMethodTable :: get (get_api ()) . has_sequence_connection ; let ret = crate :: icalls :: icallptr_bool_str_i64_i64_i64 (method_bind , self . this . sys () . as_ptr () , func . into () , from_node , from_output , to_node) ; ret as _ } } # [doc = ""] # [doc = ""] # [inline] pub fn has_variable (& self , name : impl Into < GodotString >) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualScriptMethodTable :: get (get_api ()) . has_variable ; let ret = crate :: icalls :: icallptr_bool_str (method_bind , self . this . sys () . as_ptr () , name . into ()) ; ret as _ } } # [doc = ""] # [doc = ""] # [inline] pub fn remove_custom_signal (& self , name : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualScriptMethodTable :: get (get_api ()) . remove_custom_signal ; let ret = crate :: icalls :: icallptr_void_str (method_bind , self . this . sys () . as_ptr () , name . into ()) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn remove_function (& self , name : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualScriptMethodTable :: get (get_api ()) . remove_function ; let ret = crate :: icalls :: icallptr_void_str (method_bind , self . this . sys () . as_ptr () , name . into ()) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn remove_node (& self , func : impl Into < GodotString > , id : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualScriptMethodTable :: get (get_api ()) . remove_node ; let ret = crate :: icalls :: icallptr_void_str_i64 (method_bind , self . this . sys () . as_ptr () , func . into () , id) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn remove_variable (& self , name : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualScriptMethodTable :: get (get_api ()) . remove_variable ; let ret = crate :: icalls :: icallptr_void_str (method_bind , self . this . sys () . as_ptr () , name . into ()) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn rename_custom_signal (& self , name : impl Into < GodotString > , new_name : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualScriptMethodTable :: get (get_api ()) . rename_custom_signal ; let ret = crate :: icalls :: icallptr_void_str_str (method_bind , self . this . sys () . as_ptr () , name . into () , new_name . into ()) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn rename_function (& self , name : impl Into < GodotString > , new_name : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualScriptMethodTable :: get (get_api ()) . rename_function ; let ret = crate :: icalls :: icallptr_void_str_str (method_bind , self . this . sys () . as_ptr () , name . into () , new_name . into ()) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn rename_variable (& self , name : impl Into < GodotString > , new_name : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualScriptMethodTable :: get (get_api ()) . rename_variable ; let ret = crate :: icalls :: icallptr_void_str_str (method_bind , self . this . sys () . as_ptr () , name . into () , new_name . into ()) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn sequence_connect (& self , func : impl Into < GodotString > , from_node : i64 , from_output : i64 , to_node : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualScriptMethodTable :: get (get_api ()) . sequence_connect ; let ret = crate :: icalls :: icallptr_void_str_i64_i64_i64 (method_bind , self . this . sys () . as_ptr () , func . into () , from_node , from_output , to_node) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn sequence_disconnect (& self , func : impl Into < GodotString > , from_node : i64 , from_output : i64 , to_node : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualScriptMethodTable :: get (get_api ()) . sequence_disconnect ; let ret = crate :: icalls :: icallptr_void_str_i64_i64_i64 (method_bind , self . this . sys () . as_ptr () , func . into () , from_node , from_output , to_node) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn set_function_scroll (& self , name : impl Into < GodotString > , ofs : Vector2) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualScriptMethodTable :: get (get_api ()) . set_function_scroll ; let ret = crate :: icalls :: icallptr_void_str_vec2 (method_bind , self . this . sys () . as_ptr () , name . into () , ofs) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn set_instance_base_type (& self , _type : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualScriptMethodTable :: get (get_api ()) . set_instance_base_type ; let ret = crate :: icalls :: icallptr_void_str (method_bind , self . this . sys () . as_ptr () , _type . into ()) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn set_node_position (& self , func : impl Into < GodotString > , id : i64 , position : Vector2) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualScriptMethodTable :: get (get_api ()) . set_node_position ; let ret = crate :: icalls :: icallptr_void_str_i64_vec2 (method_bind , self . this . sys () . as_ptr () , func . into () , id , position) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn set_variable_default_value (& self , name : impl Into < GodotString > , value : impl OwnedToVariant) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualScriptMethodTable :: get (get_api ()) . set_variable_default_value ; let ret = crate :: icalls :: icallptr_void_str_var (method_bind , self . this . sys () . as_ptr () , name . into () , value . owned_to_variant ()) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn set_variable_export (& self , name : impl Into < GodotString > , enable : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualScriptMethodTable :: get (get_api ()) . set_variable_export ; let ret = crate :: icalls :: icallptr_void_str_bool (method_bind , self . this . sys () . as_ptr () , name . into () , enable) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn set_variable_info (& self , name : impl Into < GodotString > , value : Dictionary) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualScriptMethodTable :: get (get_api ()) . set_variable_info ; let ret = crate :: icalls :: icallptr_void_str_dict (method_bind , self . this . sys () . as_ptr () , name . into () , value) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for VisualScript { } unsafe impl GodotObject for VisualScript { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "VisualScript" } } impl std :: ops :: Deref for VisualScript { type Target = crate :: generated :: script :: Script ; # [inline] fn deref (& self) -> & crate :: generated :: script :: Script { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for VisualScript { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: script :: Script { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: script :: Script > for VisualScript { } unsafe impl SubClass < crate :: generated :: resource :: Resource > for VisualScript { } unsafe impl SubClass < crate :: generated :: reference :: Reference > for VisualScript { } unsafe impl SubClass < crate :: generated :: object :: Object > for VisualScript { } impl Instanciable for VisualScript { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { VisualScript :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct VisualScriptMethodTable { pub class_constructor : sys :: godot_class_constructor , pub add_custom_signal : * mut sys :: godot_method_bind , pub add_function : * mut sys :: godot_method_bind , pub add_node : * mut sys :: godot_method_bind , pub add_variable : * mut sys :: godot_method_bind , pub custom_signal_add_argument : * mut sys :: godot_method_bind , pub custom_signal_get_argument_count : * mut sys :: godot_method_bind , pub custom_signal_get_argument_name : * mut sys :: godot_method_bind , pub custom_signal_get_argument_type : * mut sys :: godot_method_bind , pub custom_signal_remove_argument : * mut sys :: godot_method_bind , pub custom_signal_set_argument_name : * mut sys :: godot_method_bind , pub custom_signal_set_argument_type : * mut sys :: godot_method_bind , pub custom_signal_swap_argument : * mut sys :: godot_method_bind , pub data_connect : * mut sys :: godot_method_bind , pub data_disconnect : * mut sys :: godot_method_bind , pub get_function_node_id : * mut sys :: godot_method_bind , pub get_function_scroll : * mut sys :: godot_method_bind , pub get_node : * mut sys :: godot_method_bind , pub get_node_position : * mut sys :: godot_method_bind , pub get_variable_default_value : * mut sys :: godot_method_bind , pub get_variable_export : * mut sys :: godot_method_bind , pub get_variable_info : * mut sys :: godot_method_bind , pub has_custom_signal : * mut sys :: godot_method_bind , pub has_data_connection : * mut sys :: godot_method_bind , pub has_function : * mut sys :: godot_method_bind , pub has_node : * mut sys :: godot_method_bind , pub has_sequence_connection : * mut sys :: godot_method_bind , pub has_variable : * mut sys :: godot_method_bind , pub remove_custom_signal : * mut sys :: godot_method_bind , pub remove_function : * mut sys :: godot_method_bind , pub remove_node : * mut sys :: godot_method_bind , pub remove_variable : * mut sys :: godot_method_bind , pub rename_custom_signal : * mut sys :: godot_method_bind , pub rename_function : * mut sys :: godot_method_bind , pub rename_variable : * mut sys :: godot_method_bind , pub sequence_connect : * mut sys :: godot_method_bind , pub sequence_disconnect : * mut sys :: godot_method_bind , pub set_function_scroll : * mut sys :: godot_method_bind , pub set_instance_base_type : * mut sys :: godot_method_bind , pub set_node_position : * mut sys :: godot_method_bind , pub set_variable_default_value : * mut sys :: godot_method_bind , pub set_variable_export : * mut sys :: godot_method_bind , pub set_variable_info : * mut sys :: godot_method_bind } impl VisualScriptMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : VisualScriptMethodTable = VisualScriptMethodTable { class_constructor : None , add_custom_signal : 0 as * mut sys :: godot_method_bind , add_function : 0 as * mut sys :: godot_method_bind , add_node : 0 as * mut sys :: godot_method_bind , add_variable : 0 as * mut sys :: godot_method_bind , custom_signal_add_argument : 0 as * mut sys :: godot_method_bind , custom_signal_get_argument_count : 0 as * mut sys :: godot_method_bind , custom_signal_get_argument_name : 0 as * mut sys :: godot_method_bind , custom_signal_get_argument_type : 0 as * mut sys :: godot_method_bind , custom_signal_remove_argument : 0 as * mut sys :: godot_method_bind , custom_signal_set_argument_name : 0 as * mut sys :: godot_method_bind , custom_signal_set_argument_type : 0 as * mut sys :: godot_method_bind , custom_signal_swap_argument : 0 as * mut sys :: godot_method_bind , data_connect : 0 as * mut sys :: godot_method_bind , data_disconnect : 0 as * mut sys :: godot_method_bind , get_function_node_id : 0 as * mut sys :: godot_method_bind , get_function_scroll : 0 as * mut sys :: godot_method_bind , get_node : 0 as * mut sys :: godot_method_bind , get_node_position : 0 as * mut sys :: godot_method_bind , get_variable_default_value : 0 as * mut sys :: godot_method_bind , get_variable_export : 0 as * mut sys :: godot_method_bind , get_variable_info : 0 as * mut sys :: godot_method_bind , has_custom_signal : 0 as * mut sys :: godot_method_bind , has_data_connection : 0 as * mut sys :: godot_method_bind , has_function : 0 as * mut sys :: godot_method_bind , has_node : 0 as * mut sys :: godot_method_bind , has_sequence_connection : 0 as * mut sys :: godot_method_bind , has_variable : 0 as * mut sys :: godot_method_bind , remove_custom_signal : 0 as * mut sys :: godot_method_bind , remove_function : 0 as * mut sys :: godot_method_bind , remove_node : 0 as * mut sys :: godot_method_bind , remove_variable : 0 as * mut sys :: godot_method_bind , rename_custom_signal : 0 as * mut sys :: godot_method_bind , rename_function : 0 as * mut sys :: godot_method_bind , rename_variable : 0 as * mut sys :: godot_method_bind , sequence_connect : 0 as * mut sys :: godot_method_bind , sequence_disconnect : 0 as * mut sys :: godot_method_bind , set_function_scroll : 0 as * mut sys :: godot_method_bind , set_instance_base_type : 0 as * mut sys :: godot_method_bind , set_node_position : 0 as * mut sys :: godot_method_bind , set_variable_default_value : 0 as * mut sys :: godot_method_bind , set_variable_export : 0 as * mut sys :: godot_method_bind , set_variable_info : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { VisualScriptMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "VisualScript\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . add_custom_signal = (gd_api . godot_method_bind_get_method) (class_name , "add_custom_signal\0" . as_ptr () as * const c_char) ; table . add_function = (gd_api . godot_method_bind_get_method) (class_name , "add_function\0" . as_ptr () as * const c_char) ; table . add_node = (gd_api . godot_method_bind_get_method) (class_name , "add_node\0" . as_ptr () as * const c_char) ; table . add_variable = (gd_api . godot_method_bind_get_method) (class_name , "add_variable\0" . as_ptr () as * const c_char) ; table . custom_signal_add_argument = (gd_api . godot_method_bind_get_method) (class_name , "custom_signal_add_argument\0" . as_ptr () as * const c_char) ; table . custom_signal_get_argument_count = (gd_api . godot_method_bind_get_method) (class_name , "custom_signal_get_argument_count\0" . as_ptr () as * const c_char) ; table . custom_signal_get_argument_name = (gd_api . godot_method_bind_get_method) (class_name , "custom_signal_get_argument_name\0" . as_ptr () as * const c_char) ; table . custom_signal_get_argument_type = (gd_api . godot_method_bind_get_method) (class_name , "custom_signal_get_argument_type\0" . as_ptr () as * const c_char) ; table . custom_signal_remove_argument = (gd_api . godot_method_bind_get_method) (class_name , "custom_signal_remove_argument\0" . as_ptr () as * const c_char) ; table . custom_signal_set_argument_name = (gd_api . godot_method_bind_get_method) (class_name , "custom_signal_set_argument_name\0" . as_ptr () as * const c_char) ; table . custom_signal_set_argument_type = (gd_api . godot_method_bind_get_method) (class_name , "custom_signal_set_argument_type\0" . as_ptr () as * const c_char) ; table . custom_signal_swap_argument = (gd_api . godot_method_bind_get_method) (class_name , "custom_signal_swap_argument\0" . as_ptr () as * const c_char) ; table . data_connect = (gd_api . godot_method_bind_get_method) (class_name , "data_connect\0" . as_ptr () as * const c_char) ; table . data_disconnect = (gd_api . godot_method_bind_get_method) (class_name , "data_disconnect\0" . as_ptr () as * const c_char) ; table . get_function_node_id = (gd_api . godot_method_bind_get_method) (class_name , "get_function_node_id\0" . as_ptr () as * const c_char) ; table . get_function_scroll = (gd_api . godot_method_bind_get_method) (class_name , "get_function_scroll\0" . as_ptr () as * const c_char) ; table . get_node = (gd_api . godot_method_bind_get_method) (class_name , "get_node\0" . as_ptr () as * const c_char) ; table . get_node_position = (gd_api . godot_method_bind_get_method) (class_name , "get_node_position\0" . as_ptr () as * const c_char) ; table . get_variable_default_value = (gd_api . godot_method_bind_get_method) (class_name , "get_variable_default_value\0" . as_ptr () as * const c_char) ; table . get_variable_export = (gd_api . godot_method_bind_get_method) (class_name , "get_variable_export\0" . as_ptr () as * const c_char) ; table . get_variable_info = (gd_api . godot_method_bind_get_method) (class_name , "get_variable_info\0" . as_ptr () as * const c_char) ; table . has_custom_signal = (gd_api . godot_method_bind_get_method) (class_name , "has_custom_signal\0" . as_ptr () as * const c_char) ; table . has_data_connection = (gd_api . godot_method_bind_get_method) (class_name , "has_data_connection\0" . as_ptr () as * const c_char) ; table . has_function = (gd_api . godot_method_bind_get_method) (class_name , "has_function\0" . as_ptr () as * const c_char) ; table . has_node = (gd_api . godot_method_bind_get_method) (class_name , "has_node\0" . as_ptr () as * const c_char) ; table . has_sequence_connection = (gd_api . godot_method_bind_get_method) (class_name , "has_sequence_connection\0" . as_ptr () as * const c_char) ; table . has_variable = (gd_api . godot_method_bind_get_method) (class_name , "has_variable\0" . as_ptr () as * const c_char) ; table . remove_custom_signal = (gd_api . godot_method_bind_get_method) (class_name , "remove_custom_signal\0" . as_ptr () as * const c_char) ; table . remove_function = (gd_api . godot_method_bind_get_method) (class_name , "remove_function\0" . as_ptr () as * const c_char) ; table . remove_node = (gd_api . godot_method_bind_get_method) (class_name , "remove_node\0" . as_ptr () as * const c_char) ; table . remove_variable = (gd_api . godot_method_bind_get_method) (class_name , "remove_variable\0" . as_ptr () as * const c_char) ; table . rename_custom_signal = (gd_api . godot_method_bind_get_method) (class_name , "rename_custom_signal\0" . as_ptr () as * const c_char) ; table . rename_function = (gd_api . godot_method_bind_get_method) (class_name , "rename_function\0" . as_ptr () as * const c_char) ; table . rename_variable = (gd_api . godot_method_bind_get_method) (class_name , "rename_variable\0" . as_ptr () as * const c_char) ; table . sequence_connect = (gd_api . godot_method_bind_get_method) (class_name , "sequence_connect\0" . as_ptr () as * const c_char) ; table . sequence_disconnect = (gd_api . godot_method_bind_get_method) (class_name , "sequence_disconnect\0" . as_ptr () as * const c_char) ; table . set_function_scroll = (gd_api . godot_method_bind_get_method) (class_name , "set_function_scroll\0" . as_ptr () as * const c_char) ; table . set_instance_base_type = (gd_api . godot_method_bind_get_method) (class_name , "set_instance_base_type\0" . as_ptr () as * const c_char) ; table . set_node_position = (gd_api . godot_method_bind_get_method) (class_name , "set_node_position\0" . as_ptr () as * const c_char) ; table . set_variable_default_value = (gd_api . godot_method_bind_get_method) (class_name , "set_variable_default_value\0" . as_ptr () as * const c_char) ; table . set_variable_export = (gd_api . godot_method_bind_get_method) (class_name , "set_variable_export\0" . as_ptr () as * const c_char) ; table . set_variable_info = (gd_api . godot_method_bind_get_method) (class_name , "set_variable_info\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:220:5159 [INFO] [stdout] | [INFO] [stdout] 220 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 220 | # [doc = "`core class PCKPacker` inherits `Reference` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_pckpacker.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nPCKPacker inherits methods from:\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct PCKPacker { this : RawObject < Self > , } impl PCKPacker { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = PCKPackerMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "Adds the `source_path` file to the current PCK package at the `pck_path` internal path (should start with `res://`)."] # [doc = ""] # [inline] pub fn add_file (& self , pck_path : impl Into < GodotString > , source_path : impl Into < GodotString >) -> GodotResult { unsafe { let method_bind : * mut sys :: godot_method_bind = PCKPackerMethodTable :: get (get_api ()) . add_file ; let ret = crate :: icalls :: icallptr_i64_str_str (method_bind , self . this . sys () . as_ptr () , pck_path . into () , source_path . into ()) ; GodotError :: result_from_sys (ret as _) } } # [doc = "Writes the files specified using all [method add_file] calls since the last flush. If `verbose` is `true`, a list of files added will be printed to the console for easier debugging.\n# Default Arguments\n* `verbose` - `false`"] # [doc = ""] # [inline] pub fn flush (& self , verbose : bool) -> GodotResult { unsafe { let method_bind : * mut sys :: godot_method_bind = PCKPackerMethodTable :: get (get_api ()) . flush ; let ret = crate :: icalls :: icallptr_i64_bool (method_bind , self . this . sys () . as_ptr () , verbose) ; GodotError :: result_from_sys (ret as _) } } # [doc = "Creates a new PCK file with the name `pck_name`. The `.pck` file extension isn't added automatically, so it should be part of `pck_name` (even though it's not required).\n# Default Arguments\n* `alignment` - `0`"] # [doc = ""] # [inline] pub fn pck_start (& self , pck_name : impl Into < GodotString > , alignment : i64) -> GodotResult { unsafe { let method_bind : * mut sys :: godot_method_bind = PCKPackerMethodTable :: get (get_api ()) . pck_start ; let ret = crate :: icalls :: icallptr_i64_str_i64 (method_bind , self . this . sys () . as_ptr () , pck_name . into () , alignment) ; GodotError :: result_from_sys (ret as _) } } } impl gdnative_core :: private :: godot_object :: Sealed for PCKPacker { } unsafe impl GodotObject for PCKPacker { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "PCKPacker" } } impl std :: ops :: Deref for PCKPacker { type Target = crate :: generated :: reference :: Reference ; # [inline] fn deref (& self) -> & crate :: generated :: reference :: Reference { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for PCKPacker { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: reference :: Reference { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: reference :: Reference > for PCKPacker { } unsafe impl SubClass < crate :: generated :: object :: Object > for PCKPacker { } impl Instanciable for PCKPacker { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { PCKPacker :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct PCKPackerMethodTable { pub class_constructor : sys :: godot_class_constructor , pub add_file : * mut sys :: godot_method_bind , pub flush : * mut sys :: godot_method_bind , pub pck_start : * mut sys :: godot_method_bind } impl PCKPackerMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : PCKPackerMethodTable = PCKPackerMethodTable { class_constructor : None , add_file : 0 as * mut sys :: godot_method_bind , flush : 0 as * mut sys :: godot_method_bind , pck_start : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { PCKPackerMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "PCKPacker\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . add_file = (gd_api . godot_method_bind_get_method) (class_name , "add_file\0" . as_ptr () as * const c_char) ; table . flush = (gd_api . godot_method_bind_get_method) (class_name , "flush\0" . as_ptr () as * const c_char) ; table . pck_start = (gd_api . godot_method_bind_get_method) (class_name , "pck_start\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:226:8442 [INFO] [stdout] | [INFO] [stdout] 226 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 226 | # [doc = "`core class VisualShaderNodeCubeMap` inherits `VisualShaderNode` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_visualshadernodecubemap.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nVisualShaderNodeCubeMap inherits methods from:\n - [VisualShaderNode](struct.VisualShaderNode.html)\n - [Resource](struct.Resource.html)\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct VisualShaderNodeCubeMap { this : RawObject < Self > , } # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct Source (pub i64) ; impl Source { pub const TEXTURE : Source = Source (0i64) ; pub const PORT : Source = Source (1i64) ; } impl From < i64 > for Source { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < Source > for i64 { # [inline] fn from (v : Source) -> Self { v . 0 } } # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct TextureType (pub i64) ; impl TextureType { pub const DATA : TextureType = TextureType (0i64) ; pub const COLOR : TextureType = TextureType (1i64) ; pub const NORMALMAP : TextureType = TextureType (2i64) ; } impl From < i64 > for TextureType { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < TextureType > for i64 { # [inline] fn from (v : TextureType) -> Self { v . 0 } } # [doc = "Constants"] # [allow (non_upper_case_globals)] impl VisualShaderNodeCubeMap { pub const SOURCE_PORT : i64 = 1i64 ; pub const SOURCE_TEXTURE : i64 = 0i64 ; pub const TYPE_COLOR : i64 = 1i64 ; pub const TYPE_DATA : i64 = 0i64 ; pub const TYPE_NORMALMAP : i64 = 2i64 ; } impl VisualShaderNodeCubeMap { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = VisualShaderNodeCubeMapMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "The [CubeMap] texture to sample when using [constant SOURCE_TEXTURE] as [member source]."] # [doc = ""] # [inline] pub fn cube_map (& self) -> Option < Ref < crate :: generated :: cube_map :: CubeMap , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualShaderNodeCubeMapMethodTable :: get (get_api ()) . get_cube_map ; let ret = crate :: icalls :: icallptr_obj (method_bind , self . this . sys () . as_ptr ()) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: cube_map :: CubeMap , thread_access :: Shared >> :: move_from_sys (sys)) } } # [doc = "Defines which source should be used for the sampling. See [enum Source] for options."] # [doc = ""] # [inline] pub fn source (& self) -> crate :: generated :: visual_shader_node_cube_map :: Source { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualShaderNodeCubeMapMethodTable :: get (get_api ()) . get_source ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; crate :: generated :: visual_shader_node_cube_map :: Source (ret) } } # [doc = "Defines the type of data provided by the source texture. See [enum TextureType] for options."] # [doc = ""] # [inline] pub fn texture_type (& self) -> crate :: generated :: visual_shader_node_cube_map :: TextureType { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualShaderNodeCubeMapMethodTable :: get (get_api ()) . get_texture_type ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; crate :: generated :: visual_shader_node_cube_map :: TextureType (ret) } } # [doc = "The [CubeMap] texture to sample when using [constant SOURCE_TEXTURE] as [member source]."] # [doc = ""] # [inline] pub fn set_cube_map (& self , value : impl AsArg < crate :: generated :: cube_map :: CubeMap >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualShaderNodeCubeMapMethodTable :: get (get_api ()) . set_cube_map ; let ret = crate :: icalls :: icallptr_void_obj (method_bind , self . this . sys () . as_ptr () , value . as_arg_ptr ()) ; } } # [doc = "Defines which source should be used for the sampling. See [enum Source] for options."] # [doc = ""] # [inline] pub fn set_source (& self , value : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualShaderNodeCubeMapMethodTable :: get (get_api ()) . set_source ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , value) ; } } # [doc = "Defines the type of data provided by the source texture. See [enum TextureType] for options."] # [doc = ""] # [inline] pub fn set_texture_type (& self , value : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualShaderNodeCubeMapMethodTable :: get (get_api ()) . set_texture_type ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , value) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for VisualShaderNodeCubeMap { } unsafe impl GodotObject for VisualShaderNodeCubeMap { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "VisualShaderNodeCubeMap" } } impl std :: ops :: Deref for VisualShaderNodeCubeMap { type Target = crate :: generated :: visual_shader_node :: VisualShaderNode ; # [inline] fn deref (& self) -> & crate :: generated :: visual_shader_node :: VisualShaderNode { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for VisualShaderNodeCubeMap { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: visual_shader_node :: VisualShaderNode { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: visual_shader_node :: VisualShaderNode > for VisualShaderNodeCubeMap { } unsafe impl SubClass < crate :: generated :: resource :: Resource > for VisualShaderNodeCubeMap { } unsafe impl SubClass < crate :: generated :: reference :: Reference > for VisualShaderNodeCubeMap { } unsafe impl SubClass < crate :: generated :: object :: Object > for VisualShaderNodeCubeMap { } impl Instanciable for VisualShaderNodeCubeMap { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { VisualShaderNodeCubeMap :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct VisualShaderNodeCubeMapMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_cube_map : * mut sys :: godot_method_bind , pub get_source : * mut sys :: godot_method_bind , pub get_texture_type : * mut sys :: godot_method_bind , pub set_cube_map : * mut sys :: godot_method_bind , pub set_source : * mut sys :: godot_method_bind , pub set_texture_type : * mut sys :: godot_method_bind } impl VisualShaderNodeCubeMapMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : VisualShaderNodeCubeMapMethodTable = VisualShaderNodeCubeMapMethodTable { class_constructor : None , get_cube_map : 0 as * mut sys :: godot_method_bind , get_source : 0 as * mut sys :: godot_method_bind , get_texture_type : 0 as * mut sys :: godot_method_bind , set_cube_map : 0 as * mut sys :: godot_method_bind , set_source : 0 as * mut sys :: godot_method_bind , set_texture_type : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { VisualShaderNodeCubeMapMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "VisualShaderNodeCubeMap\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_cube_map = (gd_api . godot_method_bind_get_method) (class_name , "get_cube_map\0" . as_ptr () as * const c_char) ; table . get_source = (gd_api . godot_method_bind_get_method) (class_name , "get_source\0" . as_ptr () as * const c_char) ; table . get_texture_type = (gd_api . godot_method_bind_get_method) (class_name , "get_texture_type\0" . as_ptr () as * const c_char) ; table . set_cube_map = (gd_api . godot_method_bind_get_method) (class_name , "set_cube_map\0" . as_ptr () as * const c_char) ; table . set_source = (gd_api . godot_method_bind_get_method) (class_name , "set_source\0" . as_ptr () as * const c_char) ; table . set_texture_type = (gd_api . godot_method_bind_get_method) (class_name , "set_texture_type\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:232:23671 [INFO] [stdout] | [INFO] [stdout] 232 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 232 | # [doc = "`tools class EditorInterface` inherits `Node` (unsafe)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_editorinterface.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = ""] # [doc = "\n## Class hierarchy\n\nEditorInterface inherits methods from:\n - [Node](struct.Node.html)\n - [Object](struct.Object.html)\n"] # [doc = "\n## Tool\n\nThis class is used to interact with Godot's editor."] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct EditorInterface { this : RawObject < Self > , } impl EditorInterface { # [doc = ""] # [doc = ""] # [inline] pub fn edit_node (& self , node : impl AsArg < crate :: generated :: node :: Node >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorInterfaceMethodTable :: get (get_api ()) . edit_node ; let ret = crate :: icalls :: icallptr_void_obj (method_bind , self . this . sys () . as_ptr () , node . as_arg_ptr ()) ; } } # [doc = "Edits the given [Resource]."] # [doc = ""] # [inline] pub fn edit_resource (& self , resource : impl AsArg < crate :: generated :: resource :: Resource >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorInterfaceMethodTable :: get (get_api ()) . edit_resource ; let ret = crate :: icalls :: icallptr_void_obj (method_bind , self . this . sys () . as_ptr () , resource . as_arg_ptr ()) ; } } # [doc = "Returns the main container of Godot editor's window. For example, you can use it to retrieve the size of the container and place your controls accordingly."] # [doc = ""] # [inline] pub fn get_base_control (& self) -> Option < Ref < crate :: generated :: control :: Control , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorInterfaceMethodTable :: get (get_api ()) . get_base_control ; let ret = crate :: icalls :: icallptr_obj (method_bind , self . this . sys () . as_ptr ()) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: control :: Control , thread_access :: Shared >> :: move_from_sys (sys)) } } # [doc = "Returns the current path being viewed in the [FileSystemDock]."] # [doc = ""] # [inline] pub fn get_current_path (& self) -> GodotString { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorInterfaceMethodTable :: get (get_api ()) . get_current_path ; let ret = crate :: icalls :: icallptr_str (method_bind , self . this . sys () . as_ptr ()) ; GodotString :: from_sys (ret) } } # [doc = "Returns the edited (current) scene's root [Node]."] # [doc = ""] # [inline] pub fn get_edited_scene_root (& self) -> Option < Ref < crate :: generated :: node :: Node , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorInterfaceMethodTable :: get (get_api ()) . get_edited_scene_root ; let ret = crate :: icalls :: icallptr_obj (method_bind , self . this . sys () . as_ptr ()) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: node :: Node , thread_access :: Shared >> :: move_from_sys (sys)) } } # [doc = ""] # [doc = ""] # [inline] pub fn get_editor_scale (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorInterfaceMethodTable :: get (get_api ()) . get_editor_scale ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Returns the editor's [EditorSettings] instance."] # [doc = ""] # [inline] pub fn get_editor_settings (& self) -> Option < Ref < crate :: generated :: editor_settings :: EditorSettings , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorInterfaceMethodTable :: get (get_api ()) . get_editor_settings ; let ret = crate :: icalls :: icallptr_obj (method_bind , self . this . sys () . as_ptr ()) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: editor_settings :: EditorSettings , thread_access :: Shared >> :: move_from_sys (sys)) } } # [doc = "Returns the main editor control. Use this as a parent for main screens.\n**Note:** This returns the main editor control containing the whole editor, not the 2D or 3D viewports specifically."] # [doc = ""] # [inline] pub fn get_editor_viewport (& self) -> Option < Ref < crate :: generated :: control :: Control , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorInterfaceMethodTable :: get (get_api ()) . get_editor_viewport ; let ret = crate :: icalls :: icallptr_obj (method_bind , self . this . sys () . as_ptr ()) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: control :: Control , thread_access :: Shared >> :: move_from_sys (sys)) } } # [doc = "Returns the editor's [FileSystemDock] instance."] # [doc = ""] # [inline] pub fn get_file_system_dock (& self) -> Option < Ref < crate :: generated :: file_system_dock :: FileSystemDock , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorInterfaceMethodTable :: get (get_api ()) . get_file_system_dock ; let ret = crate :: icalls :: icallptr_obj (method_bind , self . this . sys () . as_ptr ()) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: file_system_dock :: FileSystemDock , thread_access :: Shared >> :: move_from_sys (sys)) } } # [doc = "Returns the editor's [EditorInspector] instance."] # [doc = ""] # [inline] pub fn get_inspector (& self) -> Option < Ref < crate :: generated :: editor_inspector :: EditorInspector , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorInterfaceMethodTable :: get (get_api ()) . get_inspector ; let ret = crate :: icalls :: icallptr_obj (method_bind , self . this . sys () . as_ptr ()) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: editor_inspector :: EditorInspector , thread_access :: Shared >> :: move_from_sys (sys)) } } # [doc = "Returns an [Array] with the file paths of the currently opened scenes."] # [doc = ""] # [inline] pub fn get_open_scenes (& self) -> VariantArray { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorInterfaceMethodTable :: get (get_api ()) . get_open_scenes ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < VariantArray > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns the name of the scene that is being played. If no scene is currently being played, returns an empty string."] # [doc = ""] # [inline] pub fn get_playing_scene (& self) -> GodotString { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorInterfaceMethodTable :: get (get_api ()) . get_playing_scene ; let ret = crate :: icalls :: icallptr_str (method_bind , self . this . sys () . as_ptr ()) ; GodotString :: from_sys (ret) } } # [doc = "Returns the editor's [EditorFileSystem] instance."] # [doc = ""] # [inline] pub fn get_resource_filesystem (& self) -> Option < Ref < crate :: generated :: editor_file_system :: EditorFileSystem , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorInterfaceMethodTable :: get (get_api ()) . get_resource_filesystem ; let ret = crate :: icalls :: icallptr_obj (method_bind , self . this . sys () . as_ptr ()) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: editor_file_system :: EditorFileSystem , thread_access :: Shared >> :: move_from_sys (sys)) } } # [doc = "Returns the editor's [EditorResourcePreview] instance."] # [doc = ""] # [inline] pub fn get_resource_previewer (& self) -> Option < Ref < crate :: generated :: editor_resource_preview :: EditorResourcePreview , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorInterfaceMethodTable :: get (get_api ()) . get_resource_previewer ; let ret = crate :: icalls :: icallptr_obj (method_bind , self . this . sys () . as_ptr ()) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: editor_resource_preview :: EditorResourcePreview , thread_access :: Shared >> :: move_from_sys (sys)) } } # [doc = "Returns the editor's [ScriptEditor] instance."] # [doc = ""] # [inline] pub fn get_script_editor (& self) -> Option < Ref < crate :: generated :: script_editor :: ScriptEditor , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorInterfaceMethodTable :: get (get_api ()) . get_script_editor ; let ret = crate :: icalls :: icallptr_obj (method_bind , self . this . sys () . as_ptr ()) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: script_editor :: ScriptEditor , thread_access :: Shared >> :: move_from_sys (sys)) } } # [doc = "Returns the path of the directory currently selected in the [FileSystemDock]. If a file is selected, its base directory will be returned using [method String.get_base_dir] instead."] # [doc = ""] # [inline] pub fn get_selected_path (& self) -> GodotString { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorInterfaceMethodTable :: get (get_api ()) . get_selected_path ; let ret = crate :: icalls :: icallptr_str (method_bind , self . this . sys () . as_ptr ()) ; GodotString :: from_sys (ret) } } # [doc = "Returns the editor's [EditorSelection] instance."] # [doc = ""] # [inline] pub fn get_selection (& self) -> Option < Ref < crate :: generated :: editor_selection :: EditorSelection , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorInterfaceMethodTable :: get (get_api ()) . get_selection ; let ret = crate :: icalls :: icallptr_obj (method_bind , self . this . sys () . as_ptr ()) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: editor_selection :: EditorSelection , thread_access :: Shared >> :: move_from_sys (sys)) } } # [doc = "Shows the given property on the given `object` in the editor's Inspector dock.\n# Default Arguments\n* `for_property` - `\"\"`"] # [doc = ""] # [inline] pub fn inspect_object (& self , object : impl AsArg < crate :: generated :: object :: Object > , for_property : impl Into < GodotString > , inspector_only : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorInterfaceMethodTable :: get (get_api ()) . inspect_object ; let ret = crate :: icalls :: icallptr_void_obj_str_bool (method_bind , self . this . sys () . as_ptr () , object . as_arg_ptr () , for_property . into () , inspector_only) ; } } # [doc = "If `true`, enables distraction-free mode which hides side docks to increase the space available for the main view."] # [doc = ""] # [inline] pub fn is_distraction_free_mode_enabled (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorInterfaceMethodTable :: get (get_api ()) . is_distraction_free_mode_enabled ; let ret = crate :: icalls :: icallptr_bool (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Returns `true` if a scene is currently being played, `false` otherwise. Paused scenes are considered as being played."] # [doc = ""] # [inline] pub fn is_playing_scene (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorInterfaceMethodTable :: get (get_api ()) . is_playing_scene ; let ret = crate :: icalls :: icallptr_bool (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Returns `true` if the specified `plugin` is enabled. The plugin name is the same as its directory name."] # [doc = ""] # [inline] pub fn is_plugin_enabled (& self , plugin : impl Into < GodotString >) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorInterfaceMethodTable :: get (get_api ()) . is_plugin_enabled ; let ret = crate :: icalls :: icallptr_bool_str (method_bind , self . this . sys () . as_ptr () , plugin . into ()) ; ret as _ } } # [doc = "Returns mesh previews rendered at the given size as an [Array] of [Texture]s."] # [doc = ""] # [inline] pub fn make_mesh_previews (& self , meshes : VariantArray , preview_size : i64) -> VariantArray { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorInterfaceMethodTable :: get (get_api ()) . make_mesh_previews ; let ret = crate :: icalls :: icallvar__arr_i64 (method_bind , self . this . sys () . as_ptr () , meshes , preview_size) ; < VariantArray > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Opens the scene at the given path."] # [doc = ""] # [inline] pub fn open_scene_from_path (& self , scene_filepath : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorInterfaceMethodTable :: get (get_api ()) . open_scene_from_path ; let ret = crate :: icalls :: icallptr_void_str (method_bind , self . this . sys () . as_ptr () , scene_filepath . into ()) ; } } # [doc = "Plays the currently active scene."] # [doc = ""] # [inline] pub fn play_current_scene (& self) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorInterfaceMethodTable :: get (get_api ()) . play_current_scene ; let ret = crate :: icalls :: icallptr_void (method_bind , self . this . sys () . as_ptr ()) ; } } # [doc = "Plays the scene specified by its filepath."] # [doc = ""] # [inline] pub fn play_custom_scene (& self , scene_filepath : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorInterfaceMethodTable :: get (get_api ()) . play_custom_scene ; let ret = crate :: icalls :: icallptr_void_str (method_bind , self . this . sys () . as_ptr () , scene_filepath . into ()) ; } } # [doc = "Plays the main scene."] # [doc = ""] # [inline] pub fn play_main_scene (& self) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorInterfaceMethodTable :: get (get_api ()) . play_main_scene ; let ret = crate :: icalls :: icallptr_void (method_bind , self . this . sys () . as_ptr ()) ; } } # [doc = "Reloads the scene at the given path."] # [doc = ""] # [inline] pub fn reload_scene_from_path (& self , scene_filepath : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorInterfaceMethodTable :: get (get_api ()) . reload_scene_from_path ; let ret = crate :: icalls :: icallptr_void_str (method_bind , self . this . sys () . as_ptr () , scene_filepath . into ()) ; } } # [doc = "Saves the scene. Returns either `OK` or `ERR_CANT_CREATE` (see [@GlobalScope] constants)."] # [doc = ""] # [inline] pub fn save_scene (& self) -> GodotResult { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorInterfaceMethodTable :: get (get_api ()) . save_scene ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; GodotError :: result_from_sys (ret as _) } } # [doc = "Saves the scene as a file at `path`.\n# Default Arguments\n* `with_preview` - `true`"] # [doc = ""] # [inline] pub fn save_scene_as (& self , path : impl Into < GodotString > , with_preview : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorInterfaceMethodTable :: get (get_api ()) . save_scene_as ; let ret = crate :: icalls :: icallptr_void_str_bool (method_bind , self . this . sys () . as_ptr () , path . into () , with_preview) ; } } # [doc = "Selects the file, with the path provided by `file`, in the FileSystem dock."] # [doc = ""] # [inline] pub fn select_file (& self , file : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorInterfaceMethodTable :: get (get_api ()) . select_file ; let ret = crate :: icalls :: icallptr_void_str (method_bind , self . this . sys () . as_ptr () , file . into ()) ; } } # [doc = "If `true`, enables distraction-free mode which hides side docks to increase the space available for the main view."] # [doc = ""] # [inline] pub fn set_distraction_free_mode (& self , enter : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorInterfaceMethodTable :: get (get_api ()) . set_distraction_free_mode ; let ret = crate :: icalls :: icallptr_void_bool (method_bind , self . this . sys () . as_ptr () , enter) ; } } # [doc = "Sets the editor's current main screen to the one specified in `name`. `name` must match the text of the tab in question exactly (`2D`, `3D`, `Script`, `AssetLib`)."] # [doc = ""] # [inline] pub fn set_main_screen_editor (& self , name : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorInterfaceMethodTable :: get (get_api ()) . set_main_screen_editor ; let ret = crate :: icalls :: icallptr_void_str (method_bind , self . this . sys () . as_ptr () , name . into ()) ; } } # [doc = "Sets the enabled status of a plugin. The plugin name is the same as its directory name."] # [doc = ""] # [inline] pub fn set_plugin_enabled (& self , plugin : impl Into < GodotString > , enabled : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorInterfaceMethodTable :: get (get_api ()) . set_plugin_enabled ; let ret = crate :: icalls :: icallptr_void_str_bool (method_bind , self . this . sys () . as_ptr () , plugin . into () , enabled) ; } } # [doc = "Stops the scene that is currently playing."] # [doc = ""] # [inline] pub fn stop_playing_scene (& self) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorInterfaceMethodTable :: get (get_api ()) . stop_playing_scene ; let ret = crate :: icalls :: icallptr_void (method_bind , self . this . sys () . as_ptr ()) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for EditorInterface { } unsafe impl GodotObject for EditorInterface { type RefKind = ref_kind :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "EditorInterface" } } impl QueueFree for EditorInterface { # [inline] unsafe fn godot_queue_free (obj : * mut sys :: godot_object) { let method_bind : * mut sys :: godot_method_bind = crate :: generated :: node :: NodeMethodTable :: get (get_api ()) . queue_free ; crate :: icalls :: icallptr_void (method_bind , obj) } } impl std :: ops :: Deref for EditorInterface { type Target = crate :: generated :: node :: Node ; # [inline] fn deref (& self) -> & crate :: generated :: node :: Node { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for EditorInterface { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: node :: Node { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: node :: Node > for EditorInterface { } unsafe impl SubClass < crate :: generated :: object :: Object > for EditorInterface { } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct EditorInterfaceMethodTable { pub class_constructor : sys :: godot_class_constructor , pub edit_node : * mut sys :: godot_method_bind , pub edit_resource : * mut sys :: godot_method_bind , pub get_base_control : * mut sys :: godot_method_bind , pub get_current_path : * mut sys :: godot_method_bind , pub get_edited_scene_root : * mut sys :: godot_method_bind , pub get_editor_scale : * mut sys :: godot_method_bind , pub get_editor_settings : * mut sys :: godot_method_bind , pub get_editor_viewport : * mut sys :: godot_method_bind , pub get_file_system_dock : * mut sys :: godot_method_bind , pub get_inspector : * mut sys :: godot_method_bind , pub get_open_scenes : * mut sys :: godot_method_bind , pub get_playing_scene : * mut sys :: godot_method_bind , pub get_resource_filesystem : * mut sys :: godot_method_bind , pub get_resource_previewer : * mut sys :: godot_method_bind , pub get_script_editor : * mut sys :: godot_method_bind , pub get_selected_path : * mut sys :: godot_method_bind , pub get_selection : * mut sys :: godot_method_bind , pub inspect_object : * mut sys :: godot_method_bind , pub is_distraction_free_mode_enabled : * mut sys :: godot_method_bind , pub is_playing_scene : * mut sys :: godot_method_bind , pub is_plugin_enabled : * mut sys :: godot_method_bind , pub make_mesh_previews : * mut sys :: godot_method_bind , pub open_scene_from_path : * mut sys :: godot_method_bind , pub play_current_scene : * mut sys :: godot_method_bind , pub play_custom_scene : * mut sys :: godot_method_bind , pub play_main_scene : * mut sys :: godot_method_bind , pub reload_scene_from_path : * mut sys :: godot_method_bind , pub save_scene : * mut sys :: godot_method_bind , pub save_scene_as : * mut sys :: godot_method_bind , pub select_file : * mut sys :: godot_method_bind , pub set_distraction_free_mode : * mut sys :: godot_method_bind , pub set_main_screen_editor : * mut sys :: godot_method_bind , pub set_plugin_enabled : * mut sys :: godot_method_bind , pub stop_playing_scene : * mut sys :: godot_method_bind } impl EditorInterfaceMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : EditorInterfaceMethodTable = EditorInterfaceMethodTable { class_constructor : None , edit_node : 0 as * mut sys :: godot_method_bind , edit_resource : 0 as * mut sys :: godot_method_bind , get_base_control : 0 as * mut sys :: godot_method_bind , get_current_path : 0 as * mut sys :: godot_method_bind , get_edited_scene_root : 0 as * mut sys :: godot_method_bind , get_editor_scale : 0 as * mut sys :: godot_method_bind , get_editor_settings : 0 as * mut sys :: godot_method_bind , get_editor_viewport : 0 as * mut sys :: godot_method_bind , get_file_system_dock : 0 as * mut sys :: godot_method_bind , get_inspector : 0 as * mut sys :: godot_method_bind , get_open_scenes : 0 as * mut sys :: godot_method_bind , get_playing_scene : 0 as * mut sys :: godot_method_bind , get_resource_filesystem : 0 as * mut sys :: godot_method_bind , get_resource_previewer : 0 as * mut sys :: godot_method_bind , get_script_editor : 0 as * mut sys :: godot_method_bind , get_selected_path : 0 as * mut sys :: godot_method_bind , get_selection : 0 as * mut sys :: godot_method_bind , inspect_object : 0 as * mut sys :: godot_method_bind , is_distraction_free_mode_enabled : 0 as * mut sys :: godot_method_bind , is_playing_scene : 0 as * mut sys :: godot_method_bind , is_plugin_enabled : 0 as * mut sys :: godot_method_bind , make_mesh_previews : 0 as * mut sys :: godot_method_bind , open_scene_from_path : 0 as * mut sys :: godot_method_bind , play_current_scene : 0 as * mut sys :: godot_method_bind , play_custom_scene : 0 as * mut sys :: godot_method_bind , play_main_scene : 0 as * mut sys :: godot_method_bind , reload_scene_from_path : 0 as * mut sys :: godot_method_bind , save_scene : 0 as * mut sys :: godot_method_bind , save_scene_as : 0 as * mut sys :: godot_method_bind , select_file : 0 as * mut sys :: godot_method_bind , set_distraction_free_mode : 0 as * mut sys :: godot_method_bind , set_main_screen_editor : 0 as * mut sys :: godot_method_bind , set_plugin_enabled : 0 as * mut sys :: godot_method_bind , stop_playing_scene : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { EditorInterfaceMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "EditorInterface\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . edit_node = (gd_api . godot_method_bind_get_method) (class_name , "edit_node\0" . as_ptr () as * const c_char) ; table . edit_resource = (gd_api . godot_method_bind_get_method) (class_name , "edit_resource\0" . as_ptr () as * const c_char) ; table . get_base_control = (gd_api . godot_method_bind_get_method) (class_name , "get_base_control\0" . as_ptr () as * const c_char) ; table . get_current_path = (gd_api . godot_method_bind_get_method) (class_name , "get_current_path\0" . as_ptr () as * const c_char) ; table . get_edited_scene_root = (gd_api . godot_method_bind_get_method) (class_name , "get_edited_scene_root\0" . as_ptr () as * const c_char) ; table . get_editor_scale = (gd_api . godot_method_bind_get_method) (class_name , "get_editor_scale\0" . as_ptr () as * const c_char) ; table . get_editor_settings = (gd_api . godot_method_bind_get_method) (class_name , "get_editor_settings\0" . as_ptr () as * const c_char) ; table . get_editor_viewport = (gd_api . godot_method_bind_get_method) (class_name , "get_editor_viewport\0" . as_ptr () as * const c_char) ; table . get_file_system_dock = (gd_api . godot_method_bind_get_method) (class_name , "get_file_system_dock\0" . as_ptr () as * const c_char) ; table . get_inspector = (gd_api . godot_method_bind_get_method) (class_name , "get_inspector\0" . as_ptr () as * const c_char) ; table . get_open_scenes = (gd_api . godot_method_bind_get_method) (class_name , "get_open_scenes\0" . as_ptr () as * const c_char) ; table . get_playing_scene = (gd_api . godot_method_bind_get_method) (class_name , "get_playing_scene\0" . as_ptr () as * const c_char) ; table . get_resource_filesystem = (gd_api . godot_method_bind_get_method) (class_name , "get_resource_filesystem\0" . as_ptr () as * const c_char) ; table . get_resource_previewer = (gd_api . godot_method_bind_get_method) (class_name , "get_resource_previewer\0" . as_ptr () as * const c_char) ; table . get_script_editor = (gd_api . godot_method_bind_get_method) (class_name , "get_script_editor\0" . as_ptr () as * const c_char) ; table . get_selected_path = (gd_api . godot_method_bind_get_method) (class_name , "get_selected_path\0" . as_ptr () as * const c_char) ; table . get_selection = (gd_api . godot_method_bind_get_method) (class_name , "get_selection\0" . as_ptr () as * const c_char) ; table . inspect_object = (gd_api . godot_method_bind_get_method) (class_name , "inspect_object\0" . as_ptr () as * const c_char) ; table . is_distraction_free_mode_enabled = (gd_api . godot_method_bind_get_method) (class_name , "is_distraction_free_mode_enabled\0" . as_ptr () as * const c_char) ; table . is_playing_scene = (gd_api . godot_method_bind_get_method) (class_name , "is_playing_scene\0" . as_ptr () as * const c_char) ; table . is_plugin_enabled = (gd_api . godot_method_bind_get_method) (class_name , "is_plugin_enabled\0" . as_ptr () as * const c_char) ; table . make_mesh_previews = (gd_api . godot_method_bind_get_method) (class_name , "make_mesh_previews\0" . as_ptr () as * const c_char) ; table . open_scene_from_path = (gd_api . godot_method_bind_get_method) (class_name , "open_scene_from_path\0" . as_ptr () as * const c_char) ; table . play_current_scene = (gd_api . godot_method_bind_get_method) (class_name , "play_current_scene\0" . as_ptr () as * const c_char) ; table . play_custom_scene = (gd_api . godot_method_bind_get_method) (class_name , "play_custom_scene\0" . as_ptr () as * const c_char) ; table . play_main_scene = (gd_api . godot_method_bind_get_method) (class_name , "play_main_scene\0" . as_ptr () as * const c_char) ; table . reload_scene_from_path = (gd_api . godot_method_bind_get_method) (class_name , "reload_scene_from_path\0" . as_ptr () as * const c_char) ; table . save_scene = (gd_api . godot_method_bind_get_method) (class_name , "save_scene\0" . as_ptr () as * const c_char) ; table . save_scene_as = (gd_api . godot_method_bind_get_method) (class_name , "save_scene_as\0" . as_ptr () as * const c_char) ; table . select_file = (gd_api . godot_method_bind_get_method) (class_name , "select_file\0" . as_ptr () as * const c_char) ; table . set_distraction_free_mode = (gd_api . godot_method_bind_get_method) (class_name , "set_distraction_free_mode\0" . as_ptr () as * const c_char) ; table . set_main_screen_editor = (gd_api . godot_method_bind_get_method) (class_name , "set_main_screen_editor\0" . as_ptr () as * const c_char) ; table . set_plugin_enabled = (gd_api . godot_method_bind_get_method) (class_name , "set_plugin_enabled\0" . as_ptr () as * const c_char) ; table . stop_playing_scene = (gd_api . godot_method_bind_get_method) (class_name , "stop_playing_scene\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:238:6230 [INFO] [stdout] | [INFO] [stdout] 238 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 238 | # [doc = "`core class Listener` inherits `Spatial` (unsafe)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_listener.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nNon reference counted objects such as the ones of this type are usually owned by the engine.\n\n`Listener` is a reference-only type. Persistent references can\nonly exist in the unsafe `Ref` form.\n\nIn the cases where Rust code owns an object of this type, for example if the object was just\ncreated on the Rust side and not passed to the engine yet, ownership should be either given\nto the engine or the object must be manually destroyed using `Ref::free`, or `Ref::queue_free`\nif it is a `Node`."] # [doc = "\n## Class hierarchy\n\nListener inherits methods from:\n - [Spatial](struct.Spatial.html)\n - [Node](struct.Node.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct Listener { this : RawObject < Self > , } impl Listener { # [doc = "Creates a new instance of this object.\n\nBecause this type is not reference counted, the lifetime of the returned object\nis *not* automatically managed.\n\nImmediately after creation, the object is owned by the caller, and can be\npassed to the engine (in which case the engine will be responsible for\ndestroying the object) or destroyed manually using `Ref::free`, or preferably\n`Ref::queue_free` if it is a `Node`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = ListenerMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "Disables the listener to use the current camera's listener instead."] # [doc = ""] # [inline] pub fn clear_current (& self) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = ListenerMethodTable :: get (get_api ()) . clear_current ; let ret = crate :: icalls :: icallptr_void (method_bind , self . this . sys () . as_ptr ()) ; } } # [doc = "Returns the listener's global orthonormalized [Transform]."] # [doc = ""] # [inline] pub fn get_listener_transform (& self) -> Transform { unsafe { let method_bind : * mut sys :: godot_method_bind = ListenerMethodTable :: get (get_api ()) . get_listener_transform ; let ret = crate :: icalls :: icallptr_trans (method_bind , self . this . sys () . as_ptr ()) ; mem :: transmute (ret) } } # [doc = "Returns `true` if the listener was made current using [method make_current], `false` otherwise.\n**Note:** There may be more than one Listener marked as \"current\" in the scene tree, but only the one that was made current last will be used."] # [doc = ""] # [inline] pub fn is_current (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = ListenerMethodTable :: get (get_api ()) . is_current ; let ret = crate :: icalls :: icallptr_bool (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Enables the listener. This will override the current camera's listener."] # [doc = ""] # [inline] pub fn make_current (& self) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = ListenerMethodTable :: get (get_api ()) . make_current ; let ret = crate :: icalls :: icallptr_void (method_bind , self . this . sys () . as_ptr ()) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for Listener { } unsafe impl GodotObject for Listener { type RefKind = ref_kind :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "Listener" } } impl QueueFree for Listener { # [inline] unsafe fn godot_queue_free (obj : * mut sys :: godot_object) { let method_bind : * mut sys :: godot_method_bind = crate :: generated :: node :: NodeMethodTable :: get (get_api ()) . queue_free ; crate :: icalls :: icallptr_void (method_bind , obj) } } impl std :: ops :: Deref for Listener { type Target = crate :: generated :: spatial :: Spatial ; # [inline] fn deref (& self) -> & crate :: generated :: spatial :: Spatial { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for Listener { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: spatial :: Spatial { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: spatial :: Spatial > for Listener { } unsafe impl SubClass < crate :: generated :: node :: Node > for Listener { } unsafe impl SubClass < crate :: generated :: object :: Object > for Listener { } impl Instanciable for Listener { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { Listener :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct ListenerMethodTable { pub class_constructor : sys :: godot_class_constructor , pub clear_current : * mut sys :: godot_method_bind , pub get_listener_transform : * mut sys :: godot_method_bind , pub is_current : * mut sys :: godot_method_bind , pub make_current : * mut sys :: godot_method_bind } impl ListenerMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : ListenerMethodTable = ListenerMethodTable { class_constructor : None , clear_current : 0 as * mut sys :: godot_method_bind , get_listener_transform : 0 as * mut sys :: godot_method_bind , is_current : 0 as * mut sys :: godot_method_bind , make_current : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { ListenerMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "Listener\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . clear_current = (gd_api . godot_method_bind_get_method) (class_name , "clear_current\0" . as_ptr () as * const c_char) ; table . get_listener_transform = (gd_api . godot_method_bind_get_method) (class_name , "get_listener_transform\0" . as_ptr () as * const c_char) ; table . is_current = (gd_api . godot_method_bind_get_method) (class_name , "is_current\0" . as_ptr () as * const c_char) ; table . make_current = (gd_api . godot_method_bind_get_method) (class_name , "make_current\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:244:8095 [INFO] [stdout] | [INFO] [stdout] 244 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 244 | # [doc = "`core class WebSocketClient` inherits `WebSocketMultiplayerPeer` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_websocketclient.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nWebSocketClient inherits methods from:\n - [WebSocketMultiplayerPeer](struct.WebSocketMultiplayerPeer.html)\n - [NetworkedMultiplayerPeer](struct.NetworkedMultiplayerPeer.html)\n - [PacketPeer](struct.PacketPeer.html)\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct WebSocketClient { this : RawObject < Self > , } impl WebSocketClient { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = WebSocketClientMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = ""] # [doc = ""] # [inline] pub fn connect_to_url (& self , url : impl Into < GodotString > , protocols : StringArray , gd_mp_api : bool , custom_headers : StringArray) -> GodotResult { unsafe { let method_bind : * mut sys :: godot_method_bind = WebSocketClientMethodTable :: get (get_api ()) . connect_to_url ; let ret = crate :: icalls :: icallptr_i64_str_strarr_bool_strarr (method_bind , self . this . sys () . as_ptr () , url . into () , protocols , gd_mp_api , custom_headers) ; GodotError :: result_from_sys (ret as _) } } # [doc = ""] # [doc = ""] # [inline] pub fn disconnect_from_host (& self , code : i64 , reason : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = WebSocketClientMethodTable :: get (get_api ()) . disconnect_from_host ; let ret = crate :: icalls :: icallptr_void_i64_str (method_bind , self . this . sys () . as_ptr () , code , reason . into ()) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn get_connected_host (& self) -> GodotString { unsafe { let method_bind : * mut sys :: godot_method_bind = WebSocketClientMethodTable :: get (get_api ()) . get_connected_host ; let ret = crate :: icalls :: icallptr_str (method_bind , self . this . sys () . as_ptr ()) ; GodotString :: from_sys (ret) } } # [doc = ""] # [doc = ""] # [inline] pub fn get_connected_port (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = WebSocketClientMethodTable :: get (get_api ()) . get_connected_port ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = ""] # [doc = ""] # [inline] pub fn trusted_ssl_certificate (& self) -> Option < Ref < crate :: generated :: x509_certificate :: X509Certificate , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = WebSocketClientMethodTable :: get (get_api ()) . get_trusted_ssl_certificate ; let ret = crate :: icalls :: icallptr_obj (method_bind , self . this . sys () . as_ptr ()) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: x509_certificate :: X509Certificate , thread_access :: Shared >> :: move_from_sys (sys)) } } # [doc = ""] # [doc = ""] # [inline] pub fn is_verify_ssl_enabled (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = WebSocketClientMethodTable :: get (get_api ()) . is_verify_ssl_enabled ; let ret = crate :: icalls :: icallptr_bool (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = ""] # [doc = ""] # [inline] pub fn set_trusted_ssl_certificate (& self , arg0 : impl AsArg < crate :: generated :: x509_certificate :: X509Certificate >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = WebSocketClientMethodTable :: get (get_api ()) . set_trusted_ssl_certificate ; let ret = crate :: icalls :: icallptr_void_obj (method_bind , self . this . sys () . as_ptr () , arg0 . as_arg_ptr ()) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn set_verify_ssl_enabled (& self , enabled : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = WebSocketClientMethodTable :: get (get_api ()) . set_verify_ssl_enabled ; let ret = crate :: icalls :: icallptr_void_bool (method_bind , self . this . sys () . as_ptr () , enabled) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for WebSocketClient { } unsafe impl GodotObject for WebSocketClient { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "WebSocketClient" } } impl std :: ops :: Deref for WebSocketClient { type Target = crate :: generated :: web_socket_multiplayer_peer :: WebSocketMultiplayerPeer ; # [inline] fn deref (& self) -> & crate :: generated :: web_socket_multiplayer_peer :: WebSocketMultiplayerPeer { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for WebSocketClient { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: web_socket_multiplayer_peer :: WebSocketMultiplayerPeer { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: web_socket_multiplayer_peer :: WebSocketMultiplayerPeer > for WebSocketClient { } unsafe impl SubClass < crate :: generated :: networked_multiplayer_peer :: NetworkedMultiplayerPeer > for WebSocketClient { } unsafe impl SubClass < crate :: generated :: packet_peer :: PacketPeer > for WebSocketClient { } unsafe impl SubClass < crate :: generated :: reference :: Reference > for WebSocketClient { } unsafe impl SubClass < crate :: generated :: object :: Object > for WebSocketClient { } impl Instanciable for WebSocketClient { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { WebSocketClient :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct WebSocketClientMethodTable { pub class_constructor : sys :: godot_class_constructor , pub connect_to_url : * mut sys :: godot_method_bind , pub disconnect_from_host : * mut sys :: godot_method_bind , pub get_connected_host : * mut sys :: godot_method_bind , pub get_connected_port : * mut sys :: godot_method_bind , pub get_trusted_ssl_certificate : * mut sys :: godot_method_bind , pub is_verify_ssl_enabled : * mut sys :: godot_method_bind , pub set_trusted_ssl_certificate : * mut sys :: godot_method_bind , pub set_verify_ssl_enabled : * mut sys :: godot_method_bind } impl WebSocketClientMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : WebSocketClientMethodTable = WebSocketClientMethodTable { class_constructor : None , connect_to_url : 0 as * mut sys :: godot_method_bind , disconnect_from_host : 0 as * mut sys :: godot_method_bind , get_connected_host : 0 as * mut sys :: godot_method_bind , get_connected_port : 0 as * mut sys :: godot_method_bind , get_trusted_ssl_certificate : 0 as * mut sys :: godot_method_bind , is_verify_ssl_enabled : 0 as * mut sys :: godot_method_bind , set_trusted_ssl_certificate : 0 as * mut sys :: godot_method_bind , set_verify_ssl_enabled : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { WebSocketClientMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "WebSocketClient\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . connect_to_url = (gd_api . godot_method_bind_get_method) (class_name , "connect_to_url\0" . as_ptr () as * const c_char) ; table . disconnect_from_host = (gd_api . godot_method_bind_get_method) (class_name , "disconnect_from_host\0" . as_ptr () as * const c_char) ; table . get_connected_host = (gd_api . godot_method_bind_get_method) (class_name , "get_connected_host\0" . as_ptr () as * const c_char) ; table . get_connected_port = (gd_api . godot_method_bind_get_method) (class_name , "get_connected_port\0" . as_ptr () as * const c_char) ; table . get_trusted_ssl_certificate = (gd_api . godot_method_bind_get_method) (class_name , "get_trusted_ssl_certificate\0" . as_ptr () as * const c_char) ; table . is_verify_ssl_enabled = (gd_api . godot_method_bind_get_method) (class_name , "is_verify_ssl_enabled\0" . as_ptr () as * const c_char) ; table . set_trusted_ssl_certificate = (gd_api . godot_method_bind_get_method) (class_name , "set_trusted_ssl_certificate\0" . as_ptr () as * const c_char) ; table . set_verify_ssl_enabled = (gd_api . godot_method_bind_get_method) (class_name , "set_verify_ssl_enabled\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:250:4661 [INFO] [stdout] | [INFO] [stdout] 250 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 250 | # [doc = "`core class AudioEffectAmplify` inherits `AudioEffect` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_audioeffectamplify.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nAudioEffectAmplify inherits methods from:\n - [AudioEffect](struct.AudioEffect.html)\n - [Resource](struct.Resource.html)\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct AudioEffectAmplify { this : RawObject < Self > , } impl AudioEffectAmplify { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AudioEffectAmplifyMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "Amount of amplification in decibels. Positive values make the sound louder, negative values make it quieter. Value can range from -80 to 24."] # [doc = ""] # [inline] pub fn volume_db (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectAmplifyMethodTable :: get (get_api ()) . get_volume_db ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Amount of amplification in decibels. Positive values make the sound louder, negative values make it quieter. Value can range from -80 to 24."] # [doc = ""] # [inline] pub fn set_volume_db (& self , volume : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectAmplifyMethodTable :: get (get_api ()) . set_volume_db ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , volume) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for AudioEffectAmplify { } unsafe impl GodotObject for AudioEffectAmplify { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AudioEffectAmplify" } } impl std :: ops :: Deref for AudioEffectAmplify { type Target = crate :: generated :: audio_effect :: AudioEffect ; # [inline] fn deref (& self) -> & crate :: generated :: audio_effect :: AudioEffect { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AudioEffectAmplify { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: audio_effect :: AudioEffect { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: audio_effect :: AudioEffect > for AudioEffectAmplify { } unsafe impl SubClass < crate :: generated :: resource :: Resource > for AudioEffectAmplify { } unsafe impl SubClass < crate :: generated :: reference :: Reference > for AudioEffectAmplify { } unsafe impl SubClass < crate :: generated :: object :: Object > for AudioEffectAmplify { } impl Instanciable for AudioEffectAmplify { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { AudioEffectAmplify :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AudioEffectAmplifyMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_volume_db : * mut sys :: godot_method_bind , pub set_volume_db : * mut sys :: godot_method_bind } impl AudioEffectAmplifyMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AudioEffectAmplifyMethodTable = AudioEffectAmplifyMethodTable { class_constructor : None , get_volume_db : 0 as * mut sys :: godot_method_bind , set_volume_db : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { AudioEffectAmplifyMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AudioEffectAmplify\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_volume_db = (gd_api . godot_method_bind_get_method) (class_name , "get_volume_db\0" . as_ptr () as * const c_char) ; table . set_volume_db = (gd_api . godot_method_bind_get_method) (class_name , "set_volume_db\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:256:9385 [INFO] [stdout] | [INFO] [stdout] 256 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 256 | # [doc = "`core class AudioEffectDistortion` inherits `AudioEffect` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_audioeffectdistortion.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nAudioEffectDistortion inherits methods from:\n - [AudioEffect](struct.AudioEffect.html)\n - [Resource](struct.Resource.html)\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct AudioEffectDistortion { this : RawObject < Self > , } # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct Mode (pub i64) ; impl Mode { pub const CLIP : Mode = Mode (0i64) ; pub const ATAN : Mode = Mode (1i64) ; pub const LOFI : Mode = Mode (2i64) ; pub const OVERDRIVE : Mode = Mode (3i64) ; pub const WAVESHAPE : Mode = Mode (4i64) ; } impl From < i64 > for Mode { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < Mode > for i64 { # [inline] fn from (v : Mode) -> Self { v . 0 } } # [doc = "Constants"] # [allow (non_upper_case_globals)] impl AudioEffectDistortion { pub const MODE_ATAN : i64 = 1i64 ; pub const MODE_CLIP : i64 = 0i64 ; pub const MODE_LOFI : i64 = 2i64 ; pub const MODE_OVERDRIVE : i64 = 3i64 ; pub const MODE_WAVESHAPE : i64 = 4i64 ; } impl AudioEffectDistortion { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AudioEffectDistortionMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "Distortion power. Value can range from 0 to 1."] # [doc = ""] # [inline] pub fn drive (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectDistortionMethodTable :: get (get_api ()) . get_drive ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "High-pass filter, in Hz. Frequencies higher than this value will not be affected by the distortion. Value can range from 1 to 20000."] # [doc = ""] # [inline] pub fn keep_hf_hz (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectDistortionMethodTable :: get (get_api ()) . get_keep_hf_hz ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Distortion type."] # [doc = ""] # [inline] pub fn mode (& self) -> crate :: generated :: audio_effect_distortion :: Mode { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectDistortionMethodTable :: get (get_api ()) . get_mode ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; crate :: generated :: audio_effect_distortion :: Mode (ret) } } # [doc = "Increases or decreases the volume after the effect. Value can range from -80 to 24."] # [doc = ""] # [inline] pub fn post_gain (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectDistortionMethodTable :: get (get_api ()) . get_post_gain ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Increases or decreases the volume before the effect. Value can range from -60 to 60."] # [doc = ""] # [inline] pub fn pre_gain (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectDistortionMethodTable :: get (get_api ()) . get_pre_gain ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Distortion power. Value can range from 0 to 1."] # [doc = ""] # [inline] pub fn set_drive (& self , drive : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectDistortionMethodTable :: get (get_api ()) . set_drive ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , drive) ; } } # [doc = "High-pass filter, in Hz. Frequencies higher than this value will not be affected by the distortion. Value can range from 1 to 20000."] # [doc = ""] # [inline] pub fn set_keep_hf_hz (& self , keep_hf_hz : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectDistortionMethodTable :: get (get_api ()) . set_keep_hf_hz ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , keep_hf_hz) ; } } # [doc = "Distortion type."] # [doc = ""] # [inline] pub fn set_mode (& self , mode : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectDistortionMethodTable :: get (get_api ()) . set_mode ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , mode) ; } } # [doc = "Increases or decreases the volume after the effect. Value can range from -80 to 24."] # [doc = ""] # [inline] pub fn set_post_gain (& self , post_gain : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectDistortionMethodTable :: get (get_api ()) . set_post_gain ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , post_gain) ; } } # [doc = "Increases or decreases the volume before the effect. Value can range from -60 to 60."] # [doc = ""] # [inline] pub fn set_pre_gain (& self , pre_gain : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectDistortionMethodTable :: get (get_api ()) . set_pre_gain ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , pre_gain) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for AudioEffectDistortion { } unsafe impl GodotObject for AudioEffectDistortion { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AudioEffectDistortion" } } impl std :: ops :: Deref for AudioEffectDistortion { type Target = crate :: generated :: audio_effect :: AudioEffect ; # [inline] fn deref (& self) -> & crate :: generated :: audio_effect :: AudioEffect { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AudioEffectDistortion { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: audio_effect :: AudioEffect { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: audio_effect :: AudioEffect > for AudioEffectDistortion { } unsafe impl SubClass < crate :: generated :: resource :: Resource > for AudioEffectDistortion { } unsafe impl SubClass < crate :: generated :: reference :: Reference > for AudioEffectDistortion { } unsafe impl SubClass < crate :: generated :: object :: Object > for AudioEffectDistortion { } impl Instanciable for AudioEffectDistortion { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { AudioEffectDistortion :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AudioEffectDistortionMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_drive : * mut sys :: godot_method_bind , pub get_keep_hf_hz : * mut sys :: godot_method_bind , pub get_mode : * mut sys :: godot_method_bind , pub get_post_gain : * mut sys :: godot_method_bind , pub get_pre_gain : * mut sys :: godot_method_bind , pub set_drive : * mut sys :: godot_method_bind , pub set_keep_hf_hz : * mut sys :: godot_method_bind , pub set_mode : * mut sys :: godot_method_bind , pub set_post_gain : * mut sys :: godot_method_bind , pub set_pre_gain : * mut sys :: godot_method_bind } impl AudioEffectDistortionMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AudioEffectDistortionMethodTable = AudioEffectDistortionMethodTable { class_constructor : None , get_drive : 0 as * mut sys :: godot_method_bind , get_keep_hf_hz : 0 as * mut sys :: godot_method_bind , get_mode : 0 as * mut sys :: godot_method_bind , get_post_gain : 0 as * mut sys :: godot_method_bind , get_pre_gain : 0 as * mut sys :: godot_method_bind , set_drive : 0 as * mut sys :: godot_method_bind , set_keep_hf_hz : 0 as * mut sys :: godot_method_bind , set_mode : 0 as * mut sys :: godot_method_bind , set_post_gain : 0 as * mut sys :: godot_method_bind , set_pre_gain : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { AudioEffectDistortionMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AudioEffectDistortion\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_drive = (gd_api . godot_method_bind_get_method) (class_name , "get_drive\0" . as_ptr () as * const c_char) ; table . get_keep_hf_hz = (gd_api . godot_method_bind_get_method) (class_name , "get_keep_hf_hz\0" . as_ptr () as * const c_char) ; table . get_mode = (gd_api . godot_method_bind_get_method) (class_name , "get_mode\0" . as_ptr () as * const c_char) ; table . get_post_gain = (gd_api . godot_method_bind_get_method) (class_name , "get_post_gain\0" . as_ptr () as * const c_char) ; table . get_pre_gain = (gd_api . godot_method_bind_get_method) (class_name , "get_pre_gain\0" . as_ptr () as * const c_char) ; table . set_drive = (gd_api . godot_method_bind_get_method) (class_name , "set_drive\0" . as_ptr () as * const c_char) ; table . set_keep_hf_hz = (gd_api . godot_method_bind_get_method) (class_name , "set_keep_hf_hz\0" . as_ptr () as * const c_char) ; table . set_mode = (gd_api . godot_method_bind_get_method) (class_name , "set_mode\0" . as_ptr () as * const c_char) ; table . set_post_gain = (gd_api . godot_method_bind_get_method) (class_name , "set_post_gain\0" . as_ptr () as * const c_char) ; table . set_pre_gain = (gd_api . godot_method_bind_get_method) (class_name , "set_pre_gain\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:262:6325 [INFO] [stdout] | [INFO] [stdout] 262 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 262 | # [doc = "`core class ConeTwistJoint` inherits `Joint` (unsafe)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_conetwistjoint.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nNon reference counted objects such as the ones of this type are usually owned by the engine.\n\n`ConeTwistJoint` is a reference-only type. Persistent references can\nonly exist in the unsafe `Ref` form.\n\nIn the cases where Rust code owns an object of this type, for example if the object was just\ncreated on the Rust side and not passed to the engine yet, ownership should be either given\nto the engine or the object must be manually destroyed using `Ref::free`, or `Ref::queue_free`\nif it is a `Node`."] # [doc = "\n## Class hierarchy\n\nConeTwistJoint inherits methods from:\n - [Joint](struct.Joint.html)\n - [Spatial](struct.Spatial.html)\n - [Node](struct.Node.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct ConeTwistJoint { this : RawObject < Self > , } # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct Param (pub i64) ; impl Param { pub const SWING_SPAN : Param = Param (0i64) ; pub const TWIST_SPAN : Param = Param (1i64) ; pub const BIAS : Param = Param (2i64) ; pub const SOFTNESS : Param = Param (3i64) ; pub const RELAXATION : Param = Param (4i64) ; pub const MAX : Param = Param (5i64) ; } impl From < i64 > for Param { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < Param > for i64 { # [inline] fn from (v : Param) -> Self { v . 0 } } # [doc = "Constants"] # [allow (non_upper_case_globals)] impl ConeTwistJoint { pub const PARAM_BIAS : i64 = 2i64 ; pub const PARAM_MAX : i64 = 5i64 ; pub const PARAM_RELAXATION : i64 = 4i64 ; pub const PARAM_SOFTNESS : i64 = 3i64 ; pub const PARAM_SWING_SPAN : i64 = 0i64 ; pub const PARAM_TWIST_SPAN : i64 = 1i64 ; } impl ConeTwistJoint { # [doc = "Creates a new instance of this object.\n\nBecause this type is not reference counted, the lifetime of the returned object\nis *not* automatically managed.\n\nImmediately after creation, the object is owned by the caller, and can be\npassed to the engine (in which case the engine will be responsible for\ndestroying the object) or destroyed manually using `Ref::free`, or preferably\n`Ref::queue_free` if it is a `Node`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = ConeTwistJointMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "The ease with which the joint starts to twist. If it's too low, it takes more force to start twisting the joint."] # [doc = ""] # [inline] pub fn param (& self , param : i64) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = ConeTwistJointMethodTable :: get (get_api ()) . get_param ; let ret = crate :: icalls :: icallptr_f64_i64 (method_bind , self . this . sys () . as_ptr () , param) ; ret as _ } } # [doc = "The ease with which the joint starts to twist. If it's too low, it takes more force to start twisting the joint."] # [doc = ""] # [inline] pub fn set_param (& self , param : i64 , value : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = ConeTwistJointMethodTable :: get (get_api ()) . set_param ; let ret = crate :: icalls :: icallptr_void_i64_f64 (method_bind , self . this . sys () . as_ptr () , param , value) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for ConeTwistJoint { } unsafe impl GodotObject for ConeTwistJoint { type RefKind = ref_kind :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "ConeTwistJoint" } } impl QueueFree for ConeTwistJoint { # [inline] unsafe fn godot_queue_free (obj : * mut sys :: godot_object) { let method_bind : * mut sys :: godot_method_bind = crate :: generated :: node :: NodeMethodTable :: get (get_api ()) . queue_free ; crate :: icalls :: icallptr_void (method_bind , obj) } } impl std :: ops :: Deref for ConeTwistJoint { type Target = crate :: generated :: joint :: Joint ; # [inline] fn deref (& self) -> & crate :: generated :: joint :: Joint { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for ConeTwistJoint { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: joint :: Joint { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: joint :: Joint > for ConeTwistJoint { } unsafe impl SubClass < crate :: generated :: spatial :: Spatial > for ConeTwistJoint { } unsafe impl SubClass < crate :: generated :: node :: Node > for ConeTwistJoint { } unsafe impl SubClass < crate :: generated :: object :: Object > for ConeTwistJoint { } impl Instanciable for ConeTwistJoint { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { ConeTwistJoint :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct ConeTwistJointMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_param : * mut sys :: godot_method_bind , pub set_param : * mut sys :: godot_method_bind } impl ConeTwistJointMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : ConeTwistJointMethodTable = ConeTwistJointMethodTable { class_constructor : None , get_param : 0 as * mut sys :: godot_method_bind , set_param : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { ConeTwistJointMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "ConeTwistJoint\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_param = (gd_api . godot_method_bind_get_method) (class_name , "get_param\0" . as_ptr () as * const c_char) ; table . set_param = (gd_api . godot_method_bind_get_method) (class_name , "set_param\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:268:18084 [INFO] [stdout] | [INFO] [stdout] 268 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 268 | # [doc = "`core class MultiMesh` inherits `Resource` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_multimesh.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nMultiMesh inherits methods from:\n - [Resource](struct.Resource.html)\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct MultiMesh { this : RawObject < Self > , } # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct ColorFormat (pub i64) ; impl ColorFormat { pub const NONE : ColorFormat = ColorFormat (0i64) ; pub const _8BIT : ColorFormat = ColorFormat (1i64) ; pub const FLOAT : ColorFormat = ColorFormat (2i64) ; } impl From < i64 > for ColorFormat { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < ColorFormat > for i64 { # [inline] fn from (v : ColorFormat) -> Self { v . 0 } } # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct CustomDataFormat (pub i64) ; impl CustomDataFormat { pub const NONE : CustomDataFormat = CustomDataFormat (0i64) ; pub const _8BIT : CustomDataFormat = CustomDataFormat (1i64) ; pub const FLOAT : CustomDataFormat = CustomDataFormat (2i64) ; } impl From < i64 > for CustomDataFormat { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < CustomDataFormat > for i64 { # [inline] fn from (v : CustomDataFormat) -> Self { v . 0 } } # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct TransformFormat (pub i64) ; impl TransformFormat { pub const _2D : TransformFormat = TransformFormat (0i64) ; pub const _3D : TransformFormat = TransformFormat (1i64) ; } impl From < i64 > for TransformFormat { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < TransformFormat > for i64 { # [inline] fn from (v : TransformFormat) -> Self { v . 0 } } # [doc = "Constants"] # [allow (non_upper_case_globals)] impl MultiMesh { pub const COLOR_8BIT : i64 = 1i64 ; pub const COLOR_FLOAT : i64 = 2i64 ; pub const COLOR_NONE : i64 = 0i64 ; pub const CUSTOM_DATA_8BIT : i64 = 1i64 ; pub const CUSTOM_DATA_FLOAT : i64 = 2i64 ; pub const CUSTOM_DATA_NONE : i64 = 0i64 ; pub const TRANSFORM_2D : i64 = 0i64 ; pub const TRANSFORM_3D : i64 = 1i64 ; } impl MultiMesh { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = MultiMeshMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "Returns the visibility axis-aligned bounding box in local space. See also [method VisualInstance.get_transformed_aabb]."] # [doc = ""] # [inline] pub fn get_aabb (& self) -> Aabb { unsafe { let method_bind : * mut sys :: godot_method_bind = MultiMeshMethodTable :: get (get_api ()) . get_aabb ; let ret = crate :: icalls :: icallptr_aabb (method_bind , self . this . sys () . as_ptr ()) ; mem :: transmute (ret) } } # [doc = "Format of colors in color array that gets passed to shader."] # [doc = ""] # [inline] pub fn color_format (& self) -> crate :: generated :: multi_mesh :: ColorFormat { unsafe { let method_bind : * mut sys :: godot_method_bind = MultiMeshMethodTable :: get (get_api ()) . get_color_format ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; crate :: generated :: multi_mesh :: ColorFormat (ret) } } # [doc = "Format of custom data in custom data array that gets passed to shader."] # [doc = ""] # [inline] pub fn custom_data_format (& self) -> crate :: generated :: multi_mesh :: CustomDataFormat { unsafe { let method_bind : * mut sys :: godot_method_bind = MultiMeshMethodTable :: get (get_api ()) . get_custom_data_format ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; crate :: generated :: multi_mesh :: CustomDataFormat (ret) } } # [doc = "Gets a specific instance's color."] # [doc = ""] # [inline] pub fn get_instance_color (& self , instance : i64) -> Color { unsafe { let method_bind : * mut sys :: godot_method_bind = MultiMeshMethodTable :: get (get_api ()) . get_instance_color ; let ret = crate :: icalls :: icallptr_color_i64 (method_bind , self . this . sys () . as_ptr () , instance) ; mem :: transmute (ret) } } # [doc = "Number of instances that will get drawn. This clears and (re)sizes the buffers. By default, all instances are drawn but you can limit this with [member visible_instance_count]."] # [doc = ""] # [inline] pub fn instance_count (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = MultiMeshMethodTable :: get (get_api ()) . get_instance_count ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Returns the custom data that has been set for a specific instance."] # [doc = ""] # [inline] pub fn get_instance_custom_data (& self , instance : i64) -> Color { unsafe { let method_bind : * mut sys :: godot_method_bind = MultiMeshMethodTable :: get (get_api ()) . get_instance_custom_data ; let ret = crate :: icalls :: icallptr_color_i64 (method_bind , self . this . sys () . as_ptr () , instance) ; mem :: transmute (ret) } } # [doc = "Returns the [Transform] of a specific instance."] # [doc = ""] # [inline] pub fn get_instance_transform (& self , instance : i64) -> Transform { unsafe { let method_bind : * mut sys :: godot_method_bind = MultiMeshMethodTable :: get (get_api ()) . get_instance_transform ; let ret = crate :: icalls :: icallptr_trans_i64 (method_bind , self . this . sys () . as_ptr () , instance) ; mem :: transmute (ret) } } # [doc = "Returns the [Transform2D] of a specific instance."] # [doc = ""] # [inline] pub fn get_instance_transform_2d (& self , instance : i64) -> Transform2D { unsafe { let method_bind : * mut sys :: godot_method_bind = MultiMeshMethodTable :: get (get_api ()) . get_instance_transform_2d ; let ret = crate :: icalls :: icallptr_trans2D_i64 (method_bind , self . this . sys () . as_ptr () , instance) ; mem :: transmute (ret) } } # [doc = "Mesh to be drawn."] # [doc = ""] # [inline] pub fn mesh (& self) -> Option < Ref < crate :: generated :: mesh :: Mesh , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = MultiMeshMethodTable :: get (get_api ()) . get_mesh ; let ret = crate :: icalls :: icallptr_obj (method_bind , self . this . sys () . as_ptr ()) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: mesh :: Mesh , thread_access :: Shared >> :: move_from_sys (sys)) } } # [doc = "Format of transform used to transform mesh, either 2D or 3D."] # [doc = ""] # [inline] pub fn transform_format (& self) -> crate :: generated :: multi_mesh :: TransformFormat { unsafe { let method_bind : * mut sys :: godot_method_bind = MultiMeshMethodTable :: get (get_api ()) . get_transform_format ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; crate :: generated :: multi_mesh :: TransformFormat (ret) } } # [doc = "Limits the number of instances drawn, -1 draws all instances. Changing this does not change the sizes of the buffers."] # [doc = ""] # [inline] pub fn visible_instance_count (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = MultiMeshMethodTable :: get (get_api ()) . get_visible_instance_count ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Sets all data related to the instances in one go. This is especially useful when loading the data from disk or preparing the data from GDNative.\nAll data is packed in one large float array. An array may look like this: Transform for instance 1, color data for instance 1, custom data for instance 1, transform for instance 2, color data for instance 2, etc...\n[Transform] is stored as 12 floats, [Transform2D] is stored as 8 floats, `COLOR_8BIT` / `CUSTOM_DATA_8BIT` is stored as 1 float (4 bytes as is) and `COLOR_FLOAT` / `CUSTOM_DATA_FLOAT` is stored as 4 floats."] # [doc = ""] # [inline] pub fn set_as_bulk_array (& self , array : Float32Array) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = MultiMeshMethodTable :: get (get_api ()) . set_as_bulk_array ; let ret = crate :: icalls :: icallptr_void_f32arr (method_bind , self . this . sys () . as_ptr () , array) ; } } # [doc = "Format of colors in color array that gets passed to shader."] # [doc = ""] # [inline] pub fn set_color_format (& self , format : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = MultiMeshMethodTable :: get (get_api ()) . set_color_format ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , format) ; } } # [doc = "Format of custom data in custom data array that gets passed to shader."] # [doc = ""] # [inline] pub fn set_custom_data_format (& self , format : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = MultiMeshMethodTable :: get (get_api ()) . set_custom_data_format ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , format) ; } } # [doc = "Sets the color of a specific instance.\nFor the color to take effect, ensure that [member color_format] is non-`null` on the [MultiMesh] and [member SpatialMaterial.vertex_color_use_as_albedo] is `true` on the material."] # [doc = ""] # [inline] pub fn set_instance_color (& self , instance : i64 , color : Color) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = MultiMeshMethodTable :: get (get_api ()) . set_instance_color ; let ret = crate :: icalls :: icallptr_void_i64_color (method_bind , self . this . sys () . as_ptr () , instance , color) ; } } # [doc = "Number of instances that will get drawn. This clears and (re)sizes the buffers. By default, all instances are drawn but you can limit this with [member visible_instance_count]."] # [doc = ""] # [inline] pub fn set_instance_count (& self , count : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = MultiMeshMethodTable :: get (get_api ()) . set_instance_count ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , count) ; } } # [doc = "Sets custom data for a specific instance. Although [Color] is used, it is just a container for 4 floating point numbers. The format of the number can change depending on the [enum CustomDataFormat] used."] # [doc = ""] # [inline] pub fn set_instance_custom_data (& self , instance : i64 , custom_data : Color) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = MultiMeshMethodTable :: get (get_api ()) . set_instance_custom_data ; let ret = crate :: icalls :: icallptr_void_i64_color (method_bind , self . this . sys () . as_ptr () , instance , custom_data) ; } } # [doc = "Sets the [Transform] for a specific instance."] # [doc = ""] # [inline] pub fn set_instance_transform (& self , instance : i64 , transform : Transform) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = MultiMeshMethodTable :: get (get_api ()) . set_instance_transform ; let ret = crate :: icalls :: icallptr_void_i64_trans (method_bind , self . this . sys () . as_ptr () , instance , transform) ; } } # [doc = "Sets the [Transform2D] for a specific instance."] # [doc = ""] # [inline] pub fn set_instance_transform_2d (& self , instance : i64 , transform : Transform2D) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = MultiMeshMethodTable :: get (get_api ()) . set_instance_transform_2d ; let ret = crate :: icalls :: icallptr_void_i64_trans2D (method_bind , self . this . sys () . as_ptr () , instance , transform) ; } } # [doc = "Mesh to be drawn."] # [doc = ""] # [inline] pub fn set_mesh (& self , mesh : impl AsArg < crate :: generated :: mesh :: Mesh >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = MultiMeshMethodTable :: get (get_api ()) . set_mesh ; let ret = crate :: icalls :: icallptr_void_obj (method_bind , self . this . sys () . as_ptr () , mesh . as_arg_ptr ()) ; } } # [doc = "Format of transform used to transform mesh, either 2D or 3D."] # [doc = ""] # [inline] pub fn set_transform_format (& self , format : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = MultiMeshMethodTable :: get (get_api ()) . set_transform_format ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , format) ; } } # [doc = "Limits the number of instances drawn, -1 draws all instances. Changing this does not change the sizes of the buffers."] # [doc = ""] # [inline] pub fn set_visible_instance_count (& self , count : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = MultiMeshMethodTable :: get (get_api ()) . set_visible_instance_count ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , count) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for MultiMesh { } unsafe impl GodotObject for MultiMesh { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "MultiMesh" } } impl std :: ops :: Deref for MultiMesh { type Target = crate :: generated :: resource :: Resource ; # [inline] fn deref (& self) -> & crate :: generated :: resource :: Resource { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for MultiMesh { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: resource :: Resource { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: resource :: Resource > for MultiMesh { } unsafe impl SubClass < crate :: generated :: reference :: Reference > for MultiMesh { } unsafe impl SubClass < crate :: generated :: object :: Object > for MultiMesh { } impl Instanciable for MultiMesh { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { MultiMesh :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct MultiMeshMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_aabb : * mut sys :: godot_method_bind , pub get_color_format : * mut sys :: godot_method_bind , pub get_custom_data_format : * mut sys :: godot_method_bind , pub get_instance_color : * mut sys :: godot_method_bind , pub get_instance_count : * mut sys :: godot_method_bind , pub get_instance_custom_data : * mut sys :: godot_method_bind , pub get_instance_transform : * mut sys :: godot_method_bind , pub get_instance_transform_2d : * mut sys :: godot_method_bind , pub get_mesh : * mut sys :: godot_method_bind , pub get_transform_format : * mut sys :: godot_method_bind , pub get_visible_instance_count : * mut sys :: godot_method_bind , pub set_as_bulk_array : * mut sys :: godot_method_bind , pub set_color_format : * mut sys :: godot_method_bind , pub set_custom_data_format : * mut sys :: godot_method_bind , pub set_instance_color : * mut sys :: godot_method_bind , pub set_instance_count : * mut sys :: godot_method_bind , pub set_instance_custom_data : * mut sys :: godot_method_bind , pub set_instance_transform : * mut sys :: godot_method_bind , pub set_instance_transform_2d : * mut sys :: godot_method_bind , pub set_mesh : * mut sys :: godot_method_bind , pub set_transform_format : * mut sys :: godot_method_bind , pub set_visible_instance_count : * mut sys :: godot_method_bind } impl MultiMeshMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : MultiMeshMethodTable = MultiMeshMethodTable { class_constructor : None , get_aabb : 0 as * mut sys :: godot_method_bind , get_color_format : 0 as * mut sys :: godot_method_bind , get_custom_data_format : 0 as * mut sys :: godot_method_bind , get_instance_color : 0 as * mut sys :: godot_method_bind , get_instance_count : 0 as * mut sys :: godot_method_bind , get_instance_custom_data : 0 as * mut sys :: godot_method_bind , get_instance_transform : 0 as * mut sys :: godot_method_bind , get_instance_transform_2d : 0 as * mut sys :: godot_method_bind , get_mesh : 0 as * mut sys :: godot_method_bind , get_transform_format : 0 as * mut sys :: godot_method_bind , get_visible_instance_count : 0 as * mut sys :: godot_method_bind , set_as_bulk_array : 0 as * mut sys :: godot_method_bind , set_color_format : 0 as * mut sys :: godot_method_bind , set_custom_data_format : 0 as * mut sys :: godot_method_bind , set_instance_color : 0 as * mut sys :: godot_method_bind , set_instance_count : 0 as * mut sys :: godot_method_bind , set_instance_custom_data : 0 as * mut sys :: godot_method_bind , set_instance_transform : 0 as * mut sys :: godot_method_bind , set_instance_transform_2d : 0 as * mut sys :: godot_method_bind , set_mesh : 0 as * mut sys :: godot_method_bind , set_transform_format : 0 as * mut sys :: godot_method_bind , set_visible_instance_count : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { MultiMeshMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "MultiMesh\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_aabb = (gd_api . godot_method_bind_get_method) (class_name , "get_aabb\0" . as_ptr () as * const c_char) ; table . get_color_format = (gd_api . godot_method_bind_get_method) (class_name , "get_color_format\0" . as_ptr () as * const c_char) ; table . get_custom_data_format = (gd_api . godot_method_bind_get_method) (class_name , "get_custom_data_format\0" . as_ptr () as * const c_char) ; table . get_instance_color = (gd_api . godot_method_bind_get_method) (class_name , "get_instance_color\0" . as_ptr () as * const c_char) ; table . get_instance_count = (gd_api . godot_method_bind_get_method) (class_name , "get_instance_count\0" . as_ptr () as * const c_char) ; table . get_instance_custom_data = (gd_api . godot_method_bind_get_method) (class_name , "get_instance_custom_data\0" . as_ptr () as * const c_char) ; table . get_instance_transform = (gd_api . godot_method_bind_get_method) (class_name , "get_instance_transform\0" . as_ptr () as * const c_char) ; table . get_instance_transform_2d = (gd_api . godot_method_bind_get_method) (class_name , "get_instance_transform_2d\0" . as_ptr () as * const c_char) ; table . get_mesh = (gd_api . godot_method_bind_get_method) (class_name , "get_mesh\0" . as_ptr () as * const c_char) ; table . get_transform_format = (gd_api . godot_method_bind_get_method) (class_name , "get_transform_format\0" . as_ptr () as * const c_char) ; table . get_visible_instance_count = (gd_api . godot_method_bind_get_method) (class_name , "get_visible_instance_count\0" . as_ptr () as * const c_char) ; table . set_as_bulk_array = (gd_api . godot_method_bind_get_method) (class_name , "set_as_bulk_array\0" . as_ptr () as * const c_char) ; table . set_color_format = (gd_api . godot_method_bind_get_method) (class_name , "set_color_format\0" . as_ptr () as * const c_char) ; table . set_custom_data_format = (gd_api . godot_method_bind_get_method) (class_name , "set_custom_data_format\0" . as_ptr () as * const c_char) ; table . set_instance_color = (gd_api . godot_method_bind_get_method) (class_name , "set_instance_color\0" . as_ptr () as * const c_char) ; table . set_instance_count = (gd_api . godot_method_bind_get_method) (class_name , "set_instance_count\0" . as_ptr () as * const c_char) ; table . set_instance_custom_data = (gd_api . godot_method_bind_get_method) (class_name , "set_instance_custom_data\0" . as_ptr () as * const c_char) ; table . set_instance_transform = (gd_api . godot_method_bind_get_method) (class_name , "set_instance_transform\0" . as_ptr () as * const c_char) ; table . set_instance_transform_2d = (gd_api . godot_method_bind_get_method) (class_name , "set_instance_transform_2d\0" . as_ptr () as * const c_char) ; table . set_mesh = (gd_api . godot_method_bind_get_method) (class_name , "set_mesh\0" . as_ptr () as * const c_char) ; table . set_transform_format = (gd_api . godot_method_bind_get_method) (class_name , "set_transform_format\0" . as_ptr () as * const c_char) ; table . set_visible_instance_count = (gd_api . godot_method_bind_get_method) (class_name , "set_visible_instance_count\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:274:3905 [INFO] [stdout] | [INFO] [stdout] 274 | ...thodTable { class_constructor : None , } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 274 | # [doc = "`core class AudioEffectLowShelfFilter` inherits `AudioEffectFilter` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_audioeffectlowshelffilter.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nAudioEffectLowShelfFilter inherits methods from:\n - [AudioEffectFilter](struct.AudioEffectFilter.html)\n - [AudioEffect](struct.AudioEffect.html)\n - [Resource](struct.Resource.html)\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct AudioEffectLowShelfFilter { this : RawObject < Self > , } impl AudioEffectLowShelfFilter { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AudioEffectLowShelfFilterMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } } impl gdnative_core :: private :: godot_object :: Sealed for AudioEffectLowShelfFilter { } unsafe impl GodotObject for AudioEffectLowShelfFilter { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AudioEffectLowShelfFilter" } } impl std :: ops :: Deref for AudioEffectLowShelfFilter { type Target = crate :: generated :: audio_effect_filter :: AudioEffectFilter ; # [inline] fn deref (& self) -> & crate :: generated :: audio_effect_filter :: AudioEffectFilter { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AudioEffectLowShelfFilter { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: audio_effect_filter :: AudioEffectFilter { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: audio_effect_filter :: AudioEffectFilter > for AudioEffectLowShelfFilter { } unsafe impl SubClass < crate :: generated :: audio_effect :: AudioEffect > for AudioEffectLowShelfFilter { } unsafe impl SubClass < crate :: generated :: resource :: Resource > for AudioEffectLowShelfFilter { } unsafe impl SubClass < crate :: generated :: reference :: Reference > for AudioEffectLowShelfFilter { } unsafe impl SubClass < crate :: generated :: object :: Object > for AudioEffectLowShelfFilter { } impl Instanciable for AudioEffectLowShelfFilter { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { AudioEffectLowShelfFilter :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AudioEffectLowShelfFilterMethodTable { pub class_constructor : sys :: godot_class_constructor , } impl AudioEffectLowShelfFilterMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AudioEffectLowShelfFilterMethodTable = AudioEffectLowShelfFilterMethodTable { class_constructor : None , } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { AudioEffectLowShelfFilterMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AudioEffectLowShelfFilter\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:280:7833 [INFO] [stdout] | [INFO] [stdout] 280 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 280 | # [doc = "`core class VisualShaderNodeScalarFunc` inherits `VisualShaderNode` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_visualshadernodescalarfunc.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nVisualShaderNodeScalarFunc inherits methods from:\n - [VisualShaderNode](struct.VisualShaderNode.html)\n - [Resource](struct.Resource.html)\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct VisualShaderNodeScalarFunc { this : RawObject < Self > , } # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct Function (pub i64) ; impl Function { pub const SIN : Function = Function (0i64) ; pub const COS : Function = Function (1i64) ; pub const TAN : Function = Function (2i64) ; pub const ASIN : Function = Function (3i64) ; pub const ACOS : Function = Function (4i64) ; pub const ATAN : Function = Function (5i64) ; pub const SINH : Function = Function (6i64) ; pub const COSH : Function = Function (7i64) ; pub const TANH : Function = Function (8i64) ; pub const LOG : Function = Function (9i64) ; pub const EXP : Function = Function (10i64) ; pub const SQRT : Function = Function (11i64) ; pub const ABS : Function = Function (12i64) ; pub const SIGN : Function = Function (13i64) ; pub const FLOOR : Function = Function (14i64) ; pub const ROUND : Function = Function (15i64) ; pub const CEIL : Function = Function (16i64) ; pub const FRAC : Function = Function (17i64) ; pub const SATURATE : Function = Function (18i64) ; pub const NEGATE : Function = Function (19i64) ; pub const ACOSH : Function = Function (20i64) ; pub const ASINH : Function = Function (21i64) ; pub const ATANH : Function = Function (22i64) ; pub const DEGREES : Function = Function (23i64) ; pub const EXP2 : Function = Function (24i64) ; pub const INVERSE_SQRT : Function = Function (25i64) ; pub const LOG2 : Function = Function (26i64) ; pub const RADIANS : Function = Function (27i64) ; pub const RECIPROCAL : Function = Function (28i64) ; pub const ROUNDEVEN : Function = Function (29i64) ; pub const TRUNC : Function = Function (30i64) ; pub const ONEMINUS : Function = Function (31i64) ; } impl From < i64 > for Function { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < Function > for i64 { # [inline] fn from (v : Function) -> Self { v . 0 } } # [doc = "Constants"] # [allow (non_upper_case_globals)] impl VisualShaderNodeScalarFunc { pub const FUNC_ABS : i64 = 12i64 ; pub const FUNC_ACOS : i64 = 4i64 ; pub const FUNC_ACOSH : i64 = 20i64 ; pub const FUNC_ASIN : i64 = 3i64 ; pub const FUNC_ASINH : i64 = 21i64 ; pub const FUNC_ATAN : i64 = 5i64 ; pub const FUNC_ATANH : i64 = 22i64 ; pub const FUNC_CEIL : i64 = 16i64 ; pub const FUNC_COS : i64 = 1i64 ; pub const FUNC_COSH : i64 = 7i64 ; pub const FUNC_DEGREES : i64 = 23i64 ; pub const FUNC_EXP : i64 = 10i64 ; pub const FUNC_EXP2 : i64 = 24i64 ; pub const FUNC_FLOOR : i64 = 14i64 ; pub const FUNC_FRAC : i64 = 17i64 ; pub const FUNC_INVERSE_SQRT : i64 = 25i64 ; pub const FUNC_LOG : i64 = 9i64 ; pub const FUNC_LOG2 : i64 = 26i64 ; pub const FUNC_NEGATE : i64 = 19i64 ; pub const FUNC_ONEMINUS : i64 = 31i64 ; pub const FUNC_RADIANS : i64 = 27i64 ; pub const FUNC_RECIPROCAL : i64 = 28i64 ; pub const FUNC_ROUND : i64 = 15i64 ; pub const FUNC_ROUNDEVEN : i64 = 29i64 ; pub const FUNC_SATURATE : i64 = 18i64 ; pub const FUNC_SIGN : i64 = 13i64 ; pub const FUNC_SIN : i64 = 0i64 ; pub const FUNC_SINH : i64 = 6i64 ; pub const FUNC_SQRT : i64 = 11i64 ; pub const FUNC_TAN : i64 = 2i64 ; pub const FUNC_TANH : i64 = 8i64 ; pub const FUNC_TRUNC : i64 = 30i64 ; } impl VisualShaderNodeScalarFunc { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = VisualShaderNodeScalarFuncMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = ""] # [doc = ""] # [inline] pub fn function (& self) -> crate :: generated :: visual_shader_node_scalar_func :: Function { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualShaderNodeScalarFuncMethodTable :: get (get_api ()) . get_function ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; crate :: generated :: visual_shader_node_scalar_func :: Function (ret) } } # [doc = ""] # [doc = ""] # [inline] pub fn set_function (& self , func : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualShaderNodeScalarFuncMethodTable :: get (get_api ()) . set_function ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , func) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for VisualShaderNodeScalarFunc { } unsafe impl GodotObject for VisualShaderNodeScalarFunc { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "VisualShaderNodeScalarFunc" } } impl std :: ops :: Deref for VisualShaderNodeScalarFunc { type Target = crate :: generated :: visual_shader_node :: VisualShaderNode ; # [inline] fn deref (& self) -> & crate :: generated :: visual_shader_node :: VisualShaderNode { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for VisualShaderNodeScalarFunc { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: visual_shader_node :: VisualShaderNode { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: visual_shader_node :: VisualShaderNode > for VisualShaderNodeScalarFunc { } unsafe impl SubClass < crate :: generated :: resource :: Resource > for VisualShaderNodeScalarFunc { } unsafe impl SubClass < crate :: generated :: reference :: Reference > for VisualShaderNodeScalarFunc { } unsafe impl SubClass < crate :: generated :: object :: Object > for VisualShaderNodeScalarFunc { } impl Instanciable for VisualShaderNodeScalarFunc { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { VisualShaderNodeScalarFunc :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct VisualShaderNodeScalarFuncMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_function : * mut sys :: godot_method_bind , pub set_function : * mut sys :: godot_method_bind } impl VisualShaderNodeScalarFuncMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : VisualShaderNodeScalarFuncMethodTable = VisualShaderNodeScalarFuncMethodTable { class_constructor : None , get_function : 0 as * mut sys :: godot_method_bind , set_function : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { VisualShaderNodeScalarFuncMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "VisualShaderNodeScalarFunc\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_function = (gd_api . godot_method_bind_get_method) (class_name , "get_function\0" . as_ptr () as * const c_char) ; table . set_function = (gd_api . godot_method_bind_get_method) (class_name , "set_function\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:286:15877 [INFO] [stdout] | [INFO] [stdout] 286 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 286 | # [doc = "`core singleton class ClassDB` inherits `Object` (unsafe)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_classdb.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = ""] # [doc = "\n## Class hierarchy\n\nClassDB inherits methods from:\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct ClassDB { this : RawObject < Self > , } impl ClassDB { # [doc = "Returns a reference to the singleton instance."] # [inline] pub fn godot_singleton () -> & 'static Self { unsafe { let this = (get_api () . godot_global_get_singleton) ("ClassDB\0" . as_ptr () as * mut _) ; let this = ptr :: NonNull :: new (this) . expect ("singleton should not be null") ; let this = RawObject :: from_sys_ref_unchecked :: < 'static > (this) ; Self :: cast_ref (this) } } # [doc = "Returns `true` if you can instance objects from the specified `class`, `false` in other case."] # [doc = ""] # [inline] pub fn can_instance (& self , class : impl Into < GodotString >) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = ClassDBMethodTable :: get (get_api ()) . can_instance ; let ret = crate :: icalls :: icallptr_bool_str (method_bind , self . this . sys () . as_ptr () , class . into ()) ; ret as _ } } # [doc = "Returns whether the specified `class` is available or not."] # [doc = ""] # [inline] pub fn class_exists (& self , class : impl Into < GodotString >) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = ClassDBMethodTable :: get (get_api ()) . class_exists ; let ret = crate :: icalls :: icallptr_bool_str (method_bind , self . this . sys () . as_ptr () , class . into ()) ; ret as _ } } # [doc = "Returns a category associated with the class for use in documentation and the Asset Library. Debug mode required."] # [doc = ""] # [inline] pub fn class_get_category (& self , class : impl Into < GodotString >) -> GodotString { unsafe { let method_bind : * mut sys :: godot_method_bind = ClassDBMethodTable :: get (get_api ()) . class_get_category ; let ret = crate :: icalls :: icallptr_str_str (method_bind , self . this . sys () . as_ptr () , class . into ()) ; GodotString :: from_sys (ret) } } # [doc = "Returns the value of the integer constant `name` of `class` or its ancestry. Always returns 0 when the constant could not be found."] # [doc = ""] # [inline] pub fn class_get_integer_constant (& self , class : impl Into < GodotString > , name : impl Into < GodotString >) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = ClassDBMethodTable :: get (get_api ()) . class_get_integer_constant ; let ret = crate :: icalls :: icallptr_i64_str_str (method_bind , self . this . sys () . as_ptr () , class . into () , name . into ()) ; ret as _ } } # [doc = "Returns an array with the names all the integer constants of `class` or its ancestry.\n# Default Arguments\n* `no_inheritance` - `false`"] # [doc = ""] # [inline] pub fn class_get_integer_constant_list (& self , class : impl Into < GodotString > , no_inheritance : bool) -> StringArray { unsafe { let method_bind : * mut sys :: godot_method_bind = ClassDBMethodTable :: get (get_api ()) . class_get_integer_constant_list ; let ret = crate :: icalls :: icallptr_strarr_str_bool (method_bind , self . this . sys () . as_ptr () , class . into () , no_inheritance) ; StringArray :: from_sys (ret) } } # [doc = "Returns an array with all the methods of `class` or its ancestry if `no_inheritance` is `false`. Every element of the array is a [Dictionary] with the following keys: `args`, `default_args`, `flags`, `id`, `name`, `return: (class_name, hint, hint_string, name, type, usage)`.\n# Default Arguments\n* `no_inheritance` - `false`"] # [doc = ""] # [inline] pub fn class_get_method_list (& self , class : impl Into < GodotString > , no_inheritance : bool) -> VariantArray { unsafe { let method_bind : * mut sys :: godot_method_bind = ClassDBMethodTable :: get (get_api ()) . class_get_method_list ; let ret = crate :: icalls :: icallvar__str_bool (method_bind , self . this . sys () . as_ptr () , class . into () , no_inheritance) ; < VariantArray > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns the value of `property` of `class` or its ancestry."] # [doc = ""] # [inline] pub fn class_get_property (& self , object : impl AsArg < crate :: generated :: object :: Object > , property : impl Into < GodotString >) -> Variant { unsafe { let method_bind : * mut sys :: godot_method_bind = ClassDBMethodTable :: get (get_api ()) . class_get_property ; let ret = crate :: icalls :: icallptr_var_obj_str (method_bind , self . this . sys () . as_ptr () , object . as_arg_ptr () , property . into ()) ; Variant :: from_sys (ret) } } # [doc = "Returns an array with all the properties of `class` or its ancestry if `no_inheritance` is `false`.\n# Default Arguments\n* `no_inheritance` - `false`"] # [doc = ""] # [inline] pub fn class_get_property_list (& self , class : impl Into < GodotString > , no_inheritance : bool) -> VariantArray { unsafe { let method_bind : * mut sys :: godot_method_bind = ClassDBMethodTable :: get (get_api ()) . class_get_property_list ; let ret = crate :: icalls :: icallvar__str_bool (method_bind , self . this . sys () . as_ptr () , class . into () , no_inheritance) ; < VariantArray > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns the `signal` data of `class` or its ancestry. The returned value is a [Dictionary] with the following keys: `args`, `default_args`, `flags`, `id`, `name`, `return: (class_name, hint, hint_string, name, type, usage)`."] # [doc = ""] # [inline] pub fn class_get_signal (& self , class : impl Into < GodotString > , signal : impl Into < GodotString >) -> Dictionary { unsafe { let method_bind : * mut sys :: godot_method_bind = ClassDBMethodTable :: get (get_api ()) . class_get_signal ; let ret = crate :: icalls :: icallptr_dict_str_str (method_bind , self . this . sys () . as_ptr () , class . into () , signal . into ()) ; Dictionary :: from_sys (ret) } } # [doc = "Returns an array with all the signals of `class` or its ancestry if `no_inheritance` is `false`. Every element of the array is a [Dictionary] as described in [method class_get_signal].\n# Default Arguments\n* `no_inheritance` - `false`"] # [doc = ""] # [inline] pub fn class_get_signal_list (& self , class : impl Into < GodotString > , no_inheritance : bool) -> VariantArray { unsafe { let method_bind : * mut sys :: godot_method_bind = ClassDBMethodTable :: get (get_api ()) . class_get_signal_list ; let ret = crate :: icalls :: icallvar__str_bool (method_bind , self . this . sys () . as_ptr () , class . into () , no_inheritance) ; < VariantArray > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns whether `class` or its ancestry has an integer constant called `name` or not."] # [doc = ""] # [inline] pub fn class_has_integer_constant (& self , class : impl Into < GodotString > , name : impl Into < GodotString >) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = ClassDBMethodTable :: get (get_api ()) . class_has_integer_constant ; let ret = crate :: icalls :: icallptr_bool_str_str (method_bind , self . this . sys () . as_ptr () , class . into () , name . into ()) ; ret as _ } } # [doc = "Returns whether `class` (or its ancestry if `no_inheritance` is `false`) has a method called `method` or not.\n# Default Arguments\n* `no_inheritance` - `false`"] # [doc = ""] # [inline] pub fn class_has_method (& self , class : impl Into < GodotString > , method : impl Into < GodotString > , no_inheritance : bool) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = ClassDBMethodTable :: get (get_api ()) . class_has_method ; let ret = crate :: icalls :: icallptr_bool_str_str_bool (method_bind , self . this . sys () . as_ptr () , class . into () , method . into () , no_inheritance) ; ret as _ } } # [doc = "Returns whether `class` or its ancestry has a signal called `signal` or not."] # [doc = ""] # [inline] pub fn class_has_signal (& self , class : impl Into < GodotString > , signal : impl Into < GodotString >) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = ClassDBMethodTable :: get (get_api ()) . class_has_signal ; let ret = crate :: icalls :: icallptr_bool_str_str (method_bind , self . this . sys () . as_ptr () , class . into () , signal . into ()) ; ret as _ } } # [doc = "Sets `property` value of `class` to `value`."] # [doc = ""] # [inline] pub fn class_set_property (& self , object : impl AsArg < crate :: generated :: object :: Object > , property : impl Into < GodotString > , value : impl OwnedToVariant) -> GodotResult { unsafe { let method_bind : * mut sys :: godot_method_bind = ClassDBMethodTable :: get (get_api ()) . class_set_property ; let ret = crate :: icalls :: icallptr_i64_obj_str_var (method_bind , self . this . sys () . as_ptr () , object . as_arg_ptr () , property . into () , value . owned_to_variant ()) ; GodotError :: result_from_sys (ret as _) } } # [doc = "Returns the names of all the classes available."] # [doc = ""] # [inline] pub fn get_class_list (& self) -> StringArray { unsafe { let method_bind : * mut sys :: godot_method_bind = ClassDBMethodTable :: get (get_api ()) . get_class_list ; let ret = crate :: icalls :: icallptr_strarr (method_bind , self . this . sys () . as_ptr ()) ; StringArray :: from_sys (ret) } } # [doc = "Returns the names of all the classes that directly or indirectly inherit from `class`."] # [doc = ""] # [inline] pub fn get_inheriters_from_class (& self , class : impl Into < GodotString >) -> StringArray { unsafe { let method_bind : * mut sys :: godot_method_bind = ClassDBMethodTable :: get (get_api ()) . get_inheriters_from_class ; let ret = crate :: icalls :: icallptr_strarr_str (method_bind , self . this . sys () . as_ptr () , class . into ()) ; StringArray :: from_sys (ret) } } # [doc = "Returns the parent class of `class`."] # [doc = ""] # [inline] pub fn get_parent_class (& self , class : impl Into < GodotString >) -> GodotString { unsafe { let method_bind : * mut sys :: godot_method_bind = ClassDBMethodTable :: get (get_api ()) . get_parent_class ; let ret = crate :: icalls :: icallptr_str_str (method_bind , self . this . sys () . as_ptr () , class . into ()) ; GodotString :: from_sys (ret) } } # [doc = "Creates an instance of `class`."] # [doc = ""] # [inline] pub fn instance (& self , class : impl Into < GodotString >) -> Variant { unsafe { let method_bind : * mut sys :: godot_method_bind = ClassDBMethodTable :: get (get_api ()) . instance ; let ret = crate :: icalls :: icallptr_var_str (method_bind , self . this . sys () . as_ptr () , class . into ()) ; Variant :: from_sys (ret) } } # [doc = "Returns whether this `class` is enabled or not."] # [doc = ""] # [inline] pub fn is_class_enabled (& self , class : impl Into < GodotString >) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = ClassDBMethodTable :: get (get_api ()) . is_class_enabled ; let ret = crate :: icalls :: icallptr_bool_str (method_bind , self . this . sys () . as_ptr () , class . into ()) ; ret as _ } } # [doc = "Returns whether `inherits` is an ancestor of `class` or not."] # [doc = ""] # [inline] pub fn is_parent_class (& self , class : impl Into < GodotString > , inherits : impl Into < GodotString >) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = ClassDBMethodTable :: get (get_api ()) . is_parent_class ; let ret = crate :: icalls :: icallptr_bool_str_str (method_bind , self . this . sys () . as_ptr () , class . into () , inherits . into ()) ; ret as _ } } } impl gdnative_core :: private :: godot_object :: Sealed for ClassDB { } unsafe impl GodotObject for ClassDB { type RefKind = ref_kind :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "ClassDB" } } impl std :: ops :: Deref for ClassDB { type Target = crate :: generated :: object :: Object ; # [inline] fn deref (& self) -> & crate :: generated :: object :: Object { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for ClassDB { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: object :: Object { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: object :: Object > for ClassDB { } unsafe impl Send for ClassDB { } unsafe impl Sync for ClassDB { } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct ClassDBMethodTable { pub class_constructor : sys :: godot_class_constructor , pub can_instance : * mut sys :: godot_method_bind , pub class_exists : * mut sys :: godot_method_bind , pub class_get_category : * mut sys :: godot_method_bind , pub class_get_integer_constant : * mut sys :: godot_method_bind , pub class_get_integer_constant_list : * mut sys :: godot_method_bind , pub class_get_method_list : * mut sys :: godot_method_bind , pub class_get_property : * mut sys :: godot_method_bind , pub class_get_property_list : * mut sys :: godot_method_bind , pub class_get_signal : * mut sys :: godot_method_bind , pub class_get_signal_list : * mut sys :: godot_method_bind , pub class_has_integer_constant : * mut sys :: godot_method_bind , pub class_has_method : * mut sys :: godot_method_bind , pub class_has_signal : * mut sys :: godot_method_bind , pub class_set_property : * mut sys :: godot_method_bind , pub get_class_list : * mut sys :: godot_method_bind , pub get_inheriters_from_class : * mut sys :: godot_method_bind , pub get_parent_class : * mut sys :: godot_method_bind , pub instance : * mut sys :: godot_method_bind , pub is_class_enabled : * mut sys :: godot_method_bind , pub is_parent_class : * mut sys :: godot_method_bind } impl ClassDBMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : ClassDBMethodTable = ClassDBMethodTable { class_constructor : None , can_instance : 0 as * mut sys :: godot_method_bind , class_exists : 0 as * mut sys :: godot_method_bind , class_get_category : 0 as * mut sys :: godot_method_bind , class_get_integer_constant : 0 as * mut sys :: godot_method_bind , class_get_integer_constant_list : 0 as * mut sys :: godot_method_bind , class_get_method_list : 0 as * mut sys :: godot_method_bind , class_get_property : 0 as * mut sys :: godot_method_bind , class_get_property_list : 0 as * mut sys :: godot_method_bind , class_get_signal : 0 as * mut sys :: godot_method_bind , class_get_signal_list : 0 as * mut sys :: godot_method_bind , class_has_integer_constant : 0 as * mut sys :: godot_method_bind , class_has_method : 0 as * mut sys :: godot_method_bind , class_has_signal : 0 as * mut sys :: godot_method_bind , class_set_property : 0 as * mut sys :: godot_method_bind , get_class_list : 0 as * mut sys :: godot_method_bind , get_inheriters_from_class : 0 as * mut sys :: godot_method_bind , get_parent_class : 0 as * mut sys :: godot_method_bind , instance : 0 as * mut sys :: godot_method_bind , is_class_enabled : 0 as * mut sys :: godot_method_bind , is_parent_class : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { ClassDBMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "_ClassDB\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . can_instance = (gd_api . godot_method_bind_get_method) (class_name , "can_instance\0" . as_ptr () as * const c_char) ; table . class_exists = (gd_api . godot_method_bind_get_method) (class_name , "class_exists\0" . as_ptr () as * const c_char) ; table . class_get_category = (gd_api . godot_method_bind_get_method) (class_name , "class_get_category\0" . as_ptr () as * const c_char) ; table . class_get_integer_constant = (gd_api . godot_method_bind_get_method) (class_name , "class_get_integer_constant\0" . as_ptr () as * const c_char) ; table . class_get_integer_constant_list = (gd_api . godot_method_bind_get_method) (class_name , "class_get_integer_constant_list\0" . as_ptr () as * const c_char) ; table . class_get_method_list = (gd_api . godot_method_bind_get_method) (class_name , "class_get_method_list\0" . as_ptr () as * const c_char) ; table . class_get_property = (gd_api . godot_method_bind_get_method) (class_name , "class_get_property\0" . as_ptr () as * const c_char) ; table . class_get_property_list = (gd_api . godot_method_bind_get_method) (class_name , "class_get_property_list\0" . as_ptr () as * const c_char) ; table . class_get_signal = (gd_api . godot_method_bind_get_method) (class_name , "class_get_signal\0" . as_ptr () as * const c_char) ; table . class_get_signal_list = (gd_api . godot_method_bind_get_method) (class_name , "class_get_signal_list\0" . as_ptr () as * const c_char) ; table . class_has_integer_constant = (gd_api . godot_method_bind_get_method) (class_name , "class_has_integer_constant\0" . as_ptr () as * const c_char) ; table . class_has_method = (gd_api . godot_method_bind_get_method) (class_name , "class_has_method\0" . as_ptr () as * const c_char) ; table . class_has_signal = (gd_api . godot_method_bind_get_method) (class_name , "class_has_signal\0" . as_ptr () as * const c_char) ; table . class_set_property = (gd_api . godot_method_bind_get_method) (class_name , "class_set_property\0" . as_ptr () as * const c_char) ; table . get_class_list = (gd_api . godot_method_bind_get_method) (class_name , "get_class_list\0" . as_ptr () as * const c_char) ; table . get_inheriters_from_class = (gd_api . godot_method_bind_get_method) (class_name , "get_inheriters_from_class\0" . as_ptr () as * const c_char) ; table . get_parent_class = (gd_api . godot_method_bind_get_method) (class_name , "get_parent_class\0" . as_ptr () as * const c_char) ; table . instance = (gd_api . godot_method_bind_get_method) (class_name , "instance\0" . as_ptr () as * const c_char) ; table . is_class_enabled = (gd_api . godot_method_bind_get_method) (class_name , "is_class_enabled\0" . as_ptr () as * const c_char) ; table . is_parent_class = (gd_api . godot_method_bind_get_method) (class_name , "is_parent_class\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:292:6362 [INFO] [stdout] | [INFO] [stdout] 292 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 292 | # [doc = "`core class FuncRef` inherits `Reference` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_funcref.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nFuncRef inherits methods from:\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct FuncRef { this : RawObject < Self > , } impl FuncRef { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = FuncRefMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "Calls the referenced function previously set by [method set_function] or [method @GDScript.funcref]."] # [doc = ""] # [inline] pub fn call_func (& self , varargs : & [Variant]) -> Variant { unsafe { let method_bind : * mut sys :: godot_method_bind = FuncRefMethodTable :: get (get_api ()) . call_func ; let ret = crate :: icalls :: icallvarargs_ (method_bind , self . this . sys () . as_ptr () , varargs) ; ret } } # [doc = "Calls the referenced function previously set by [method set_function] or [method @GDScript.funcref]. Contrarily to [method call_func], this method does not support a variable number of arguments but expects all parameters to be passed via a single [Array]."] # [doc = ""] # [inline] pub fn call_funcv (& self , arg_array : VariantArray) -> Variant { unsafe { let method_bind : * mut sys :: godot_method_bind = FuncRefMethodTable :: get (get_api ()) . call_funcv ; let ret = crate :: icalls :: icallptr_var_arr (method_bind , self . this . sys () . as_ptr () , arg_array) ; Variant :: from_sys (ret) } } # [doc = ""] # [doc = ""] # [inline] pub fn function (& self) -> GodotString { unsafe { let method_bind : * mut sys :: godot_method_bind = FuncRefMethodTable :: get (get_api ()) . get_function ; let ret = crate :: icalls :: icallptr_str (method_bind , self . this . sys () . as_ptr ()) ; GodotString :: from_sys (ret) } } # [doc = "Returns whether the object still exists and has the function assigned."] # [doc = ""] # [inline] pub fn is_valid (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = FuncRefMethodTable :: get (get_api ()) . is_valid ; let ret = crate :: icalls :: icallptr_bool (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "The name of the referenced function to call on the object, without parentheses or any parameters."] # [doc = ""] # [inline] pub fn set_function (& self , name : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = FuncRefMethodTable :: get (get_api ()) . set_function ; let ret = crate :: icalls :: icallptr_void_str (method_bind , self . this . sys () . as_ptr () , name . into ()) ; } } # [doc = "The object containing the referenced function. This object must be of a type actually inheriting from [Object], not a built-in type such as [int], [Vector2] or [Dictionary]."] # [doc = ""] # [inline] pub fn set_instance (& self , instance : impl AsArg < crate :: generated :: object :: Object >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = FuncRefMethodTable :: get (get_api ()) . set_instance ; let ret = crate :: icalls :: icallptr_void_obj (method_bind , self . this . sys () . as_ptr () , instance . as_arg_ptr ()) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for FuncRef { } unsafe impl GodotObject for FuncRef { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "FuncRef" } } impl std :: ops :: Deref for FuncRef { type Target = crate :: generated :: reference :: Reference ; # [inline] fn deref (& self) -> & crate :: generated :: reference :: Reference { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for FuncRef { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: reference :: Reference { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: reference :: Reference > for FuncRef { } unsafe impl SubClass < crate :: generated :: object :: Object > for FuncRef { } impl Instanciable for FuncRef { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { FuncRef :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct FuncRefMethodTable { pub class_constructor : sys :: godot_class_constructor , pub call_func : * mut sys :: godot_method_bind , pub call_funcv : * mut sys :: godot_method_bind , pub get_function : * mut sys :: godot_method_bind , pub is_valid : * mut sys :: godot_method_bind , pub set_function : * mut sys :: godot_method_bind , pub set_instance : * mut sys :: godot_method_bind } impl FuncRefMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : FuncRefMethodTable = FuncRefMethodTable { class_constructor : None , call_func : 0 as * mut sys :: godot_method_bind , call_funcv : 0 as * mut sys :: godot_method_bind , get_function : 0 as * mut sys :: godot_method_bind , is_valid : 0 as * mut sys :: godot_method_bind , set_function : 0 as * mut sys :: godot_method_bind , set_instance : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { FuncRefMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "FuncRef\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . call_func = (gd_api . godot_method_bind_get_method) (class_name , "call_func\0" . as_ptr () as * const c_char) ; table . call_funcv = (gd_api . godot_method_bind_get_method) (class_name , "call_funcv\0" . as_ptr () as * const c_char) ; table . get_function = (gd_api . godot_method_bind_get_method) (class_name , "get_function\0" . as_ptr () as * const c_char) ; table . is_valid = (gd_api . godot_method_bind_get_method) (class_name , "is_valid\0" . as_ptr () as * const c_char) ; table . set_function = (gd_api . godot_method_bind_get_method) (class_name , "set_function\0" . as_ptr () as * const c_char) ; table . set_instance = (gd_api . godot_method_bind_get_method) (class_name , "set_instance\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:298:9262 [INFO] [stdout] | [INFO] [stdout] 298 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 298 | # [doc = "`core class VisualShaderNodeCompare` inherits `VisualShaderNode` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_visualshadernodecompare.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nVisualShaderNodeCompare inherits methods from:\n - [VisualShaderNode](struct.VisualShaderNode.html)\n - [Resource](struct.Resource.html)\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct VisualShaderNodeCompare { this : RawObject < Self > , } # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct ComparisonType (pub i64) ; impl ComparisonType { pub const SCALAR : ComparisonType = ComparisonType (0i64) ; pub const VECTOR : ComparisonType = ComparisonType (1i64) ; pub const BOOLEAN : ComparisonType = ComparisonType (2i64) ; pub const TRANSFORM : ComparisonType = ComparisonType (3i64) ; } impl From < i64 > for ComparisonType { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < ComparisonType > for i64 { # [inline] fn from (v : ComparisonType) -> Self { v . 0 } } # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct Condition (pub i64) ; impl Condition { pub const ALL : Condition = Condition (0i64) ; pub const ANY : Condition = Condition (1i64) ; } impl From < i64 > for Condition { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < Condition > for i64 { # [inline] fn from (v : Condition) -> Self { v . 0 } } # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct Function (pub i64) ; impl Function { pub const EQUAL : Function = Function (0i64) ; pub const NOT_EQUAL : Function = Function (1i64) ; pub const GREATER_THAN : Function = Function (2i64) ; pub const GREATER_THAN_EQUAL : Function = Function (3i64) ; pub const LESS_THAN : Function = Function (4i64) ; pub const LESS_THAN_EQUAL : Function = Function (5i64) ; } impl From < i64 > for Function { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < Function > for i64 { # [inline] fn from (v : Function) -> Self { v . 0 } } # [doc = "Constants"] # [allow (non_upper_case_globals)] impl VisualShaderNodeCompare { pub const COND_ALL : i64 = 0i64 ; pub const COND_ANY : i64 = 1i64 ; pub const CTYPE_BOOLEAN : i64 = 2i64 ; pub const CTYPE_SCALAR : i64 = 0i64 ; pub const CTYPE_TRANSFORM : i64 = 3i64 ; pub const CTYPE_VECTOR : i64 = 1i64 ; pub const FUNC_EQUAL : i64 = 0i64 ; pub const FUNC_GREATER_THAN : i64 = 2i64 ; pub const FUNC_GREATER_THAN_EQUAL : i64 = 3i64 ; pub const FUNC_LESS_THAN : i64 = 4i64 ; pub const FUNC_LESS_THAN_EQUAL : i64 = 5i64 ; pub const FUNC_NOT_EQUAL : i64 = 1i64 ; } impl VisualShaderNodeCompare { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = VisualShaderNodeCompareMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "The type to be used in the comparison. See [enum ComparisonType] for options."] # [doc = ""] # [inline] pub fn comparison_type (& self) -> crate :: generated :: visual_shader_node_compare :: ComparisonType { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualShaderNodeCompareMethodTable :: get (get_api ()) . get_comparison_type ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; crate :: generated :: visual_shader_node_compare :: ComparisonType (ret) } } # [doc = "Extra condition which is applied if [member type] is set to [constant CTYPE_VECTOR]."] # [doc = ""] # [inline] pub fn condition (& self) -> crate :: generated :: visual_shader_node_compare :: Condition { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualShaderNodeCompareMethodTable :: get (get_api ()) . get_condition ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; crate :: generated :: visual_shader_node_compare :: Condition (ret) } } # [doc = "A comparison function. See [enum Function] for options."] # [doc = ""] # [inline] pub fn function (& self) -> crate :: generated :: visual_shader_node_compare :: Function { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualShaderNodeCompareMethodTable :: get (get_api ()) . get_function ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; crate :: generated :: visual_shader_node_compare :: Function (ret) } } # [doc = "The type to be used in the comparison. See [enum ComparisonType] for options."] # [doc = ""] # [inline] pub fn set_comparison_type (& self , _type : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualShaderNodeCompareMethodTable :: get (get_api ()) . set_comparison_type ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , _type) ; } } # [doc = "Extra condition which is applied if [member type] is set to [constant CTYPE_VECTOR]."] # [doc = ""] # [inline] pub fn set_condition (& self , condition : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualShaderNodeCompareMethodTable :: get (get_api ()) . set_condition ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , condition) ; } } # [doc = "A comparison function. See [enum Function] for options."] # [doc = ""] # [inline] pub fn set_function (& self , func : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualShaderNodeCompareMethodTable :: get (get_api ()) . set_function ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , func) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for VisualShaderNodeCompare { } unsafe impl GodotObject for VisualShaderNodeCompare { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "VisualShaderNodeCompare" } } impl std :: ops :: Deref for VisualShaderNodeCompare { type Target = crate :: generated :: visual_shader_node :: VisualShaderNode ; # [inline] fn deref (& self) -> & crate :: generated :: visual_shader_node :: VisualShaderNode { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for VisualShaderNodeCompare { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: visual_shader_node :: VisualShaderNode { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: visual_shader_node :: VisualShaderNode > for VisualShaderNodeCompare { } unsafe impl SubClass < crate :: generated :: resource :: Resource > for VisualShaderNodeCompare { } unsafe impl SubClass < crate :: generated :: reference :: Reference > for VisualShaderNodeCompare { } unsafe impl SubClass < crate :: generated :: object :: Object > for VisualShaderNodeCompare { } impl Instanciable for VisualShaderNodeCompare { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { VisualShaderNodeCompare :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct VisualShaderNodeCompareMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_comparison_type : * mut sys :: godot_method_bind , pub get_condition : * mut sys :: godot_method_bind , pub get_function : * mut sys :: godot_method_bind , pub set_comparison_type : * mut sys :: godot_method_bind , pub set_condition : * mut sys :: godot_method_bind , pub set_function : * mut sys :: godot_method_bind } impl VisualShaderNodeCompareMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : VisualShaderNodeCompareMethodTable = VisualShaderNodeCompareMethodTable { class_constructor : None , get_comparison_type : 0 as * mut sys :: godot_method_bind , get_condition : 0 as * mut sys :: godot_method_bind , get_function : 0 as * mut sys :: godot_method_bind , set_comparison_type : 0 as * mut sys :: godot_method_bind , set_condition : 0 as * mut sys :: godot_method_bind , set_function : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { VisualShaderNodeCompareMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "VisualShaderNodeCompare\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_comparison_type = (gd_api . godot_method_bind_get_method) (class_name , "get_comparison_type\0" . as_ptr () as * const c_char) ; table . get_condition = (gd_api . godot_method_bind_get_method) (class_name , "get_condition\0" . as_ptr () as * const c_char) ; table . get_function = (gd_api . godot_method_bind_get_method) (class_name , "get_function\0" . as_ptr () as * const c_char) ; table . set_comparison_type = (gd_api . godot_method_bind_get_method) (class_name , "set_comparison_type\0" . as_ptr () as * const c_char) ; table . set_condition = (gd_api . godot_method_bind_get_method) (class_name , "set_condition\0" . as_ptr () as * const c_char) ; table . set_function = (gd_api . godot_method_bind_get_method) (class_name , "set_function\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:304:5457 [INFO] [stdout] | [INFO] [stdout] 304 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 304 | # [doc = "`core singleton class ResourceSaver` inherits `Object` (unsafe)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_resourcesaver.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = ""] # [doc = "\n## Class hierarchy\n\nResourceSaver inherits methods from:\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct ResourceSaver { this : RawObject < Self > , } # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct SaverFlags (pub i64) ; impl SaverFlags { pub const RELATIVE_PATHS : SaverFlags = SaverFlags (1i64) ; pub const BUNDLE_RESOURCES : SaverFlags = SaverFlags (2i64) ; pub const CHANGE_PATH : SaverFlags = SaverFlags (4i64) ; pub const OMIT_EDITOR_PROPERTIES : SaverFlags = SaverFlags (8i64) ; pub const SAVE_BIG_ENDIAN : SaverFlags = SaverFlags (16i64) ; pub const COMPRESS : SaverFlags = SaverFlags (32i64) ; pub const REPLACE_SUBRESOURCE_PATHS : SaverFlags = SaverFlags (64i64) ; } impl From < i64 > for SaverFlags { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < SaverFlags > for i64 { # [inline] fn from (v : SaverFlags) -> Self { v . 0 } } # [doc = "Constants"] # [allow (non_upper_case_globals)] impl ResourceSaver { pub const FLAG_BUNDLE_RESOURCES : i64 = 2i64 ; pub const FLAG_CHANGE_PATH : i64 = 4i64 ; pub const FLAG_COMPRESS : i64 = 32i64 ; pub const FLAG_OMIT_EDITOR_PROPERTIES : i64 = 8i64 ; pub const FLAG_RELATIVE_PATHS : i64 = 1i64 ; pub const FLAG_REPLACE_SUBRESOURCE_PATHS : i64 = 64i64 ; pub const FLAG_SAVE_BIG_ENDIAN : i64 = 16i64 ; } impl ResourceSaver { # [doc = "Returns a reference to the singleton instance."] # [inline] pub fn godot_singleton () -> & 'static Self { unsafe { let this = (get_api () . godot_global_get_singleton) ("ResourceSaver\0" . as_ptr () as * mut _) ; let this = ptr :: NonNull :: new (this) . expect ("singleton should not be null") ; let this = RawObject :: from_sys_ref_unchecked :: < 'static > (this) ; Self :: cast_ref (this) } } # [doc = "Returns the list of extensions available for saving a resource of a given type."] # [doc = ""] # [inline] pub fn get_recognized_extensions (& self , _type : impl AsArg < crate :: generated :: resource :: Resource >) -> StringArray { unsafe { let method_bind : * mut sys :: godot_method_bind = ResourceSaverMethodTable :: get (get_api ()) . get_recognized_extensions ; let ret = crate :: icalls :: icallptr_strarr_obj (method_bind , self . this . sys () . as_ptr () , _type . as_arg_ptr ()) ; StringArray :: from_sys (ret) } } # [doc = "Saves a resource to disk to the given path, using a [ResourceFormatSaver] that recognizes the resource object.\nThe `flags` bitmask can be specified to customize the save behavior.\nReturns [constant OK] on success.\n# Default Arguments\n* `flags` - `0`"] # [doc = ""] # [inline] pub fn save (& self , path : impl Into < GodotString > , resource : impl AsArg < crate :: generated :: resource :: Resource > , flags : i64) -> GodotResult { unsafe { let method_bind : * mut sys :: godot_method_bind = ResourceSaverMethodTable :: get (get_api ()) . save ; let ret = crate :: icalls :: icallptr_i64_str_obj_i64 (method_bind , self . this . sys () . as_ptr () , path . into () , resource . as_arg_ptr () , flags) ; GodotError :: result_from_sys (ret as _) } } } impl gdnative_core :: private :: godot_object :: Sealed for ResourceSaver { } unsafe impl GodotObject for ResourceSaver { type RefKind = ref_kind :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "ResourceSaver" } } impl std :: ops :: Deref for ResourceSaver { type Target = crate :: generated :: object :: Object ; # [inline] fn deref (& self) -> & crate :: generated :: object :: Object { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for ResourceSaver { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: object :: Object { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: object :: Object > for ResourceSaver { } unsafe impl Send for ResourceSaver { } unsafe impl Sync for ResourceSaver { } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct ResourceSaverMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_recognized_extensions : * mut sys :: godot_method_bind , pub save : * mut sys :: godot_method_bind } impl ResourceSaverMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : ResourceSaverMethodTable = ResourceSaverMethodTable { class_constructor : None , get_recognized_extensions : 0 as * mut sys :: godot_method_bind , save : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { ResourceSaverMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "_ResourceSaver\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_recognized_extensions = (gd_api . godot_method_bind_get_method) (class_name , "get_recognized_extensions\0" . as_ptr () as * const c_char) ; table . save = (gd_api . godot_method_bind_get_method) (class_name , "save\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:310:3261 [INFO] [stdout] | [INFO] [stdout] 310 | ...thodTable { class_constructor : None , } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 310 | # [doc = "`core class ResourceFormatSaver` inherits `Reference` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_resourceformatsaver.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nResourceFormatSaver inherits methods from:\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct ResourceFormatSaver { this : RawObject < Self > , } impl ResourceFormatSaver { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = ResourceFormatSaverMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } } impl gdnative_core :: private :: godot_object :: Sealed for ResourceFormatSaver { } unsafe impl GodotObject for ResourceFormatSaver { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "ResourceFormatSaver" } } impl std :: ops :: Deref for ResourceFormatSaver { type Target = crate :: generated :: reference :: Reference ; # [inline] fn deref (& self) -> & crate :: generated :: reference :: Reference { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for ResourceFormatSaver { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: reference :: Reference { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: reference :: Reference > for ResourceFormatSaver { } unsafe impl SubClass < crate :: generated :: object :: Object > for ResourceFormatSaver { } impl Instanciable for ResourceFormatSaver { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { ResourceFormatSaver :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct ResourceFormatSaverMethodTable { pub class_constructor : sys :: godot_class_constructor , } impl ResourceFormatSaverMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : ResourceFormatSaverMethodTable = ResourceFormatSaverMethodTable { class_constructor : None , } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { ResourceFormatSaverMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "ResourceFormatSaver\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:316:4252 [INFO] [stdout] | [INFO] [stdout] 316 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 316 | # [doc = "`core class SphereShape` inherits `Shape` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_sphereshape.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nSphereShape inherits methods from:\n - [Shape](struct.Shape.html)\n - [Resource](struct.Resource.html)\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct SphereShape { this : RawObject < Self > , } impl SphereShape { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = SphereShapeMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "The sphere's radius. The shape's diameter is double the radius."] # [doc = ""] # [inline] pub fn radius (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = SphereShapeMethodTable :: get (get_api ()) . get_radius ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "The sphere's radius. The shape's diameter is double the radius."] # [doc = ""] # [inline] pub fn set_radius (& self , radius : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = SphereShapeMethodTable :: get (get_api ()) . set_radius ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , radius) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for SphereShape { } unsafe impl GodotObject for SphereShape { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "SphereShape" } } impl std :: ops :: Deref for SphereShape { type Target = crate :: generated :: shape :: Shape ; # [inline] fn deref (& self) -> & crate :: generated :: shape :: Shape { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for SphereShape { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: shape :: Shape { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: shape :: Shape > for SphereShape { } unsafe impl SubClass < crate :: generated :: resource :: Resource > for SphereShape { } unsafe impl SubClass < crate :: generated :: reference :: Reference > for SphereShape { } unsafe impl SubClass < crate :: generated :: object :: Object > for SphereShape { } impl Instanciable for SphereShape { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { SphereShape :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct SphereShapeMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_radius : * mut sys :: godot_method_bind , pub set_radius : * mut sys :: godot_method_bind } impl SphereShapeMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : SphereShapeMethodTable = SphereShapeMethodTable { class_constructor : None , get_radius : 0 as * mut sys :: godot_method_bind , set_radius : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { SphereShapeMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "SphereShape\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_radius = (gd_api . godot_method_bind_get_method) (class_name , "get_radius\0" . as_ptr () as * const c_char) ; table . set_radius = (gd_api . godot_method_bind_get_method) (class_name , "set_radius\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:322:5275 [INFO] [stdout] | [INFO] [stdout] 322 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 322 | # [doc = "`core class VisualShaderNodeInput` inherits `VisualShaderNode` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_visualshadernodeinput.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nVisualShaderNodeInput inherits methods from:\n - [VisualShaderNode](struct.VisualShaderNode.html)\n - [Resource](struct.Resource.html)\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct VisualShaderNodeInput { this : RawObject < Self > , } impl VisualShaderNodeInput { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = VisualShaderNodeInputMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "One of the several input constants in lower-case style like: \"vertex\"(`VERTEX`) or \"point_size\"(`POINT_SIZE`)."] # [doc = ""] # [inline] pub fn input_name (& self) -> GodotString { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualShaderNodeInputMethodTable :: get (get_api ()) . get_input_name ; let ret = crate :: icalls :: icallptr_str (method_bind , self . this . sys () . as_ptr ()) ; GodotString :: from_sys (ret) } } # [doc = ""] # [doc = ""] # [inline] pub fn get_input_real_name (& self) -> GodotString { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualShaderNodeInputMethodTable :: get (get_api ()) . get_input_real_name ; let ret = crate :: icalls :: icallptr_str (method_bind , self . this . sys () . as_ptr ()) ; GodotString :: from_sys (ret) } } # [doc = "One of the several input constants in lower-case style like: \"vertex\"(`VERTEX`) or \"point_size\"(`POINT_SIZE`)."] # [doc = ""] # [inline] pub fn set_input_name (& self , name : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualShaderNodeInputMethodTable :: get (get_api ()) . set_input_name ; let ret = crate :: icalls :: icallptr_void_str (method_bind , self . this . sys () . as_ptr () , name . into ()) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for VisualShaderNodeInput { } unsafe impl GodotObject for VisualShaderNodeInput { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "VisualShaderNodeInput" } } impl std :: ops :: Deref for VisualShaderNodeInput { type Target = crate :: generated :: visual_shader_node :: VisualShaderNode ; # [inline] fn deref (& self) -> & crate :: generated :: visual_shader_node :: VisualShaderNode { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for VisualShaderNodeInput { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: visual_shader_node :: VisualShaderNode { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: visual_shader_node :: VisualShaderNode > for VisualShaderNodeInput { } unsafe impl SubClass < crate :: generated :: resource :: Resource > for VisualShaderNodeInput { } unsafe impl SubClass < crate :: generated :: reference :: Reference > for VisualShaderNodeInput { } unsafe impl SubClass < crate :: generated :: object :: Object > for VisualShaderNodeInput { } impl Instanciable for VisualShaderNodeInput { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { VisualShaderNodeInput :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct VisualShaderNodeInputMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_input_name : * mut sys :: godot_method_bind , pub get_input_real_name : * mut sys :: godot_method_bind , pub set_input_name : * mut sys :: godot_method_bind } impl VisualShaderNodeInputMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : VisualShaderNodeInputMethodTable = VisualShaderNodeInputMethodTable { class_constructor : None , get_input_name : 0 as * mut sys :: godot_method_bind , get_input_real_name : 0 as * mut sys :: godot_method_bind , set_input_name : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { VisualShaderNodeInputMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "VisualShaderNodeInput\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_input_name = (gd_api . godot_method_bind_get_method) (class_name , "get_input_name\0" . as_ptr () as * const c_char) ; table . get_input_real_name = (gd_api . godot_method_bind_get_method) (class_name , "get_input_real_name\0" . as_ptr () as * const c_char) ; table . set_input_name = (gd_api . godot_method_bind_get_method) (class_name , "set_input_name\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:328:4080 [INFO] [stdout] | [INFO] [stdout] 328 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 328 | # [doc = "`core class ScrollBar` inherits `Range` (unsafe)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_scrollbar.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = ""] # [doc = "\n## Class hierarchy\n\nScrollBar inherits methods from:\n - [Range](struct.Range.html)\n - [Control](struct.Control.html)\n - [CanvasItem](struct.CanvasItem.html)\n - [Node](struct.Node.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct ScrollBar { this : RawObject < Self > , } impl ScrollBar { # [doc = "Overrides the step used when clicking increment and decrement buttons or when using arrow keys when the [ScrollBar] is focused."] # [doc = ""] # [inline] pub fn custom_step (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = ScrollBarMethodTable :: get (get_api ()) . get_custom_step ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Overrides the step used when clicking increment and decrement buttons or when using arrow keys when the [ScrollBar] is focused."] # [doc = ""] # [inline] pub fn set_custom_step (& self , step : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = ScrollBarMethodTable :: get (get_api ()) . set_custom_step ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , step) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for ScrollBar { } unsafe impl GodotObject for ScrollBar { type RefKind = ref_kind :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "ScrollBar" } } impl QueueFree for ScrollBar { # [inline] unsafe fn godot_queue_free (obj : * mut sys :: godot_object) { let method_bind : * mut sys :: godot_method_bind = crate :: generated :: node :: NodeMethodTable :: get (get_api ()) . queue_free ; crate :: icalls :: icallptr_void (method_bind , obj) } } impl std :: ops :: Deref for ScrollBar { type Target = crate :: generated :: range :: Range ; # [inline] fn deref (& self) -> & crate :: generated :: range :: Range { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for ScrollBar { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: range :: Range { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: range :: Range > for ScrollBar { } unsafe impl SubClass < crate :: generated :: control :: Control > for ScrollBar { } unsafe impl SubClass < crate :: generated :: canvas_item :: CanvasItem > for ScrollBar { } unsafe impl SubClass < crate :: generated :: node :: Node > for ScrollBar { } unsafe impl SubClass < crate :: generated :: object :: Object > for ScrollBar { } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct ScrollBarMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_custom_step : * mut sys :: godot_method_bind , pub set_custom_step : * mut sys :: godot_method_bind } impl ScrollBarMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : ScrollBarMethodTable = ScrollBarMethodTable { class_constructor : None , get_custom_step : 0 as * mut sys :: godot_method_bind , set_custom_step : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { ScrollBarMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "ScrollBar\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_custom_step = (gd_api . godot_method_bind_get_method) (class_name , "get_custom_step\0" . as_ptr () as * const c_char) ; table . set_custom_step = (gd_api . godot_method_bind_get_method) (class_name , "set_custom_step\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:334:11953 [INFO] [stdout] | [INFO] [stdout] 334 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 334 | # [doc = "`core class Sprite3D` inherits `SpriteBase3D` (unsafe)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_sprite3d.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nNon reference counted objects such as the ones of this type are usually owned by the engine.\n\n`Sprite3D` is a reference-only type. Persistent references can\nonly exist in the unsafe `Ref` form.\n\nIn the cases where Rust code owns an object of this type, for example if the object was just\ncreated on the Rust side and not passed to the engine yet, ownership should be either given\nto the engine or the object must be manually destroyed using `Ref::free`, or `Ref::queue_free`\nif it is a `Node`."] # [doc = "\n## Class hierarchy\n\nSprite3D inherits methods from:\n - [SpriteBase3D](struct.SpriteBase3D.html)\n - [GeometryInstance](struct.GeometryInstance.html)\n - [VisualInstance](struct.VisualInstance.html)\n - [Spatial](struct.Spatial.html)\n - [Node](struct.Node.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct Sprite3D { this : RawObject < Self > , } impl Sprite3D { # [doc = "Creates a new instance of this object.\n\nBecause this type is not reference counted, the lifetime of the returned object\nis *not* automatically managed.\n\nImmediately after creation, the object is owned by the caller, and can be\npassed to the engine (in which case the engine will be responsible for\ndestroying the object) or destroyed manually using `Ref::free`, or preferably\n`Ref::queue_free` if it is a `Node`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = Sprite3DMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "Current frame to display from sprite sheet. [member vframes] or [member hframes] must be greater than 1."] # [doc = ""] # [inline] pub fn frame (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = Sprite3DMethodTable :: get (get_api ()) . get_frame ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Coordinates of the frame to display from sprite sheet. This is as an alias for the [member frame] property. [member vframes] or [member hframes] must be greater than 1."] # [doc = ""] # [inline] pub fn frame_coords (& self) -> Vector2 { unsafe { let method_bind : * mut sys :: godot_method_bind = Sprite3DMethodTable :: get (get_api ()) . get_frame_coords ; let ret = crate :: icalls :: icallptr_vec2 (method_bind , self . this . sys () . as_ptr ()) ; mem :: transmute (ret) } } # [doc = "The number of columns in the sprite sheet."] # [doc = ""] # [inline] pub fn hframes (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = Sprite3DMethodTable :: get (get_api ()) . get_hframes ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "The region of the atlas texture to display. [member region_enabled] must be `true`."] # [doc = ""] # [inline] pub fn region_rect (& self) -> Rect2 { unsafe { let method_bind : * mut sys :: godot_method_bind = Sprite3DMethodTable :: get (get_api ()) . get_region_rect ; let ret = crate :: icalls :: icallptr_rect2 (method_bind , self . this . sys () . as_ptr ()) ; mem :: transmute (ret) } } # [doc = "[Texture] object to draw. If [member GeometryInstance.material_override] is used, this will be overridden."] # [doc = ""] # [inline] pub fn texture (& self) -> Option < Ref < crate :: generated :: texture :: Texture , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = Sprite3DMethodTable :: get (get_api ()) . get_texture ; let ret = crate :: icalls :: icallptr_obj (method_bind , self . this . sys () . as_ptr ()) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: texture :: Texture , thread_access :: Shared >> :: move_from_sys (sys)) } } # [doc = "The number of rows in the sprite sheet."] # [doc = ""] # [inline] pub fn vframes (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = Sprite3DMethodTable :: get (get_api ()) . get_vframes ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "If `true`, texture will be cut from a larger atlas texture. See [member region_rect]."] # [doc = ""] # [inline] pub fn is_region (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = Sprite3DMethodTable :: get (get_api ()) . is_region ; let ret = crate :: icalls :: icallptr_bool (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Current frame to display from sprite sheet. [member vframes] or [member hframes] must be greater than 1."] # [doc = ""] # [inline] pub fn set_frame (& self , frame : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = Sprite3DMethodTable :: get (get_api ()) . set_frame ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , frame) ; } } # [doc = "Coordinates of the frame to display from sprite sheet. This is as an alias for the [member frame] property. [member vframes] or [member hframes] must be greater than 1."] # [doc = ""] # [inline] pub fn set_frame_coords (& self , coords : Vector2) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = Sprite3DMethodTable :: get (get_api ()) . set_frame_coords ; let ret = crate :: icalls :: icallptr_void_vec2 (method_bind , self . this . sys () . as_ptr () , coords) ; } } # [doc = "The number of columns in the sprite sheet."] # [doc = ""] # [inline] pub fn set_hframes (& self , hframes : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = Sprite3DMethodTable :: get (get_api ()) . set_hframes ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , hframes) ; } } # [doc = "If `true`, texture will be cut from a larger atlas texture. See [member region_rect]."] # [doc = ""] # [inline] pub fn set_region (& self , enabled : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = Sprite3DMethodTable :: get (get_api ()) . set_region ; let ret = crate :: icalls :: icallptr_void_bool (method_bind , self . this . sys () . as_ptr () , enabled) ; } } # [doc = "The region of the atlas texture to display. [member region_enabled] must be `true`."] # [doc = ""] # [inline] pub fn set_region_rect (& self , rect : Rect2) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = Sprite3DMethodTable :: get (get_api ()) . set_region_rect ; let ret = crate :: icalls :: icallptr_void_rect2 (method_bind , self . this . sys () . as_ptr () , rect) ; } } # [doc = "[Texture] object to draw. If [member GeometryInstance.material_override] is used, this will be overridden."] # [doc = ""] # [inline] pub fn set_texture (& self , texture : impl AsArg < crate :: generated :: texture :: Texture >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = Sprite3DMethodTable :: get (get_api ()) . set_texture ; let ret = crate :: icalls :: icallptr_void_obj (method_bind , self . this . sys () . as_ptr () , texture . as_arg_ptr ()) ; } } # [doc = "The number of rows in the sprite sheet."] # [doc = ""] # [inline] pub fn set_vframes (& self , vframes : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = Sprite3DMethodTable :: get (get_api ()) . set_vframes ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , vframes) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for Sprite3D { } unsafe impl GodotObject for Sprite3D { type RefKind = ref_kind :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "Sprite3D" } } impl QueueFree for Sprite3D { # [inline] unsafe fn godot_queue_free (obj : * mut sys :: godot_object) { let method_bind : * mut sys :: godot_method_bind = crate :: generated :: node :: NodeMethodTable :: get (get_api ()) . queue_free ; crate :: icalls :: icallptr_void (method_bind , obj) } } impl std :: ops :: Deref for Sprite3D { type Target = crate :: generated :: sprite_base_3d :: SpriteBase3D ; # [inline] fn deref (& self) -> & crate :: generated :: sprite_base_3d :: SpriteBase3D { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for Sprite3D { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: sprite_base_3d :: SpriteBase3D { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: sprite_base_3d :: SpriteBase3D > for Sprite3D { } unsafe impl SubClass < crate :: generated :: geometry_instance :: GeometryInstance > for Sprite3D { } unsafe impl SubClass < crate :: generated :: visual_instance :: VisualInstance > for Sprite3D { } unsafe impl SubClass < crate :: generated :: spatial :: Spatial > for Sprite3D { } unsafe impl SubClass < crate :: generated :: node :: Node > for Sprite3D { } unsafe impl SubClass < crate :: generated :: object :: Object > for Sprite3D { } impl Instanciable for Sprite3D { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { Sprite3D :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct Sprite3DMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_frame : * mut sys :: godot_method_bind , pub get_frame_coords : * mut sys :: godot_method_bind , pub get_hframes : * mut sys :: godot_method_bind , pub get_region_rect : * mut sys :: godot_method_bind , pub get_texture : * mut sys :: godot_method_bind , pub get_vframes : * mut sys :: godot_method_bind , pub is_region : * mut sys :: godot_method_bind , pub set_frame : * mut sys :: godot_method_bind , pub set_frame_coords : * mut sys :: godot_method_bind , pub set_hframes : * mut sys :: godot_method_bind , pub set_region : * mut sys :: godot_method_bind , pub set_region_rect : * mut sys :: godot_method_bind , pub set_texture : * mut sys :: godot_method_bind , pub set_vframes : * mut sys :: godot_method_bind } impl Sprite3DMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : Sprite3DMethodTable = Sprite3DMethodTable { class_constructor : None , get_frame : 0 as * mut sys :: godot_method_bind , get_frame_coords : 0 as * mut sys :: godot_method_bind , get_hframes : 0 as * mut sys :: godot_method_bind , get_region_rect : 0 as * mut sys :: godot_method_bind , get_texture : 0 as * mut sys :: godot_method_bind , get_vframes : 0 as * mut sys :: godot_method_bind , is_region : 0 as * mut sys :: godot_method_bind , set_frame : 0 as * mut sys :: godot_method_bind , set_frame_coords : 0 as * mut sys :: godot_method_bind , set_hframes : 0 as * mut sys :: godot_method_bind , set_region : 0 as * mut sys :: godot_method_bind , set_region_rect : 0 as * mut sys :: godot_method_bind , set_texture : 0 as * mut sys :: godot_method_bind , set_vframes : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { Sprite3DMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "Sprite3D\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_frame = (gd_api . godot_method_bind_get_method) (class_name , "get_frame\0" . as_ptr () as * const c_char) ; table . get_frame_coords = (gd_api . godot_method_bind_get_method) (class_name , "get_frame_coords\0" . as_ptr () as * const c_char) ; table . get_hframes = (gd_api . godot_method_bind_get_method) (class_name , "get_hframes\0" . as_ptr () as * const c_char) ; table . get_region_rect = (gd_api . godot_method_bind_get_method) (class_name , "get_region_rect\0" . as_ptr () as * const c_char) ; table . get_texture = (gd_api . godot_method_bind_get_method) (class_name , "get_texture\0" . as_ptr () as * const c_char) ; table . get_vframes = (gd_api . godot_method_bind_get_method) (class_name , "get_vframes\0" . as_ptr () as * const c_char) ; table . is_region = (gd_api . godot_method_bind_get_method) (class_name , "is_region\0" . as_ptr () as * const c_char) ; table . set_frame = (gd_api . godot_method_bind_get_method) (class_name , "set_frame\0" . as_ptr () as * const c_char) ; table . set_frame_coords = (gd_api . godot_method_bind_get_method) (class_name , "set_frame_coords\0" . as_ptr () as * const c_char) ; table . set_hframes = (gd_api . godot_method_bind_get_method) (class_name , "set_hframes\0" . as_ptr () as * const c_char) ; table . set_region = (gd_api . godot_method_bind_get_method) (class_name , "set_region\0" . as_ptr () as * const c_char) ; table . set_region_rect = (gd_api . godot_method_bind_get_method) (class_name , "set_region_rect\0" . as_ptr () as * const c_char) ; table . set_texture = (gd_api . godot_method_bind_get_method) (class_name , "set_texture\0" . as_ptr () as * const c_char) ; table . set_vframes = (gd_api . godot_method_bind_get_method) (class_name , "set_vframes\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:340:4106 [INFO] [stdout] | [INFO] [stdout] 340 | ...thodTable { class_constructor : None , } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 340 | # [doc = "`core class VisualShaderNodeBooleanUniform` inherits `VisualShaderNodeUniform` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_visualshadernodebooleanuniform.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nVisualShaderNodeBooleanUniform inherits methods from:\n - [VisualShaderNodeUniform](struct.VisualShaderNodeUniform.html)\n - [VisualShaderNode](struct.VisualShaderNode.html)\n - [Resource](struct.Resource.html)\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct VisualShaderNodeBooleanUniform { this : RawObject < Self > , } impl VisualShaderNodeBooleanUniform { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = VisualShaderNodeBooleanUniformMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } } impl gdnative_core :: private :: godot_object :: Sealed for VisualShaderNodeBooleanUniform { } unsafe impl GodotObject for VisualShaderNodeBooleanUniform { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "VisualShaderNodeBooleanUniform" } } impl std :: ops :: Deref for VisualShaderNodeBooleanUniform { type Target = crate :: generated :: visual_shader_node_uniform :: VisualShaderNodeUniform ; # [inline] fn deref (& self) -> & crate :: generated :: visual_shader_node_uniform :: VisualShaderNodeUniform { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for VisualShaderNodeBooleanUniform { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: visual_shader_node_uniform :: VisualShaderNodeUniform { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: visual_shader_node_uniform :: VisualShaderNodeUniform > for VisualShaderNodeBooleanUniform { } unsafe impl SubClass < crate :: generated :: visual_shader_node :: VisualShaderNode > for VisualShaderNodeBooleanUniform { } unsafe impl SubClass < crate :: generated :: resource :: Resource > for VisualShaderNodeBooleanUniform { } unsafe impl SubClass < crate :: generated :: reference :: Reference > for VisualShaderNodeBooleanUniform { } unsafe impl SubClass < crate :: generated :: object :: Object > for VisualShaderNodeBooleanUniform { } impl Instanciable for VisualShaderNodeBooleanUniform { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { VisualShaderNodeBooleanUniform :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct VisualShaderNodeBooleanUniformMethodTable { pub class_constructor : sys :: godot_class_constructor , } impl VisualShaderNodeBooleanUniformMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : VisualShaderNodeBooleanUniformMethodTable = VisualShaderNodeBooleanUniformMethodTable { class_constructor : None , } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { VisualShaderNodeBooleanUniformMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "VisualShaderNodeBooleanUniform\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:346:4464 [INFO] [stdout] | [INFO] [stdout] 346 | ...thodTable { class_constructor : None , } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 346 | # [doc = "`core class HSeparator` inherits `Separator` (unsafe)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_hseparator.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nNon reference counted objects such as the ones of this type are usually owned by the engine.\n\n`HSeparator` is a reference-only type. Persistent references can\nonly exist in the unsafe `Ref` form.\n\nIn the cases where Rust code owns an object of this type, for example if the object was just\ncreated on the Rust side and not passed to the engine yet, ownership should be either given\nto the engine or the object must be manually destroyed using `Ref::free`, or `Ref::queue_free`\nif it is a `Node`."] # [doc = "\n## Class hierarchy\n\nHSeparator inherits methods from:\n - [Separator](struct.Separator.html)\n - [Control](struct.Control.html)\n - [CanvasItem](struct.CanvasItem.html)\n - [Node](struct.Node.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct HSeparator { this : RawObject < Self > , } impl HSeparator { # [doc = "Creates a new instance of this object.\n\nBecause this type is not reference counted, the lifetime of the returned object\nis *not* automatically managed.\n\nImmediately after creation, the object is owned by the caller, and can be\npassed to the engine (in which case the engine will be responsible for\ndestroying the object) or destroyed manually using `Ref::free`, or preferably\n`Ref::queue_free` if it is a `Node`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = HSeparatorMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } } impl gdnative_core :: private :: godot_object :: Sealed for HSeparator { } unsafe impl GodotObject for HSeparator { type RefKind = ref_kind :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "HSeparator" } } impl QueueFree for HSeparator { # [inline] unsafe fn godot_queue_free (obj : * mut sys :: godot_object) { let method_bind : * mut sys :: godot_method_bind = crate :: generated :: node :: NodeMethodTable :: get (get_api ()) . queue_free ; crate :: icalls :: icallptr_void (method_bind , obj) } } impl std :: ops :: Deref for HSeparator { type Target = crate :: generated :: separator :: Separator ; # [inline] fn deref (& self) -> & crate :: generated :: separator :: Separator { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for HSeparator { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: separator :: Separator { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: separator :: Separator > for HSeparator { } unsafe impl SubClass < crate :: generated :: control :: Control > for HSeparator { } unsafe impl SubClass < crate :: generated :: canvas_item :: CanvasItem > for HSeparator { } unsafe impl SubClass < crate :: generated :: node :: Node > for HSeparator { } unsafe impl SubClass < crate :: generated :: object :: Object > for HSeparator { } impl Instanciable for HSeparator { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { HSeparator :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct HSeparatorMethodTable { pub class_constructor : sys :: godot_class_constructor , } impl HSeparatorMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : HSeparatorMethodTable = HSeparatorMethodTable { class_constructor : None , } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { HSeparatorMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "HSeparator\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:352:5487 [INFO] [stdout] | [INFO] [stdout] 352 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 352 | # [doc = "`core class VisualScriptLocalVarSet` inherits `VisualScriptNode` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_visualscriptlocalvarset.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nVisualScriptLocalVarSet inherits methods from:\n - [VisualScriptNode](struct.VisualScriptNode.html)\n - [Resource](struct.Resource.html)\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct VisualScriptLocalVarSet { this : RawObject < Self > , } impl VisualScriptLocalVarSet { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = VisualScriptLocalVarSetMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = ""] # [doc = ""] # [inline] pub fn var_name (& self) -> GodotString { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualScriptLocalVarSetMethodTable :: get (get_api ()) . get_var_name ; let ret = crate :: icalls :: icallptr_str (method_bind , self . this . sys () . as_ptr ()) ; GodotString :: from_sys (ret) } } # [doc = ""] # [doc = ""] # [inline] pub fn var_type (& self) -> VariantType { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualScriptLocalVarSetMethodTable :: get (get_api ()) . get_var_type ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; VariantType :: from_sys (ret as _) } } # [doc = ""] # [doc = ""] # [inline] pub fn set_var_name (& self , name : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualScriptLocalVarSetMethodTable :: get (get_api ()) . set_var_name ; let ret = crate :: icalls :: icallptr_void_str (method_bind , self . this . sys () . as_ptr () , name . into ()) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn set_var_type (& self , _type : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualScriptLocalVarSetMethodTable :: get (get_api ()) . set_var_type ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , _type) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for VisualScriptLocalVarSet { } unsafe impl GodotObject for VisualScriptLocalVarSet { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "VisualScriptLocalVarSet" } } impl std :: ops :: Deref for VisualScriptLocalVarSet { type Target = crate :: generated :: visual_script_node :: VisualScriptNode ; # [inline] fn deref (& self) -> & crate :: generated :: visual_script_node :: VisualScriptNode { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for VisualScriptLocalVarSet { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: visual_script_node :: VisualScriptNode { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: visual_script_node :: VisualScriptNode > for VisualScriptLocalVarSet { } unsafe impl SubClass < crate :: generated :: resource :: Resource > for VisualScriptLocalVarSet { } unsafe impl SubClass < crate :: generated :: reference :: Reference > for VisualScriptLocalVarSet { } unsafe impl SubClass < crate :: generated :: object :: Object > for VisualScriptLocalVarSet { } impl Instanciable for VisualScriptLocalVarSet { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { VisualScriptLocalVarSet :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct VisualScriptLocalVarSetMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_var_name : * mut sys :: godot_method_bind , pub get_var_type : * mut sys :: godot_method_bind , pub set_var_name : * mut sys :: godot_method_bind , pub set_var_type : * mut sys :: godot_method_bind } impl VisualScriptLocalVarSetMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : VisualScriptLocalVarSetMethodTable = VisualScriptLocalVarSetMethodTable { class_constructor : None , get_var_name : 0 as * mut sys :: godot_method_bind , get_var_type : 0 as * mut sys :: godot_method_bind , set_var_name : 0 as * mut sys :: godot_method_bind , set_var_type : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { VisualScriptLocalVarSetMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "VisualScriptLocalVarSet\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_var_name = (gd_api . godot_method_bind_get_method) (class_name , "get_var_name\0" . as_ptr () as * const c_char) ; table . get_var_type = (gd_api . godot_method_bind_get_method) (class_name , "get_var_type\0" . as_ptr () as * const c_char) ; table . set_var_name = (gd_api . godot_method_bind_get_method) (class_name , "set_var_name\0" . as_ptr () as * const c_char) ; table . set_var_type = (gd_api . godot_method_bind_get_method) (class_name , "set_var_type\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:358:19948 [INFO] [stdout] | [INFO] [stdout] 358 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 358 | # [doc = "`core singleton class Engine` inherits `Object` (unsafe)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_engine.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = ""] # [doc = "\n## Class hierarchy\n\nEngine inherits methods from:\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct Engine { this : RawObject < Self > , } impl Engine { # [doc = "Returns a reference to the singleton instance."] # [inline] pub fn godot_singleton () -> & 'static Self { unsafe { let this = (get_api () . godot_global_get_singleton) ("Engine\0" . as_ptr () as * mut _) ; let this = ptr :: NonNull :: new (this) . expect ("singleton should not be null") ; let this = RawObject :: from_sys_ref_unchecked :: < 'static > (this) ; Self :: cast_ref (this) } } # [doc = "Returns engine author information in a Dictionary.\n`lead_developers` - Array of Strings, lead developer names\n`founders` - Array of Strings, founder names\n`project_managers` - Array of Strings, project manager names\n`developers` - Array of Strings, developer names"] # [doc = ""] # [inline] pub fn get_author_info (& self) -> Dictionary { unsafe { let method_bind : * mut sys :: godot_method_bind = EngineMethodTable :: get (get_api ()) . get_author_info ; let ret = crate :: icalls :: icallptr_dict (method_bind , self . this . sys () . as_ptr ()) ; Dictionary :: from_sys (ret) } } # [doc = "Returns an Array of copyright information Dictionaries.\n`name` - String, component name\n`parts` - Array of Dictionaries {`files`, `copyright`, `license`} describing subsections of the component"] # [doc = ""] # [inline] pub fn get_copyright_info (& self) -> VariantArray { unsafe { let method_bind : * mut sys :: godot_method_bind = EngineMethodTable :: get (get_api ()) . get_copyright_info ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < VariantArray > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns a Dictionary of Arrays of donor names.\n{`platinum_sponsors`, `gold_sponsors`, `silver_sponsors`, `bronze_sponsors`, `mini_sponsors`, `gold_donors`, `silver_donors`, `bronze_donors`}"] # [doc = ""] # [inline] pub fn get_donor_info (& self) -> Dictionary { unsafe { let method_bind : * mut sys :: godot_method_bind = EngineMethodTable :: get (get_api ()) . get_donor_info ; let ret = crate :: icalls :: icallptr_dict (method_bind , self . this . sys () . as_ptr ()) ; Dictionary :: from_sys (ret) } } # [doc = "Returns the total number of frames drawn. If the render loop is disabled with `--disable-render-loop` via command line, this returns `0`. See also [method get_idle_frames]."] # [doc = ""] # [inline] pub fn get_frames_drawn (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = EngineMethodTable :: get (get_api ()) . get_frames_drawn ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Returns the frames per second of the running game."] # [doc = ""] # [inline] pub fn get_frames_per_second (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = EngineMethodTable :: get (get_api ()) . get_frames_per_second ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Returns the total number of frames passed since engine initialization which is advanced on each **idle frame**, regardless of whether the render loop is enabled. See also [method get_frames_drawn]."] # [doc = ""] # [inline] pub fn get_idle_frames (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = EngineMethodTable :: get (get_api ()) . get_idle_frames ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "The number of fixed iterations per second. This controls how often physics simulation and [method Node._physics_process] methods are run. This value should generally always be set to `60` or above, as Godot doesn't interpolate the physics step. As a result, values lower than `60` will look stuttery. This value can be increased to make input more reactive or work around tunneling issues, but keep in mind doing so will increase CPU usage."] # [doc = ""] # [inline] pub fn iterations_per_second (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = EngineMethodTable :: get (get_api ()) . get_iterations_per_second ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Returns Dictionary of licenses used by Godot and included third party components."] # [doc = ""] # [inline] pub fn get_license_info (& self) -> Dictionary { unsafe { let method_bind : * mut sys :: godot_method_bind = EngineMethodTable :: get (get_api ()) . get_license_info ; let ret = crate :: icalls :: icallptr_dict (method_bind , self . this . sys () . as_ptr ()) ; Dictionary :: from_sys (ret) } } # [doc = "Returns Godot license text."] # [doc = ""] # [inline] pub fn get_license_text (& self) -> GodotString { unsafe { let method_bind : * mut sys :: godot_method_bind = EngineMethodTable :: get (get_api ()) . get_license_text ; let ret = crate :: icalls :: icallptr_str (method_bind , self . this . sys () . as_ptr ()) ; GodotString :: from_sys (ret) } } # [doc = "Returns the main loop object (see [MainLoop] and [SceneTree])."] # [doc = ""] # [inline] pub fn get_main_loop (& self) -> Option < Ref < crate :: generated :: main_loop :: MainLoop , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = EngineMethodTable :: get (get_api ()) . get_main_loop ; let ret = crate :: icalls :: icallptr_obj (method_bind , self . this . sys () . as_ptr ()) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: main_loop :: MainLoop , thread_access :: Shared >> :: move_from_sys (sys)) } } # [doc = "Returns the total number of frames passed since engine initialization which is advanced on each **physics frame**."] # [doc = ""] # [inline] pub fn get_physics_frames (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = EngineMethodTable :: get (get_api ()) . get_physics_frames ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Returns the fraction through the current physics tick we are at the time of rendering the frame. This can be used to implement fixed timestep interpolation."] # [doc = ""] # [inline] pub fn get_physics_interpolation_fraction (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = EngineMethodTable :: get (get_api ()) . get_physics_interpolation_fraction ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Controls how much physics ticks are synchronized with real time. For 0 or less, the ticks are synchronized. Such values are recommended for network games, where clock synchronization matters. Higher values cause higher deviation of in-game clock and real clock, but allows to smooth out framerate jitters. The default value of 0.5 should be fine for most; values above 2 could cause the game to react to dropped frames with a noticeable delay and are not recommended."] # [doc = ""] # [inline] pub fn physics_jitter_fix (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = EngineMethodTable :: get (get_api ()) . get_physics_jitter_fix ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Returns a global singleton with given `name`. Often used for plugins, e.g. `GodotPayment` on Android."] # [doc = ""] # [inline] pub fn get_singleton (& self , name : impl Into < GodotString >) -> Option < Ref < crate :: generated :: object :: Object , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = EngineMethodTable :: get (get_api ()) . get_singleton ; let ret = crate :: icalls :: icallptr_obj_str (method_bind , self . this . sys () . as_ptr () , name . into ()) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: object :: Object , thread_access :: Shared >> :: move_from_sys (sys)) } } # [doc = "The desired frames per second. If the hardware cannot keep up, this setting may not be respected. A value of 0 means no limit."] # [doc = ""] # [inline] pub fn target_fps (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = EngineMethodTable :: get (get_api ()) . get_target_fps ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Controls how fast or slow the in-game clock ticks versus the real life one. It defaults to 1.0. A value of 2.0 means the game moves twice as fast as real life, whilst a value of 0.5 means the game moves at half the regular speed."] # [doc = ""] # [inline] pub fn time_scale (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = EngineMethodTable :: get (get_api ()) . get_time_scale ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "_Sample code is GDScript unless otherwise noted._\n\nReturns the current engine version information in a Dictionary.\n`major` - Holds the major version number as an int\n`minor` - Holds the minor version number as an int\n`patch` - Holds the patch version number as an int\n`hex` - Holds the full version number encoded as a hexadecimal int with one byte (2 places) per number (see example below)\n`status` - Holds the status (e.g. \"beta\", \"rc1\", \"rc2\", ... \"stable\") as a String\n`build` - Holds the build name (e.g. \"custom_build\") as a String\n`hash` - Holds the full Git commit hash as a String\n`year` - Holds the year the version was released in as an int\n`string` - `major` + `minor` + `patch` + `status` + `build` in a single String\nThe `hex` value is encoded as follows, from left to right: one byte for the major, one byte for the minor, one byte for the patch version. For example, \"3.1.12\" would be `0x03010C`. **Note:** It's still an int internally, and printing it will give you its decimal representation, which is not particularly meaningful. Use hexadecimal literals for easy version comparisons from code:\n```gdscript\nif Engine.get_version_info().hex >= 0x030200:\n # Do things specific to version 3.2 or later\nelse:\n # Do things specific to versions before 3.2\n```"] # [doc = ""] # [inline] pub fn get_version_info (& self) -> Dictionary { unsafe { let method_bind : * mut sys :: godot_method_bind = EngineMethodTable :: get (get_api ()) . get_version_info ; let ret = crate :: icalls :: icallptr_dict (method_bind , self . this . sys () . as_ptr ()) ; Dictionary :: from_sys (ret) } } # [doc = "Returns `true` if a singleton with given `name` exists in global scope."] # [doc = ""] # [inline] pub fn has_singleton (& self , name : impl Into < GodotString >) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = EngineMethodTable :: get (get_api ()) . has_singleton ; let ret = crate :: icalls :: icallptr_bool_str (method_bind , self . this . sys () . as_ptr () , name . into ()) ; ret as _ } } # [doc = "If `true`, it is running inside the editor. Useful for tool scripts."] # [doc = ""] # [inline] pub fn is_editor_hint (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = EngineMethodTable :: get (get_api ()) . is_editor_hint ; let ret = crate :: icalls :: icallptr_bool (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Returns `true` if the game is inside the fixed process and physics phase of the game loop."] # [doc = ""] # [inline] pub fn is_in_physics_frame (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = EngineMethodTable :: get (get_api ()) . is_in_physics_frame ; let ret = crate :: icalls :: icallptr_bool (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "If `true`, it is running inside the editor. Useful for tool scripts."] # [doc = ""] # [inline] pub fn set_editor_hint (& self , enabled : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EngineMethodTable :: get (get_api ()) . set_editor_hint ; let ret = crate :: icalls :: icallptr_void_bool (method_bind , self . this . sys () . as_ptr () , enabled) ; } } # [doc = "The number of fixed iterations per second. This controls how often physics simulation and [method Node._physics_process] methods are run. This value should generally always be set to `60` or above, as Godot doesn't interpolate the physics step. As a result, values lower than `60` will look stuttery. This value can be increased to make input more reactive or work around tunneling issues, but keep in mind doing so will increase CPU usage."] # [doc = ""] # [inline] pub fn set_iterations_per_second (& self , iterations_per_second : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EngineMethodTable :: get (get_api ()) . set_iterations_per_second ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , iterations_per_second) ; } } # [doc = "Controls how much physics ticks are synchronized with real time. For 0 or less, the ticks are synchronized. Such values are recommended for network games, where clock synchronization matters. Higher values cause higher deviation of in-game clock and real clock, but allows to smooth out framerate jitters. The default value of 0.5 should be fine for most; values above 2 could cause the game to react to dropped frames with a noticeable delay and are not recommended."] # [doc = ""] # [inline] pub fn set_physics_jitter_fix (& self , physics_jitter_fix : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EngineMethodTable :: get (get_api ()) . set_physics_jitter_fix ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , physics_jitter_fix) ; } } # [doc = "The desired frames per second. If the hardware cannot keep up, this setting may not be respected. A value of 0 means no limit."] # [doc = ""] # [inline] pub fn set_target_fps (& self , target_fps : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EngineMethodTable :: get (get_api ()) . set_target_fps ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , target_fps) ; } } # [doc = "Controls how fast or slow the in-game clock ticks versus the real life one. It defaults to 1.0. A value of 2.0 means the game moves twice as fast as real life, whilst a value of 0.5 means the game moves at half the regular speed."] # [doc = ""] # [inline] pub fn set_time_scale (& self , time_scale : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EngineMethodTable :: get (get_api ()) . set_time_scale ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , time_scale) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for Engine { } unsafe impl GodotObject for Engine { type RefKind = ref_kind :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "Engine" } } impl std :: ops :: Deref for Engine { type Target = crate :: generated :: object :: Object ; # [inline] fn deref (& self) -> & crate :: generated :: object :: Object { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for Engine { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: object :: Object { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: object :: Object > for Engine { } unsafe impl Send for Engine { } unsafe impl Sync for Engine { } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct EngineMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_author_info : * mut sys :: godot_method_bind , pub get_copyright_info : * mut sys :: godot_method_bind , pub get_donor_info : * mut sys :: godot_method_bind , pub get_frames_drawn : * mut sys :: godot_method_bind , pub get_frames_per_second : * mut sys :: godot_method_bind , pub get_idle_frames : * mut sys :: godot_method_bind , pub get_iterations_per_second : * mut sys :: godot_method_bind , pub get_license_info : * mut sys :: godot_method_bind , pub get_license_text : * mut sys :: godot_method_bind , pub get_main_loop : * mut sys :: godot_method_bind , pub get_physics_frames : * mut sys :: godot_method_bind , pub get_physics_interpolation_fraction : * mut sys :: godot_method_bind , pub get_physics_jitter_fix : * mut sys :: godot_method_bind , pub get_singleton : * mut sys :: godot_method_bind , pub get_target_fps : * mut sys :: godot_method_bind , pub get_time_scale : * mut sys :: godot_method_bind , pub get_version_info : * mut sys :: godot_method_bind , pub has_singleton : * mut sys :: godot_method_bind , pub is_editor_hint : * mut sys :: godot_method_bind , pub is_in_physics_frame : * mut sys :: godot_method_bind , pub set_editor_hint : * mut sys :: godot_method_bind , pub set_iterations_per_second : * mut sys :: godot_method_bind , pub set_physics_jitter_fix : * mut sys :: godot_method_bind , pub set_target_fps : * mut sys :: godot_method_bind , pub set_time_scale : * mut sys :: godot_method_bind } impl EngineMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : EngineMethodTable = EngineMethodTable { class_constructor : None , get_author_info : 0 as * mut sys :: godot_method_bind , get_copyright_info : 0 as * mut sys :: godot_method_bind , get_donor_info : 0 as * mut sys :: godot_method_bind , get_frames_drawn : 0 as * mut sys :: godot_method_bind , get_frames_per_second : 0 as * mut sys :: godot_method_bind , get_idle_frames : 0 as * mut sys :: godot_method_bind , get_iterations_per_second : 0 as * mut sys :: godot_method_bind , get_license_info : 0 as * mut sys :: godot_method_bind , get_license_text : 0 as * mut sys :: godot_method_bind , get_main_loop : 0 as * mut sys :: godot_method_bind , get_physics_frames : 0 as * mut sys :: godot_method_bind , get_physics_interpolation_fraction : 0 as * mut sys :: godot_method_bind , get_physics_jitter_fix : 0 as * mut sys :: godot_method_bind , get_singleton : 0 as * mut sys :: godot_method_bind , get_target_fps : 0 as * mut sys :: godot_method_bind , get_time_scale : 0 as * mut sys :: godot_method_bind , get_version_info : 0 as * mut sys :: godot_method_bind , has_singleton : 0 as * mut sys :: godot_method_bind , is_editor_hint : 0 as * mut sys :: godot_method_bind , is_in_physics_frame : 0 as * mut sys :: godot_method_bind , set_editor_hint : 0 as * mut sys :: godot_method_bind , set_iterations_per_second : 0 as * mut sys :: godot_method_bind , set_physics_jitter_fix : 0 as * mut sys :: godot_method_bind , set_target_fps : 0 as * mut sys :: godot_method_bind , set_time_scale : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { EngineMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "_Engine\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_author_info = (gd_api . godot_method_bind_get_method) (class_name , "get_author_info\0" . as_ptr () as * const c_char) ; table . get_copyright_info = (gd_api . godot_method_bind_get_method) (class_name , "get_copyright_info\0" . as_ptr () as * const c_char) ; table . get_donor_info = (gd_api . godot_method_bind_get_method) (class_name , "get_donor_info\0" . as_ptr () as * const c_char) ; table . get_frames_drawn = (gd_api . godot_method_bind_get_method) (class_name , "get_frames_drawn\0" . as_ptr () as * const c_char) ; table . get_frames_per_second = (gd_api . godot_method_bind_get_method) (class_name , "get_frames_per_second\0" . as_ptr () as * const c_char) ; table . get_idle_frames = (gd_api . godot_method_bind_get_method) (class_name , "get_idle_frames\0" . as_ptr () as * const c_char) ; table . get_iterations_per_second = (gd_api . godot_method_bind_get_method) (class_name , "get_iterations_per_second\0" . as_ptr () as * const c_char) ; table . get_license_info = (gd_api . godot_method_bind_get_method) (class_name , "get_license_info\0" . as_ptr () as * const c_char) ; table . get_license_text = (gd_api . godot_method_bind_get_method) (class_name , "get_license_text\0" . as_ptr () as * const c_char) ; table . get_main_loop = (gd_api . godot_method_bind_get_method) (class_name , "get_main_loop\0" . as_ptr () as * const c_char) ; table . get_physics_frames = (gd_api . godot_method_bind_get_method) (class_name , "get_physics_frames\0" . as_ptr () as * const c_char) ; table . get_physics_interpolation_fraction = (gd_api . godot_method_bind_get_method) (class_name , "get_physics_interpolation_fraction\0" . as_ptr () as * const c_char) ; table . get_physics_jitter_fix = (gd_api . godot_method_bind_get_method) (class_name , "get_physics_jitter_fix\0" . as_ptr () as * const c_char) ; table . get_singleton = (gd_api . godot_method_bind_get_method) (class_name , "get_singleton\0" . as_ptr () as * const c_char) ; table . get_target_fps = (gd_api . godot_method_bind_get_method) (class_name , "get_target_fps\0" . as_ptr () as * const c_char) ; table . get_time_scale = (gd_api . godot_method_bind_get_method) (class_name , "get_time_scale\0" . as_ptr () as * const c_char) ; table . get_version_info = (gd_api . godot_method_bind_get_method) (class_name , "get_version_info\0" . as_ptr () as * const c_char) ; table . has_singleton = (gd_api . godot_method_bind_get_method) (class_name , "has_singleton\0" . as_ptr () as * const c_char) ; table . is_editor_hint = (gd_api . godot_method_bind_get_method) (class_name , "is_editor_hint\0" . as_ptr () as * const c_char) ; table . is_in_physics_frame = (gd_api . godot_method_bind_get_method) (class_name , "is_in_physics_frame\0" . as_ptr () as * const c_char) ; table . set_editor_hint = (gd_api . godot_method_bind_get_method) (class_name , "set_editor_hint\0" . as_ptr () as * const c_char) ; table . set_iterations_per_second = (gd_api . godot_method_bind_get_method) (class_name , "set_iterations_per_second\0" . as_ptr () as * const c_char) ; table . set_physics_jitter_fix = (gd_api . godot_method_bind_get_method) (class_name , "set_physics_jitter_fix\0" . as_ptr () as * const c_char) ; table . set_target_fps = (gd_api . godot_method_bind_get_method) (class_name , "set_target_fps\0" . as_ptr () as * const c_char) ; table . set_time_scale = (gd_api . godot_method_bind_get_method) (class_name , "set_time_scale\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:364:4827 [INFO] [stdout] | [INFO] [stdout] 364 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 364 | # [doc = "`core class InputEventPanGesture` inherits `InputEventGesture` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_inputeventpangesture.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nInputEventPanGesture inherits methods from:\n - [InputEventGesture](struct.InputEventGesture.html)\n - [InputEventWithModifiers](struct.InputEventWithModifiers.html)\n - [InputEvent](struct.InputEvent.html)\n - [Resource](struct.Resource.html)\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct InputEventPanGesture { this : RawObject < Self > , } impl InputEventPanGesture { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = InputEventPanGestureMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = ""] # [doc = ""] # [inline] pub fn delta (& self) -> Vector2 { unsafe { let method_bind : * mut sys :: godot_method_bind = InputEventPanGestureMethodTable :: get (get_api ()) . get_delta ; let ret = crate :: icalls :: icallptr_vec2 (method_bind , self . this . sys () . as_ptr ()) ; mem :: transmute (ret) } } # [doc = ""] # [doc = ""] # [inline] pub fn set_delta (& self , delta : Vector2) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = InputEventPanGestureMethodTable :: get (get_api ()) . set_delta ; let ret = crate :: icalls :: icallptr_void_vec2 (method_bind , self . this . sys () . as_ptr () , delta) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for InputEventPanGesture { } unsafe impl GodotObject for InputEventPanGesture { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "InputEventPanGesture" } } impl std :: ops :: Deref for InputEventPanGesture { type Target = crate :: generated :: input_event_gesture :: InputEventGesture ; # [inline] fn deref (& self) -> & crate :: generated :: input_event_gesture :: InputEventGesture { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for InputEventPanGesture { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: input_event_gesture :: InputEventGesture { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: input_event_gesture :: InputEventGesture > for InputEventPanGesture { } unsafe impl SubClass < crate :: generated :: input_event_with_modifiers :: InputEventWithModifiers > for InputEventPanGesture { } unsafe impl SubClass < crate :: generated :: input_event :: InputEvent > for InputEventPanGesture { } unsafe impl SubClass < crate :: generated :: resource :: Resource > for InputEventPanGesture { } unsafe impl SubClass < crate :: generated :: reference :: Reference > for InputEventPanGesture { } unsafe impl SubClass < crate :: generated :: object :: Object > for InputEventPanGesture { } impl Instanciable for InputEventPanGesture { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { InputEventPanGesture :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct InputEventPanGestureMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_delta : * mut sys :: godot_method_bind , pub set_delta : * mut sys :: godot_method_bind } impl InputEventPanGestureMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : InputEventPanGestureMethodTable = InputEventPanGestureMethodTable { class_constructor : None , get_delta : 0 as * mut sys :: godot_method_bind , set_delta : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { InputEventPanGestureMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "InputEventPanGesture\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_delta = (gd_api . godot_method_bind_get_method) (class_name , "get_delta\0" . as_ptr () as * const c_char) ; table . set_delta = (gd_api . godot_method_bind_get_method) (class_name , "set_delta\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:370:4743 [INFO] [stdout] | [INFO] [stdout] 370 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 370 | # [doc = "`core class VisualScriptPreload` inherits `VisualScriptNode` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_visualscriptpreload.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nVisualScriptPreload inherits methods from:\n - [VisualScriptNode](struct.VisualScriptNode.html)\n - [Resource](struct.Resource.html)\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct VisualScriptPreload { this : RawObject < Self > , } impl VisualScriptPreload { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = VisualScriptPreloadMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = ""] # [doc = ""] # [inline] pub fn preload (& self) -> Option < Ref < crate :: generated :: resource :: Resource , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualScriptPreloadMethodTable :: get (get_api ()) . get_preload ; let ret = crate :: icalls :: icallptr_obj (method_bind , self . this . sys () . as_ptr ()) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: resource :: Resource , thread_access :: Shared >> :: move_from_sys (sys)) } } # [doc = ""] # [doc = ""] # [inline] pub fn set_preload (& self , resource : impl AsArg < crate :: generated :: resource :: Resource >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualScriptPreloadMethodTable :: get (get_api ()) . set_preload ; let ret = crate :: icalls :: icallptr_void_obj (method_bind , self . this . sys () . as_ptr () , resource . as_arg_ptr ()) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for VisualScriptPreload { } unsafe impl GodotObject for VisualScriptPreload { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "VisualScriptPreload" } } impl std :: ops :: Deref for VisualScriptPreload { type Target = crate :: generated :: visual_script_node :: VisualScriptNode ; # [inline] fn deref (& self) -> & crate :: generated :: visual_script_node :: VisualScriptNode { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for VisualScriptPreload { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: visual_script_node :: VisualScriptNode { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: visual_script_node :: VisualScriptNode > for VisualScriptPreload { } unsafe impl SubClass < crate :: generated :: resource :: Resource > for VisualScriptPreload { } unsafe impl SubClass < crate :: generated :: reference :: Reference > for VisualScriptPreload { } unsafe impl SubClass < crate :: generated :: object :: Object > for VisualScriptPreload { } impl Instanciable for VisualScriptPreload { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { VisualScriptPreload :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct VisualScriptPreloadMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_preload : * mut sys :: godot_method_bind , pub set_preload : * mut sys :: godot_method_bind } impl VisualScriptPreloadMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : VisualScriptPreloadMethodTable = VisualScriptPreloadMethodTable { class_constructor : None , get_preload : 0 as * mut sys :: godot_method_bind , set_preload : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { VisualScriptPreloadMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "VisualScriptPreload\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_preload = (gd_api . godot_method_bind_get_method) (class_name , "get_preload\0" . as_ptr () as * const c_char) ; table . set_preload = (gd_api . godot_method_bind_get_method) (class_name , "set_preload\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:376:5646 [INFO] [stdout] | [INFO] [stdout] 376 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 376 | # [doc = "`core class GridContainer` inherits `Container` (unsafe)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_gridcontainer.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nNon reference counted objects such as the ones of this type are usually owned by the engine.\n\n`GridContainer` is a reference-only type. Persistent references can\nonly exist in the unsafe `Ref` form.\n\nIn the cases where Rust code owns an object of this type, for example if the object was just\ncreated on the Rust side and not passed to the engine yet, ownership should be either given\nto the engine or the object must be manually destroyed using `Ref::free`, or `Ref::queue_free`\nif it is a `Node`."] # [doc = "\n## Class hierarchy\n\nGridContainer inherits methods from:\n - [Container](struct.Container.html)\n - [Control](struct.Control.html)\n - [CanvasItem](struct.CanvasItem.html)\n - [Node](struct.Node.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct GridContainer { this : RawObject < Self > , } impl GridContainer { # [doc = "Creates a new instance of this object.\n\nBecause this type is not reference counted, the lifetime of the returned object\nis *not* automatically managed.\n\nImmediately after creation, the object is owned by the caller, and can be\npassed to the engine (in which case the engine will be responsible for\ndestroying the object) or destroyed manually using `Ref::free`, or preferably\n`Ref::queue_free` if it is a `Node`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = GridContainerMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "The number of columns in the [GridContainer]. If modified, [GridContainer] reorders its Control-derived children to accommodate the new layout."] # [doc = ""] # [inline] pub fn columns (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = GridContainerMethodTable :: get (get_api ()) . get_columns ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "The number of columns in the [GridContainer]. If modified, [GridContainer] reorders its Control-derived children to accommodate the new layout."] # [doc = ""] # [inline] pub fn set_columns (& self , columns : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = GridContainerMethodTable :: get (get_api ()) . set_columns ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , columns) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for GridContainer { } unsafe impl GodotObject for GridContainer { type RefKind = ref_kind :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "GridContainer" } } impl QueueFree for GridContainer { # [inline] unsafe fn godot_queue_free (obj : * mut sys :: godot_object) { let method_bind : * mut sys :: godot_method_bind = crate :: generated :: node :: NodeMethodTable :: get (get_api ()) . queue_free ; crate :: icalls :: icallptr_void (method_bind , obj) } } impl std :: ops :: Deref for GridContainer { type Target = crate :: generated :: container :: Container ; # [inline] fn deref (& self) -> & crate :: generated :: container :: Container { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for GridContainer { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: container :: Container { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: container :: Container > for GridContainer { } unsafe impl SubClass < crate :: generated :: control :: Control > for GridContainer { } unsafe impl SubClass < crate :: generated :: canvas_item :: CanvasItem > for GridContainer { } unsafe impl SubClass < crate :: generated :: node :: Node > for GridContainer { } unsafe impl SubClass < crate :: generated :: object :: Object > for GridContainer { } impl Instanciable for GridContainer { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { GridContainer :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct GridContainerMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_columns : * mut sys :: godot_method_bind , pub set_columns : * mut sys :: godot_method_bind } impl GridContainerMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : GridContainerMethodTable = GridContainerMethodTable { class_constructor : None , get_columns : 0 as * mut sys :: godot_method_bind , set_columns : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { GridContainerMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "GridContainer\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_columns = (gd_api . godot_method_bind_get_method) (class_name , "get_columns\0" . as_ptr () as * const c_char) ; table . set_columns = (gd_api . godot_method_bind_get_method) (class_name , "set_columns\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:382:6281 [INFO] [stdout] | [INFO] [stdout] 382 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 382 | # [doc = "`core class TCP_Server` inherits `Reference` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_tcp_server.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nTCP_Server inherits methods from:\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct TCP_Server { this : RawObject < Self > , } impl TCP_Server { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = TCP_ServerMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "Returns `true` if a connection is available for taking."] # [doc = ""] # [inline] pub fn is_connection_available (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = TCP_ServerMethodTable :: get (get_api ()) . is_connection_available ; let ret = crate :: icalls :: icallptr_bool (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Returns `true` if the server is currently listening for connections."] # [doc = ""] # [inline] pub fn is_listening (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = TCP_ServerMethodTable :: get (get_api ()) . is_listening ; let ret = crate :: icalls :: icallptr_bool (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Listen on the `port` binding to `bind_address`.\nIf `bind_address` is set as `\"*\"` (default), the server will listen on all available addresses (both IPv4 and IPv6).\nIf `bind_address` is set as `\"0.0.0.0\"` (for IPv4) or `\"::\"` (for IPv6), the server will listen on all available addresses matching that IP type.\nIf `bind_address` is set to any valid address (e.g. `\"192.168.1.101\"`, `\"::1\"`, etc), the server will only listen on the interface with that addresses (or fail if no interface with the given address exists).\n# Default Arguments\n* `bind_address` - `\"*\"`"] # [doc = ""] # [inline] pub fn listen (& self , port : i64 , bind_address : impl Into < GodotString >) -> GodotResult { unsafe { let method_bind : * mut sys :: godot_method_bind = TCP_ServerMethodTable :: get (get_api ()) . listen ; let ret = crate :: icalls :: icallptr_i64_i64_str (method_bind , self . this . sys () . as_ptr () , port , bind_address . into ()) ; GodotError :: result_from_sys (ret as _) } } # [doc = "Stops listening."] # [doc = ""] # [inline] pub fn stop (& self) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = TCP_ServerMethodTable :: get (get_api ()) . stop ; let ret = crate :: icalls :: icallptr_void (method_bind , self . this . sys () . as_ptr ()) ; } } # [doc = "If a connection is available, returns a StreamPeerTCP with the connection."] # [doc = ""] # [inline] pub fn take_connection (& self) -> Option < Ref < crate :: generated :: stream_peer_tcp :: StreamPeerTCP , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = TCP_ServerMethodTable :: get (get_api ()) . take_connection ; let ret = crate :: icalls :: icallptr_obj (method_bind , self . this . sys () . as_ptr ()) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: stream_peer_tcp :: StreamPeerTCP , thread_access :: Shared >> :: move_from_sys (sys)) } } } impl gdnative_core :: private :: godot_object :: Sealed for TCP_Server { } unsafe impl GodotObject for TCP_Server { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "TCP_Server" } } impl std :: ops :: Deref for TCP_Server { type Target = crate :: generated :: reference :: Reference ; # [inline] fn deref (& self) -> & crate :: generated :: reference :: Reference { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for TCP_Server { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: reference :: Reference { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: reference :: Reference > for TCP_Server { } unsafe impl SubClass < crate :: generated :: object :: Object > for TCP_Server { } impl Instanciable for TCP_Server { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { TCP_Server :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct TCP_ServerMethodTable { pub class_constructor : sys :: godot_class_constructor , pub is_connection_available : * mut sys :: godot_method_bind , pub is_listening : * mut sys :: godot_method_bind , pub listen : * mut sys :: godot_method_bind , pub stop : * mut sys :: godot_method_bind , pub take_connection : * mut sys :: godot_method_bind } impl TCP_ServerMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : TCP_ServerMethodTable = TCP_ServerMethodTable { class_constructor : None , is_connection_available : 0 as * mut sys :: godot_method_bind , is_listening : 0 as * mut sys :: godot_method_bind , listen : 0 as * mut sys :: godot_method_bind , stop : 0 as * mut sys :: godot_method_bind , take_connection : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { TCP_ServerMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "TCP_Server\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . is_connection_available = (gd_api . godot_method_bind_get_method) (class_name , "is_connection_available\0" . as_ptr () as * const c_char) ; table . is_listening = (gd_api . godot_method_bind_get_method) (class_name , "is_listening\0" . as_ptr () as * const c_char) ; table . listen = (gd_api . godot_method_bind_get_method) (class_name , "listen\0" . as_ptr () as * const c_char) ; table . stop = (gd_api . godot_method_bind_get_method) (class_name , "stop\0" . as_ptr () as * const c_char) ; table . take_connection = (gd_api . godot_method_bind_get_method) (class_name , "take_connection\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:388:4806 [INFO] [stdout] | [INFO] [stdout] 388 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 388 | # [doc = "`core class VisualShaderNodeVec3Constant` inherits `VisualShaderNode` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_visualshadernodevec3constant.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nVisualShaderNodeVec3Constant inherits methods from:\n - [VisualShaderNode](struct.VisualShaderNode.html)\n - [Resource](struct.Resource.html)\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct VisualShaderNodeVec3Constant { this : RawObject < Self > , } impl VisualShaderNodeVec3Constant { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = VisualShaderNodeVec3ConstantMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "A [Vector3] constant which represents the state of this node."] # [doc = ""] # [inline] pub fn constant (& self) -> Vector3 { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualShaderNodeVec3ConstantMethodTable :: get (get_api ()) . get_constant ; let ret = crate :: icalls :: icallptr_vec3 (method_bind , self . this . sys () . as_ptr ()) ; mem :: transmute (ret) } } # [doc = "A [Vector3] constant which represents the state of this node."] # [doc = ""] # [inline] pub fn set_constant (& self , value : Vector3) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualShaderNodeVec3ConstantMethodTable :: get (get_api ()) . set_constant ; let ret = crate :: icalls :: icallptr_void_vec3 (method_bind , self . this . sys () . as_ptr () , value) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for VisualShaderNodeVec3Constant { } unsafe impl GodotObject for VisualShaderNodeVec3Constant { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "VisualShaderNodeVec3Constant" } } impl std :: ops :: Deref for VisualShaderNodeVec3Constant { type Target = crate :: generated :: visual_shader_node :: VisualShaderNode ; # [inline] fn deref (& self) -> & crate :: generated :: visual_shader_node :: VisualShaderNode { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for VisualShaderNodeVec3Constant { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: visual_shader_node :: VisualShaderNode { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: visual_shader_node :: VisualShaderNode > for VisualShaderNodeVec3Constant { } unsafe impl SubClass < crate :: generated :: resource :: Resource > for VisualShaderNodeVec3Constant { } unsafe impl SubClass < crate :: generated :: reference :: Reference > for VisualShaderNodeVec3Constant { } unsafe impl SubClass < crate :: generated :: object :: Object > for VisualShaderNodeVec3Constant { } impl Instanciable for VisualShaderNodeVec3Constant { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { VisualShaderNodeVec3Constant :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct VisualShaderNodeVec3ConstantMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_constant : * mut sys :: godot_method_bind , pub set_constant : * mut sys :: godot_method_bind } impl VisualShaderNodeVec3ConstantMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : VisualShaderNodeVec3ConstantMethodTable = VisualShaderNodeVec3ConstantMethodTable { class_constructor : None , get_constant : 0 as * mut sys :: godot_method_bind , set_constant : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { VisualShaderNodeVec3ConstantMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "VisualShaderNodeVec3Constant\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_constant = (gd_api . godot_method_bind_get_method) (class_name , "get_constant\0" . as_ptr () as * const c_char) ; table . set_constant = (gd_api . godot_method_bind_get_method) (class_name , "set_constant\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:394:7048 [INFO] [stdout] | [INFO] [stdout] 394 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 394 | # [doc = "`core class PacketPeerDTLS` inherits `PacketPeer` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_packetpeerdtls.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nPacketPeerDTLS inherits methods from:\n - [PacketPeer](struct.PacketPeer.html)\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct PacketPeerDTLS { this : RawObject < Self > , } # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct Status (pub i64) ; impl Status { pub const DISCONNECTED : Status = Status (0i64) ; pub const HANDSHAKING : Status = Status (1i64) ; pub const CONNECTED : Status = Status (2i64) ; pub const ERROR : Status = Status (3i64) ; pub const ERROR_HOSTNAME_MISMATCH : Status = Status (4i64) ; } impl From < i64 > for Status { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < Status > for i64 { # [inline] fn from (v : Status) -> Self { v . 0 } } # [doc = "Constants"] # [allow (non_upper_case_globals)] impl PacketPeerDTLS { pub const STATUS_CONNECTED : i64 = 2i64 ; pub const STATUS_DISCONNECTED : i64 = 0i64 ; pub const STATUS_ERROR : i64 = 3i64 ; pub const STATUS_ERROR_HOSTNAME_MISMATCH : i64 = 4i64 ; pub const STATUS_HANDSHAKING : i64 = 1i64 ; } impl PacketPeerDTLS { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = PacketPeerDTLSMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "Connects a `peer` beginning the DTLS handshake using the underlying [PacketPeerUDP] which must be connected (see [method PacketPeerUDP.connect_to_host]). If `validate_certs` is `true`, [PacketPeerDTLS] will validate that the certificate presented by the remote peer and match it with the `for_hostname` argument. You can specify a custom [X509Certificate] to use for validation via the `valid_certificate` argument.\n# Default Arguments\n* `validate_certs` - `true`\n* `for_hostname` - `\"\"`\n* `valid_certificate` - `null`"] # [doc = ""] # [inline] pub fn connect_to_peer (& self , packet_peer : impl AsArg < crate :: generated :: packet_peer_udp :: PacketPeerUDP > , validate_certs : bool , for_hostname : impl Into < GodotString > , valid_certificate : impl AsArg < crate :: generated :: x509_certificate :: X509Certificate >) -> GodotResult { unsafe { let method_bind : * mut sys :: godot_method_bind = PacketPeerDTLSMethodTable :: get (get_api ()) . connect_to_peer ; let ret = crate :: icalls :: icallptr_i64_obj_bool_str_obj (method_bind , self . this . sys () . as_ptr () , packet_peer . as_arg_ptr () , validate_certs , for_hostname . into () , valid_certificate . as_arg_ptr ()) ; GodotError :: result_from_sys (ret as _) } } # [doc = "Disconnects this peer, terminating the DTLS session."] # [doc = ""] # [inline] pub fn disconnect_from_peer (& self) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = PacketPeerDTLSMethodTable :: get (get_api ()) . disconnect_from_peer ; let ret = crate :: icalls :: icallptr_void (method_bind , self . this . sys () . as_ptr ()) ; } } # [doc = "Returns the status of the connection. See [enum Status] for values."] # [doc = ""] # [inline] pub fn get_status (& self) -> crate :: generated :: packet_peer_dtls :: Status { unsafe { let method_bind : * mut sys :: godot_method_bind = PacketPeerDTLSMethodTable :: get (get_api ()) . get_status ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; crate :: generated :: packet_peer_dtls :: Status (ret) } } # [doc = "Poll the connection to check for incoming packets. Call this frequently to update the status and keep the connection working."] # [doc = ""] # [inline] pub fn poll (& self) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = PacketPeerDTLSMethodTable :: get (get_api ()) . poll ; let ret = crate :: icalls :: icallptr_void (method_bind , self . this . sys () . as_ptr ()) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for PacketPeerDTLS { } unsafe impl GodotObject for PacketPeerDTLS { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "PacketPeerDTLS" } } impl std :: ops :: Deref for PacketPeerDTLS { type Target = crate :: generated :: packet_peer :: PacketPeer ; # [inline] fn deref (& self) -> & crate :: generated :: packet_peer :: PacketPeer { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for PacketPeerDTLS { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: packet_peer :: PacketPeer { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: packet_peer :: PacketPeer > for PacketPeerDTLS { } unsafe impl SubClass < crate :: generated :: reference :: Reference > for PacketPeerDTLS { } unsafe impl SubClass < crate :: generated :: object :: Object > for PacketPeerDTLS { } impl Instanciable for PacketPeerDTLS { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { PacketPeerDTLS :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct PacketPeerDTLSMethodTable { pub class_constructor : sys :: godot_class_constructor , pub connect_to_peer : * mut sys :: godot_method_bind , pub disconnect_from_peer : * mut sys :: godot_method_bind , pub get_status : * mut sys :: godot_method_bind , pub poll : * mut sys :: godot_method_bind } impl PacketPeerDTLSMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : PacketPeerDTLSMethodTable = PacketPeerDTLSMethodTable { class_constructor : None , connect_to_peer : 0 as * mut sys :: godot_method_bind , disconnect_from_peer : 0 as * mut sys :: godot_method_bind , get_status : 0 as * mut sys :: godot_method_bind , poll : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { PacketPeerDTLSMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "PacketPeerDTLS\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . connect_to_peer = (gd_api . godot_method_bind_get_method) (class_name , "connect_to_peer\0" . as_ptr () as * const c_char) ; table . disconnect_from_peer = (gd_api . godot_method_bind_get_method) (class_name , "disconnect_from_peer\0" . as_ptr () as * const c_char) ; table . get_status = (gd_api . godot_method_bind_get_method) (class_name , "get_status\0" . as_ptr () as * const c_char) ; table . poll = (gd_api . godot_method_bind_get_method) (class_name , "poll\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:400:3805 [INFO] [stdout] | [INFO] [stdout] 400 | ...thodTable { class_constructor : None , } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 400 | # [doc = "`core class VisualShaderNodeScalarInterp` inherits `VisualShaderNode` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_visualshadernodescalarinterp.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nVisualShaderNodeScalarInterp inherits methods from:\n - [VisualShaderNode](struct.VisualShaderNode.html)\n - [Resource](struct.Resource.html)\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct VisualShaderNodeScalarInterp { this : RawObject < Self > , } impl VisualShaderNodeScalarInterp { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = VisualShaderNodeScalarInterpMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } } impl gdnative_core :: private :: godot_object :: Sealed for VisualShaderNodeScalarInterp { } unsafe impl GodotObject for VisualShaderNodeScalarInterp { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "VisualShaderNodeScalarInterp" } } impl std :: ops :: Deref for VisualShaderNodeScalarInterp { type Target = crate :: generated :: visual_shader_node :: VisualShaderNode ; # [inline] fn deref (& self) -> & crate :: generated :: visual_shader_node :: VisualShaderNode { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for VisualShaderNodeScalarInterp { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: visual_shader_node :: VisualShaderNode { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: visual_shader_node :: VisualShaderNode > for VisualShaderNodeScalarInterp { } unsafe impl SubClass < crate :: generated :: resource :: Resource > for VisualShaderNodeScalarInterp { } unsafe impl SubClass < crate :: generated :: reference :: Reference > for VisualShaderNodeScalarInterp { } unsafe impl SubClass < crate :: generated :: object :: Object > for VisualShaderNodeScalarInterp { } impl Instanciable for VisualShaderNodeScalarInterp { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { VisualShaderNodeScalarInterp :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct VisualShaderNodeScalarInterpMethodTable { pub class_constructor : sys :: godot_class_constructor , } impl VisualShaderNodeScalarInterpMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : VisualShaderNodeScalarInterpMethodTable = VisualShaderNodeScalarInterpMethodTable { class_constructor : None , } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { VisualShaderNodeScalarInterpMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "VisualShaderNodeScalarInterp\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:406:30874 [INFO] [stdout] | [INFO] [stdout] 406 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 406 | # [doc = "`core class Area` inherits `CollisionObject` (unsafe)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_area.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nNon reference counted objects such as the ones of this type are usually owned by the engine.\n\n`Area` is a reference-only type. Persistent references can\nonly exist in the unsafe `Ref` form.\n\nIn the cases where Rust code owns an object of this type, for example if the object was just\ncreated on the Rust side and not passed to the engine yet, ownership should be either given\nto the engine or the object must be manually destroyed using `Ref::free`, or `Ref::queue_free`\nif it is a `Node`."] # [doc = "\n## Class hierarchy\n\nArea inherits methods from:\n - [CollisionObject](struct.CollisionObject.html)\n - [Spatial](struct.Spatial.html)\n - [Node](struct.Node.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct Area { this : RawObject < Self > , } # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct SpaceOverride (pub i64) ; impl SpaceOverride { pub const DISABLED : SpaceOverride = SpaceOverride (0i64) ; pub const COMBINE : SpaceOverride = SpaceOverride (1i64) ; pub const COMBINE_REPLACE : SpaceOverride = SpaceOverride (2i64) ; pub const REPLACE : SpaceOverride = SpaceOverride (3i64) ; pub const REPLACE_COMBINE : SpaceOverride = SpaceOverride (4i64) ; } impl From < i64 > for SpaceOverride { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < SpaceOverride > for i64 { # [inline] fn from (v : SpaceOverride) -> Self { v . 0 } } # [doc = "Constants"] # [allow (non_upper_case_globals)] impl Area { pub const SPACE_OVERRIDE_COMBINE : i64 = 1i64 ; pub const SPACE_OVERRIDE_COMBINE_REPLACE : i64 = 2i64 ; pub const SPACE_OVERRIDE_DISABLED : i64 = 0i64 ; pub const SPACE_OVERRIDE_REPLACE : i64 = 3i64 ; pub const SPACE_OVERRIDE_REPLACE_COMBINE : i64 = 4i64 ; } impl Area { # [doc = "Creates a new instance of this object.\n\nBecause this type is not reference counted, the lifetime of the returned object\nis *not* automatically managed.\n\nImmediately after creation, the object is owned by the caller, and can be\npassed to the engine (in which case the engine will be responsible for\ndestroying the object) or destroyed manually using `Ref::free`, or preferably\n`Ref::queue_free` if it is a `Node`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AreaMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "The rate at which objects stop spinning in this area. Represents the angular velocity lost per second. Values range from `0` (no damping) to `1` (full damping)."] # [doc = ""] # [inline] pub fn angular_damp (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AreaMethodTable :: get (get_api ()) . get_angular_damp ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "The name of the area's audio bus."] # [doc = ""] # [inline] pub fn audio_bus (& self) -> GodotString { unsafe { let method_bind : * mut sys :: godot_method_bind = AreaMethodTable :: get (get_api ()) . get_audio_bus ; let ret = crate :: icalls :: icallptr_str (method_bind , self . this . sys () . as_ptr ()) ; GodotString :: from_sys (ret) } } # [doc = "The area's physics layer(s). Collidable objects can exist in any of 32 different layers. A contact is detected if object A is in any of the layers that object B scans, or object B is in any layers that object A scans. See also [member collision_mask]. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information."] # [doc = ""] # [inline] pub fn collision_layer (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AreaMethodTable :: get (get_api ()) . get_collision_layer ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Returns an individual bit on the layer mask."] # [doc = ""] # [inline] pub fn get_collision_layer_bit (& self , bit : i64) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AreaMethodTable :: get (get_api ()) . get_collision_layer_bit ; let ret = crate :: icalls :: icallptr_bool_i64 (method_bind , self . this . sys () . as_ptr () , bit) ; ret as _ } } # [doc = "The physics layers this area scans to determine collision detection. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information."] # [doc = ""] # [inline] pub fn collision_mask (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AreaMethodTable :: get (get_api ()) . get_collision_mask ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Returns an individual bit on the collision mask."] # [doc = ""] # [inline] pub fn get_collision_mask_bit (& self , bit : i64) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AreaMethodTable :: get (get_api ()) . get_collision_mask_bit ; let ret = crate :: icalls :: icallptr_bool_i64 (method_bind , self . this . sys () . as_ptr () , bit) ; ret as _ } } # [doc = "The area's gravity intensity (ranges from -1024 to 1024). This value multiplies the gravity vector. This is useful to alter the force of gravity without altering its direction."] # [doc = ""] # [inline] pub fn gravity (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AreaMethodTable :: get (get_api ()) . get_gravity ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "The falloff factor for point gravity. The greater the value, the faster gravity decreases with distance."] # [doc = ""] # [inline] pub fn gravity_distance_scale (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AreaMethodTable :: get (get_api ()) . get_gravity_distance_scale ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "The area's gravity vector (not normalized). If gravity is a point (see [member gravity_point]), this will be the point of attraction."] # [doc = ""] # [inline] pub fn gravity_vector (& self) -> Vector3 { unsafe { let method_bind : * mut sys :: godot_method_bind = AreaMethodTable :: get (get_api ()) . get_gravity_vector ; let ret = crate :: icalls :: icallptr_vec3 (method_bind , self . this . sys () . as_ptr ()) ; mem :: transmute (ret) } } # [doc = "The rate at which objects stop moving in this area. Represents the linear velocity lost per second. Values range from `0` (no damping) to `1` (full damping)."] # [doc = ""] # [inline] pub fn linear_damp (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AreaMethodTable :: get (get_api ()) . get_linear_damp ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Returns a list of intersecting [Area]s. For performance reasons (collisions are all processed at the same time) this list is modified once during the physics step, not immediately after objects are moved. Consider using signals instead."] # [doc = ""] # [inline] pub fn get_overlapping_areas (& self) -> VariantArray { unsafe { let method_bind : * mut sys :: godot_method_bind = AreaMethodTable :: get (get_api ()) . get_overlapping_areas ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < VariantArray > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns a list of intersecting [PhysicsBody]s. For performance reasons (collisions are all processed at the same time) this list is modified once during the physics step, not immediately after objects are moved. Consider using signals instead."] # [doc = ""] # [inline] pub fn get_overlapping_bodies (& self) -> VariantArray { unsafe { let method_bind : * mut sys :: godot_method_bind = AreaMethodTable :: get (get_api ()) . get_overlapping_bodies ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < VariantArray > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "The area's priority. Higher priority areas are processed first."] # [doc = ""] # [inline] pub fn priority (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AreaMethodTable :: get (get_api ()) . get_priority ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "The degree to which this area applies reverb to its associated audio. Ranges from `0` to `1` with `0.1` precision."] # [doc = ""] # [inline] pub fn reverb_amount (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AreaMethodTable :: get (get_api ()) . get_reverb_amount ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "The reverb bus name to use for this area's associated audio."] # [doc = ""] # [inline] pub fn reverb_bus (& self) -> GodotString { unsafe { let method_bind : * mut sys :: godot_method_bind = AreaMethodTable :: get (get_api ()) . get_reverb_bus ; let ret = crate :: icalls :: icallptr_str (method_bind , self . this . sys () . as_ptr ()) ; GodotString :: from_sys (ret) } } # [doc = "The degree to which this area's reverb is a uniform effect. Ranges from `0` to `1` with `0.1` precision."] # [doc = ""] # [inline] pub fn reverb_uniformity (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AreaMethodTable :: get (get_api ()) . get_reverb_uniformity ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Override mode for gravity and damping calculations within this area. See [enum SpaceOverride] for possible values."] # [doc = ""] # [inline] pub fn space_override_mode (& self) -> crate :: generated :: area :: SpaceOverride { unsafe { let method_bind : * mut sys :: godot_method_bind = AreaMethodTable :: get (get_api ()) . get_space_override_mode ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; crate :: generated :: area :: SpaceOverride (ret) } } # [doc = "If `true`, gravity is calculated from a point (set via [member gravity_vec]). See also [member space_override]."] # [doc = ""] # [inline] pub fn is_gravity_a_point (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AreaMethodTable :: get (get_api ()) . is_gravity_a_point ; let ret = crate :: icalls :: icallptr_bool (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "If `true`, other monitoring areas can detect this area."] # [doc = ""] # [inline] pub fn is_monitorable (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AreaMethodTable :: get (get_api ()) . is_monitorable ; let ret = crate :: icalls :: icallptr_bool (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "If `true`, the area detects bodies or areas entering and exiting it."] # [doc = ""] # [inline] pub fn is_monitoring (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AreaMethodTable :: get (get_api ()) . is_monitoring ; let ret = crate :: icalls :: icallptr_bool (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "If `true`, the area's audio bus overrides the default audio bus."] # [doc = ""] # [inline] pub fn is_overriding_audio_bus (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AreaMethodTable :: get (get_api ()) . is_overriding_audio_bus ; let ret = crate :: icalls :: icallptr_bool (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "If `true`, the area applies reverb to its associated audio."] # [doc = ""] # [inline] pub fn is_using_reverb_bus (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AreaMethodTable :: get (get_api ()) . is_using_reverb_bus ; let ret = crate :: icalls :: icallptr_bool (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "If `true`, the given area overlaps the Area.\n**Note:** The result of this test is not immediate after moving objects. For performance, list of overlaps is updated once per frame and before the physics step. Consider using signals instead."] # [doc = ""] # [inline] pub fn overlaps_area (& self , area : impl AsArg < crate :: generated :: node :: Node >) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AreaMethodTable :: get (get_api ()) . overlaps_area ; let ret = crate :: icalls :: icallptr_bool_obj (method_bind , self . this . sys () . as_ptr () , area . as_arg_ptr ()) ; ret as _ } } # [doc = "If `true`, the given physics body overlaps the Area.\n**Note:** The result of this test is not immediate after moving objects. For performance, list of overlaps is updated once per frame and before the physics step. Consider using signals instead.\nThe `body` argument can either be a [PhysicsBody] or a [GridMap] instance (while GridMaps are not physics body themselves, they register their tiles with collision shapes as a virtual physics body)."] # [doc = ""] # [inline] pub fn overlaps_body (& self , body : impl AsArg < crate :: generated :: node :: Node >) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AreaMethodTable :: get (get_api ()) . overlaps_body ; let ret = crate :: icalls :: icallptr_bool_obj (method_bind , self . this . sys () . as_ptr () , body . as_arg_ptr ()) ; ret as _ } } # [doc = "The rate at which objects stop spinning in this area. Represents the angular velocity lost per second. Values range from `0` (no damping) to `1` (full damping)."] # [doc = ""] # [inline] pub fn set_angular_damp (& self , angular_damp : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AreaMethodTable :: get (get_api ()) . set_angular_damp ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , angular_damp) ; } } # [doc = "The name of the area's audio bus."] # [doc = ""] # [inline] pub fn set_audio_bus (& self , name : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AreaMethodTable :: get (get_api ()) . set_audio_bus ; let ret = crate :: icalls :: icallptr_void_str (method_bind , self . this . sys () . as_ptr () , name . into ()) ; } } # [doc = "If `true`, the area's audio bus overrides the default audio bus."] # [doc = ""] # [inline] pub fn set_audio_bus_override (& self , enable : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AreaMethodTable :: get (get_api ()) . set_audio_bus_override ; let ret = crate :: icalls :: icallptr_void_bool (method_bind , self . this . sys () . as_ptr () , enable) ; } } # [doc = "The area's physics layer(s). Collidable objects can exist in any of 32 different layers. A contact is detected if object A is in any of the layers that object B scans, or object B is in any layers that object A scans. See also [member collision_mask]. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information."] # [doc = ""] # [inline] pub fn set_collision_layer (& self , collision_layer : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AreaMethodTable :: get (get_api ()) . set_collision_layer ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , collision_layer) ; } } # [doc = "Set/clear individual bits on the layer mask. This simplifies editing this [Area]'s layers."] # [doc = ""] # [inline] pub fn set_collision_layer_bit (& self , bit : i64 , value : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AreaMethodTable :: get (get_api ()) . set_collision_layer_bit ; let ret = crate :: icalls :: icallptr_void_i64_bool (method_bind , self . this . sys () . as_ptr () , bit , value) ; } } # [doc = "The physics layers this area scans to determine collision detection. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information."] # [doc = ""] # [inline] pub fn set_collision_mask (& self , collision_mask : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AreaMethodTable :: get (get_api ()) . set_collision_mask ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , collision_mask) ; } } # [doc = "Set/clear individual bits on the collision mask. This simplifies editing which [Area] layers this [Area] scans."] # [doc = ""] # [inline] pub fn set_collision_mask_bit (& self , bit : i64 , value : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AreaMethodTable :: get (get_api ()) . set_collision_mask_bit ; let ret = crate :: icalls :: icallptr_void_i64_bool (method_bind , self . this . sys () . as_ptr () , bit , value) ; } } # [doc = "The area's gravity intensity (ranges from -1024 to 1024). This value multiplies the gravity vector. This is useful to alter the force of gravity without altering its direction."] # [doc = ""] # [inline] pub fn set_gravity (& self , gravity : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AreaMethodTable :: get (get_api ()) . set_gravity ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , gravity) ; } } # [doc = "The falloff factor for point gravity. The greater the value, the faster gravity decreases with distance."] # [doc = ""] # [inline] pub fn set_gravity_distance_scale (& self , distance_scale : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AreaMethodTable :: get (get_api ()) . set_gravity_distance_scale ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , distance_scale) ; } } # [doc = "If `true`, gravity is calculated from a point (set via [member gravity_vec]). See also [member space_override]."] # [doc = ""] # [inline] pub fn set_gravity_is_point (& self , enable : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AreaMethodTable :: get (get_api ()) . set_gravity_is_point ; let ret = crate :: icalls :: icallptr_void_bool (method_bind , self . this . sys () . as_ptr () , enable) ; } } # [doc = "The area's gravity vector (not normalized). If gravity is a point (see [member gravity_point]), this will be the point of attraction."] # [doc = ""] # [inline] pub fn set_gravity_vector (& self , vector : Vector3) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AreaMethodTable :: get (get_api ()) . set_gravity_vector ; let ret = crate :: icalls :: icallptr_void_vec3 (method_bind , self . this . sys () . as_ptr () , vector) ; } } # [doc = "The rate at which objects stop moving in this area. Represents the linear velocity lost per second. Values range from `0` (no damping) to `1` (full damping)."] # [doc = ""] # [inline] pub fn set_linear_damp (& self , linear_damp : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AreaMethodTable :: get (get_api ()) . set_linear_damp ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , linear_damp) ; } } # [doc = "If `true`, other monitoring areas can detect this area."] # [doc = ""] # [inline] pub fn set_monitorable (& self , enable : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AreaMethodTable :: get (get_api ()) . set_monitorable ; let ret = crate :: icalls :: icallptr_void_bool (method_bind , self . this . sys () . as_ptr () , enable) ; } } # [doc = "If `true`, the area detects bodies or areas entering and exiting it."] # [doc = ""] # [inline] pub fn set_monitoring (& self , enable : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AreaMethodTable :: get (get_api ()) . set_monitoring ; let ret = crate :: icalls :: icallptr_void_bool (method_bind , self . this . sys () . as_ptr () , enable) ; } } # [doc = "The area's priority. Higher priority areas are processed first."] # [doc = ""] # [inline] pub fn set_priority (& self , priority : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AreaMethodTable :: get (get_api ()) . set_priority ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , priority) ; } } # [doc = "The degree to which this area applies reverb to its associated audio. Ranges from `0` to `1` with `0.1` precision."] # [doc = ""] # [inline] pub fn set_reverb_amount (& self , amount : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AreaMethodTable :: get (get_api ()) . set_reverb_amount ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , amount) ; } } # [doc = "The reverb bus name to use for this area's associated audio."] # [doc = ""] # [inline] pub fn set_reverb_bus (& self , name : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AreaMethodTable :: get (get_api ()) . set_reverb_bus ; let ret = crate :: icalls :: icallptr_void_str (method_bind , self . this . sys () . as_ptr () , name . into ()) ; } } # [doc = "The degree to which this area's reverb is a uniform effect. Ranges from `0` to `1` with `0.1` precision."] # [doc = ""] # [inline] pub fn set_reverb_uniformity (& self , amount : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AreaMethodTable :: get (get_api ()) . set_reverb_uniformity ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , amount) ; } } # [doc = "Override mode for gravity and damping calculations within this area. See [enum SpaceOverride] for possible values."] # [doc = ""] # [inline] pub fn set_space_override_mode (& self , enable : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AreaMethodTable :: get (get_api ()) . set_space_override_mode ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , enable) ; } } # [doc = "If `true`, the area applies reverb to its associated audio."] # [doc = ""] # [inline] pub fn set_use_reverb_bus (& self , enable : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AreaMethodTable :: get (get_api ()) . set_use_reverb_bus ; let ret = crate :: icalls :: icallptr_void_bool (method_bind , self . this . sys () . as_ptr () , enable) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for Area { } unsafe impl GodotObject for Area { type RefKind = ref_kind :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "Area" } } impl QueueFree for Area { # [inline] unsafe fn godot_queue_free (obj : * mut sys :: godot_object) { let method_bind : * mut sys :: godot_method_bind = crate :: generated :: node :: NodeMethodTable :: get (get_api ()) . queue_free ; crate :: icalls :: icallptr_void (method_bind , obj) } } impl std :: ops :: Deref for Area { type Target = crate :: generated :: collision_object :: CollisionObject ; # [inline] fn deref (& self) -> & crate :: generated :: collision_object :: CollisionObject { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for Area { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: collision_object :: CollisionObject { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: collision_object :: CollisionObject > for Area { } unsafe impl SubClass < crate :: generated :: spatial :: Spatial > for Area { } unsafe impl SubClass < crate :: generated :: node :: Node > for Area { } unsafe impl SubClass < crate :: generated :: object :: Object > for Area { } impl Instanciable for Area { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { Area :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AreaMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_angular_damp : * mut sys :: godot_method_bind , pub get_audio_bus : * mut sys :: godot_method_bind , pub get_collision_layer : * mut sys :: godot_method_bind , pub get_collision_layer_bit : * mut sys :: godot_method_bind , pub get_collision_mask : * mut sys :: godot_method_bind , pub get_collision_mask_bit : * mut sys :: godot_method_bind , pub get_gravity : * mut sys :: godot_method_bind , pub get_gravity_distance_scale : * mut sys :: godot_method_bind , pub get_gravity_vector : * mut sys :: godot_method_bind , pub get_linear_damp : * mut sys :: godot_method_bind , pub get_overlapping_areas : * mut sys :: godot_method_bind , pub get_overlapping_bodies : * mut sys :: godot_method_bind , pub get_priority : * mut sys :: godot_method_bind , pub get_reverb_amount : * mut sys :: godot_method_bind , pub get_reverb_bus : * mut sys :: godot_method_bind , pub get_reverb_uniformity : * mut sys :: godot_method_bind , pub get_space_override_mode : * mut sys :: godot_method_bind , pub is_gravity_a_point : * mut sys :: godot_method_bind , pub is_monitorable : * mut sys :: godot_method_bind , pub is_monitoring : * mut sys :: godot_method_bind , pub is_overriding_audio_bus : * mut sys :: godot_method_bind , pub is_using_reverb_bus : * mut sys :: godot_method_bind , pub overlaps_area : * mut sys :: godot_method_bind , pub overlaps_body : * mut sys :: godot_method_bind , pub set_angular_damp : * mut sys :: godot_method_bind , pub set_audio_bus : * mut sys :: godot_method_bind , pub set_audio_bus_override : * mut sys :: godot_method_bind , pub set_collision_layer : * mut sys :: godot_method_bind , pub set_collision_layer_bit : * mut sys :: godot_method_bind , pub set_collision_mask : * mut sys :: godot_method_bind , pub set_collision_mask_bit : * mut sys :: godot_method_bind , pub set_gravity : * mut sys :: godot_method_bind , pub set_gravity_distance_scale : * mut sys :: godot_method_bind , pub set_gravity_is_point : * mut sys :: godot_method_bind , pub set_gravity_vector : * mut sys :: godot_method_bind , pub set_linear_damp : * mut sys :: godot_method_bind , pub set_monitorable : * mut sys :: godot_method_bind , pub set_monitoring : * mut sys :: godot_method_bind , pub set_priority : * mut sys :: godot_method_bind , pub set_reverb_amount : * mut sys :: godot_method_bind , pub set_reverb_bus : * mut sys :: godot_method_bind , pub set_reverb_uniformity : * mut sys :: godot_method_bind , pub set_space_override_mode : * mut sys :: godot_method_bind , pub set_use_reverb_bus : * mut sys :: godot_method_bind } impl AreaMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AreaMethodTable = AreaMethodTable { class_constructor : None , get_angular_damp : 0 as * mut sys :: godot_method_bind , get_audio_bus : 0 as * mut sys :: godot_method_bind , get_collision_layer : 0 as * mut sys :: godot_method_bind , get_collision_layer_bit : 0 as * mut sys :: godot_method_bind , get_collision_mask : 0 as * mut sys :: godot_method_bind , get_collision_mask_bit : 0 as * mut sys :: godot_method_bind , get_gravity : 0 as * mut sys :: godot_method_bind , get_gravity_distance_scale : 0 as * mut sys :: godot_method_bind , get_gravity_vector : 0 as * mut sys :: godot_method_bind , get_linear_damp : 0 as * mut sys :: godot_method_bind , get_overlapping_areas : 0 as * mut sys :: godot_method_bind , get_overlapping_bodies : 0 as * mut sys :: godot_method_bind , get_priority : 0 as * mut sys :: godot_method_bind , get_reverb_amount : 0 as * mut sys :: godot_method_bind , get_reverb_bus : 0 as * mut sys :: godot_method_bind , get_reverb_uniformity : 0 as * mut sys :: godot_method_bind , get_space_override_mode : 0 as * mut sys :: godot_method_bind , is_gravity_a_point : 0 as * mut sys :: godot_method_bind , is_monitorable : 0 as * mut sys :: godot_method_bind , is_monitoring : 0 as * mut sys :: godot_method_bind , is_overriding_audio_bus : 0 as * mut sys :: godot_method_bind , is_using_reverb_bus : 0 as * mut sys :: godot_method_bind , overlaps_area : 0 as * mut sys :: godot_method_bind , overlaps_body : 0 as * mut sys :: godot_method_bind , set_angular_damp : 0 as * mut sys :: godot_method_bind , set_audio_bus : 0 as * mut sys :: godot_method_bind , set_audio_bus_override : 0 as * mut sys :: godot_method_bind , set_collision_layer : 0 as * mut sys :: godot_method_bind , set_collision_layer_bit : 0 as * mut sys :: godot_method_bind , set_collision_mask : 0 as * mut sys :: godot_method_bind , set_collision_mask_bit : 0 as * mut sys :: godot_method_bind , set_gravity : 0 as * mut sys :: godot_method_bind , set_gravity_distance_scale : 0 as * mut sys :: godot_method_bind , set_gravity_is_point : 0 as * mut sys :: godot_method_bind , set_gravity_vector : 0 as * mut sys :: godot_method_bind , set_linear_damp : 0 as * mut sys :: godot_method_bind , set_monitorable : 0 as * mut sys :: godot_method_bind , set_monitoring : 0 as * mut sys :: godot_method_bind , set_priority : 0 as * mut sys :: godot_method_bind , set_reverb_amount : 0 as * mut sys :: godot_method_bind , set_reverb_bus : 0 as * mut sys :: godot_method_bind , set_reverb_uniformity : 0 as * mut sys :: godot_method_bind , set_space_override_mode : 0 as * mut sys :: godot_method_bind , set_use_reverb_bus : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { AreaMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "Area\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_angular_damp = (gd_api . godot_method_bind_get_method) (class_name , "get_angular_damp\0" . as_ptr () as * const c_char) ; table . get_audio_bus = (gd_api . godot_method_bind_get_method) (class_name , "get_audio_bus\0" . as_ptr () as * const c_char) ; table . get_collision_layer = (gd_api . godot_method_bind_get_method) (class_name , "get_collision_layer\0" . as_ptr () as * const c_char) ; table . get_collision_layer_bit = (gd_api . godot_method_bind_get_method) (class_name , "get_collision_layer_bit\0" . as_ptr () as * const c_char) ; table . get_collision_mask = (gd_api . godot_method_bind_get_method) (class_name , "get_collision_mask\0" . as_ptr () as * const c_char) ; table . get_collision_mask_bit = (gd_api . godot_method_bind_get_method) (class_name , "get_collision_mask_bit\0" . as_ptr () as * const c_char) ; table . get_gravity = (gd_api . godot_method_bind_get_method) (class_name , "get_gravity\0" . as_ptr () as * const c_char) ; table . get_gravity_distance_scale = (gd_api . godot_method_bind_get_method) (class_name , "get_gravity_distance_scale\0" . as_ptr () as * const c_char) ; table . get_gravity_vector = (gd_api . godot_method_bind_get_method) (class_name , "get_gravity_vector\0" . as_ptr () as * const c_char) ; table . get_linear_damp = (gd_api . godot_method_bind_get_method) (class_name , "get_linear_damp\0" . as_ptr () as * const c_char) ; table . get_overlapping_areas = (gd_api . godot_method_bind_get_method) (class_name , "get_overlapping_areas\0" . as_ptr () as * const c_char) ; table . get_overlapping_bodies = (gd_api . godot_method_bind_get_method) (class_name , "get_overlapping_bodies\0" . as_ptr () as * const c_char) ; table . get_priority = (gd_api . godot_method_bind_get_method) (class_name , "get_priority\0" . as_ptr () as * const c_char) ; table . get_reverb_amount = (gd_api . godot_method_bind_get_method) (class_name , "get_reverb_amount\0" . as_ptr () as * const c_char) ; table . get_reverb_bus = (gd_api . godot_method_bind_get_method) (class_name , "get_reverb_bus\0" . as_ptr () as * const c_char) ; table . get_reverb_uniformity = (gd_api . godot_method_bind_get_method) (class_name , "get_reverb_uniformity\0" . as_ptr () as * const c_char) ; table . get_space_override_mode = (gd_api . godot_method_bind_get_method) (class_name , "get_space_override_mode\0" . as_ptr () as * const c_char) ; table . is_gravity_a_point = (gd_api . godot_method_bind_get_method) (class_name , "is_gravity_a_point\0" . as_ptr () as * const c_char) ; table . is_monitorable = (gd_api . godot_method_bind_get_method) (class_name , "is_monitorable\0" . as_ptr () as * const c_char) ; table . is_monitoring = (gd_api . godot_method_bind_get_method) (class_name , "is_monitoring\0" . as_ptr () as * const c_char) ; table . is_overriding_audio_bus = (gd_api . godot_method_bind_get_method) (class_name , "is_overriding_audio_bus\0" . as_ptr () as * const c_char) ; table . is_using_reverb_bus = (gd_api . godot_method_bind_get_method) (class_name , "is_using_reverb_bus\0" . as_ptr () as * const c_char) ; table . overlaps_area = (gd_api . godot_method_bind_get_method) (class_name , "overlaps_area\0" . as_ptr () as * const c_char) ; table . overlaps_body = (gd_api . godot_method_bind_get_method) (class_name , "overlaps_body\0" . as_ptr () as * const c_char) ; table . set_angular_damp = (gd_api . godot_method_bind_get_method) (class_name , "set_angular_damp\0" . as_ptr () as * const c_char) ; table . set_audio_bus = (gd_api . godot_method_bind_get_method) (class_name , "set_audio_bus\0" . as_ptr () as * const c_char) ; table . set_audio_bus_override = (gd_api . godot_method_bind_get_method) (class_name , "set_audio_bus_override\0" . as_ptr () as * const c_char) ; table . set_collision_layer = (gd_api . godot_method_bind_get_method) (class_name , "set_collision_layer\0" . as_ptr () as * const c_char) ; table . set_collision_layer_bit = (gd_api . godot_method_bind_get_method) (class_name , "set_collision_layer_bit\0" . as_ptr () as * const c_char) ; table . set_collision_mask = (gd_api . godot_method_bind_get_method) (class_name , "set_collision_mask\0" . as_ptr () as * const c_char) ; table . set_collision_mask_bit = (gd_api . godot_method_bind_get_method) (class_name , "set_collision_mask_bit\0" . as_ptr () as * const c_char) ; table . set_gravity = (gd_api . godot_method_bind_get_method) (class_name , "set_gravity\0" . as_ptr () as * const c_char) ; table . set_gravity_distance_scale = (gd_api . godot_method_bind_get_method) (class_name , "set_gravity_distance_scale\0" . as_ptr () as * const c_char) ; table . set_gravity_is_point = (gd_api . godot_method_bind_get_method) (class_name , "set_gravity_is_point\0" . as_ptr () as * const c_char) ; table . set_gravity_vector = (gd_api . godot_method_bind_get_method) (class_name , "set_gravity_vector\0" . as_ptr () as * const c_char) ; table . set_linear_damp = (gd_api . godot_method_bind_get_method) (class_name , "set_linear_damp\0" . as_ptr () as * const c_char) ; table . set_monitorable = (gd_api . godot_method_bind_get_method) (class_name , "set_monitorable\0" . as_ptr () as * const c_char) ; table . set_monitoring = (gd_api . godot_method_bind_get_method) (class_name , "set_monitoring\0" . as_ptr () as * const c_char) ; table . set_priority = (gd_api . godot_method_bind_get_method) (class_name , "set_priority\0" . as_ptr () as * const c_char) ; table . set_reverb_amount = (gd_api . godot_method_bind_get_method) (class_name , "set_reverb_amount\0" . as_ptr () as * const c_char) ; table . set_reverb_bus = (gd_api . godot_method_bind_get_method) (class_name , "set_reverb_bus\0" . as_ptr () as * const c_char) ; table . set_reverb_uniformity = (gd_api . godot_method_bind_get_method) (class_name , "set_reverb_uniformity\0" . as_ptr () as * const c_char) ; table . set_space_override_mode = (gd_api . godot_method_bind_get_method) (class_name , "set_space_override_mode\0" . as_ptr () as * const c_char) ; table . set_use_reverb_bus = (gd_api . godot_method_bind_get_method) (class_name , "set_use_reverb_bus\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:412:9552 [INFO] [stdout] | [INFO] [stdout] 412 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 412 | # [doc = "`core singleton class IP` inherits `Object` (unsafe)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_ip.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = ""] # [doc = "\n## Class hierarchy\n\nIP inherits methods from:\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct IP { this : RawObject < Self > , } # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct ResolverStatus (pub i64) ; impl ResolverStatus { pub const NONE : ResolverStatus = ResolverStatus (0i64) ; pub const WAITING : ResolverStatus = ResolverStatus (1i64) ; pub const DONE : ResolverStatus = ResolverStatus (2i64) ; pub const ERROR : ResolverStatus = ResolverStatus (3i64) ; } impl From < i64 > for ResolverStatus { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < ResolverStatus > for i64 { # [inline] fn from (v : ResolverStatus) -> Self { v . 0 } } # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct Type (pub i64) ; impl Type { pub const NONE : Type = Type (0i64) ; pub const IPV4 : Type = Type (1i64) ; pub const IPV6 : Type = Type (2i64) ; pub const ANY : Type = Type (3i64) ; } impl From < i64 > for Type { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < Type > for i64 { # [inline] fn from (v : Type) -> Self { v . 0 } } # [doc = "Constants"] # [allow (non_upper_case_globals)] impl IP { pub const RESOLVER_INVALID_ID : i64 = - 1i64 ; pub const RESOLVER_MAX_QUERIES : i64 = 32i64 ; pub const RESOLVER_STATUS_DONE : i64 = 2i64 ; pub const RESOLVER_STATUS_ERROR : i64 = 3i64 ; pub const RESOLVER_STATUS_NONE : i64 = 0i64 ; pub const RESOLVER_STATUS_WAITING : i64 = 1i64 ; pub const TYPE_ANY : i64 = 3i64 ; pub const TYPE_IPV4 : i64 = 1i64 ; pub const TYPE_IPV6 : i64 = 2i64 ; pub const TYPE_NONE : i64 = 0i64 ; } impl IP { # [doc = "Returns a reference to the singleton instance."] # [inline] pub fn godot_singleton () -> & 'static Self { unsafe { let this = (get_api () . godot_global_get_singleton) ("IP\0" . as_ptr () as * mut _) ; let this = ptr :: NonNull :: new (this) . expect ("singleton should not be null") ; let this = RawObject :: from_sys_ref_unchecked :: < 'static > (this) ; Self :: cast_ref (this) } } # [doc = "Removes all of a `hostname`'s cached references. If no `hostname` is given, all cached IP addresses are removed.\n# Default Arguments\n* `hostname` - `\"\"`"] # [doc = ""] # [inline] pub fn clear_cache (& self , hostname : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = IPMethodTable :: get (get_api ()) . clear_cache ; let ret = crate :: icalls :: icallptr_void_str (method_bind , self . this . sys () . as_ptr () , hostname . into ()) ; } } # [doc = "Removes a given item `id` from the queue. This should be used to free a queue after it has completed to enable more queries to happen."] # [doc = ""] # [inline] pub fn erase_resolve_item (& self , id : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = IPMethodTable :: get (get_api ()) . erase_resolve_item ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , id) ; } } # [doc = "Returns all of the user's current IPv4 and IPv6 addresses as an array."] # [doc = ""] # [inline] pub fn get_local_addresses (& self) -> VariantArray { unsafe { let method_bind : * mut sys :: godot_method_bind = IPMethodTable :: get (get_api ()) . get_local_addresses ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < VariantArray > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "_Sample code is GDScript unless otherwise noted._\n\nReturns all network adapters as an array.\nEach adapter is a dictionary of the form:\n```gdscript\n{\n \"index\": \"1\", # Interface index.\n \"name\": \"eth0\", # Interface name.\n \"friendly\": \"Ethernet One\", # A friendly name (might be empty).\n \"addresses\": [\"192.168.1.101\"], # An array of IP addresses associated to this interface.\n}\n```"] # [doc = ""] # [inline] pub fn get_local_interfaces (& self) -> VariantArray { unsafe { let method_bind : * mut sys :: godot_method_bind = IPMethodTable :: get (get_api ()) . get_local_interfaces ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < VariantArray > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns a queued hostname's IP address, given its queue `id`. Returns an empty string on error or if resolution hasn't happened yet (see [method get_resolve_item_status])."] # [doc = ""] # [inline] pub fn get_resolve_item_address (& self , id : i64) -> GodotString { unsafe { let method_bind : * mut sys :: godot_method_bind = IPMethodTable :: get (get_api ()) . get_resolve_item_address ; let ret = crate :: icalls :: icallptr_str_i64 (method_bind , self . this . sys () . as_ptr () , id) ; GodotString :: from_sys (ret) } } # [doc = "Returns a queued hostname's status as a [enum ResolverStatus] constant, given its queue `id`."] # [doc = ""] # [inline] pub fn get_resolve_item_status (& self , id : i64) -> crate :: generated :: ip :: ResolverStatus { unsafe { let method_bind : * mut sys :: godot_method_bind = IPMethodTable :: get (get_api ()) . get_resolve_item_status ; let ret = crate :: icalls :: icallptr_i64_i64 (method_bind , self . this . sys () . as_ptr () , id) ; crate :: generated :: ip :: ResolverStatus (ret) } } # [doc = "Returns a given hostname's IPv4 or IPv6 address when resolved (blocking-type method). The address type returned depends on the [enum Type] constant given as `ip_type`.\n# Default Arguments\n* `ip_type` - `3`"] # [doc = ""] # [inline] pub fn resolve_hostname (& self , host : impl Into < GodotString > , ip_type : i64) -> GodotString { unsafe { let method_bind : * mut sys :: godot_method_bind = IPMethodTable :: get (get_api ()) . resolve_hostname ; let ret = crate :: icalls :: icallptr_str_str_i64 (method_bind , self . this . sys () . as_ptr () , host . into () , ip_type) ; GodotString :: from_sys (ret) } } # [doc = "Creates a queue item to resolve a hostname to an IPv4 or IPv6 address depending on the [enum Type] constant given as `ip_type`. Returns the queue ID if successful, or [constant RESOLVER_INVALID_ID] on error.\n# Default Arguments\n* `ip_type` - `3`"] # [doc = ""] # [inline] pub fn resolve_hostname_queue_item (& self , host : impl Into < GodotString > , ip_type : i64) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = IPMethodTable :: get (get_api ()) . resolve_hostname_queue_item ; let ret = crate :: icalls :: icallptr_i64_str_i64 (method_bind , self . this . sys () . as_ptr () , host . into () , ip_type) ; ret as _ } } } impl gdnative_core :: private :: godot_object :: Sealed for IP { } unsafe impl GodotObject for IP { type RefKind = ref_kind :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "IP" } } impl std :: ops :: Deref for IP { type Target = crate :: generated :: object :: Object ; # [inline] fn deref (& self) -> & crate :: generated :: object :: Object { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for IP { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: object :: Object { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: object :: Object > for IP { } unsafe impl Send for IP { } unsafe impl Sync for IP { } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct IPMethodTable { pub class_constructor : sys :: godot_class_constructor , pub clear_cache : * mut sys :: godot_method_bind , pub erase_resolve_item : * mut sys :: godot_method_bind , pub get_local_addresses : * mut sys :: godot_method_bind , pub get_local_interfaces : * mut sys :: godot_method_bind , pub get_resolve_item_address : * mut sys :: godot_method_bind , pub get_resolve_item_status : * mut sys :: godot_method_bind , pub resolve_hostname : * mut sys :: godot_method_bind , pub resolve_hostname_queue_item : * mut sys :: godot_method_bind } impl IPMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : IPMethodTable = IPMethodTable { class_constructor : None , clear_cache : 0 as * mut sys :: godot_method_bind , erase_resolve_item : 0 as * mut sys :: godot_method_bind , get_local_addresses : 0 as * mut sys :: godot_method_bind , get_local_interfaces : 0 as * mut sys :: godot_method_bind , get_resolve_item_address : 0 as * mut sys :: godot_method_bind , get_resolve_item_status : 0 as * mut sys :: godot_method_bind , resolve_hostname : 0 as * mut sys :: godot_method_bind , resolve_hostname_queue_item : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { IPMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "IP\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . clear_cache = (gd_api . godot_method_bind_get_method) (class_name , "clear_cache\0" . as_ptr () as * const c_char) ; table . erase_resolve_item = (gd_api . godot_method_bind_get_method) (class_name , "erase_resolve_item\0" . as_ptr () as * const c_char) ; table . get_local_addresses = (gd_api . godot_method_bind_get_method) (class_name , "get_local_addresses\0" . as_ptr () as * const c_char) ; table . get_local_interfaces = (gd_api . godot_method_bind_get_method) (class_name , "get_local_interfaces\0" . as_ptr () as * const c_char) ; table . get_resolve_item_address = (gd_api . godot_method_bind_get_method) (class_name , "get_resolve_item_address\0" . as_ptr () as * const c_char) ; table . get_resolve_item_status = (gd_api . godot_method_bind_get_method) (class_name , "get_resolve_item_status\0" . as_ptr () as * const c_char) ; table . resolve_hostname = (gd_api . godot_method_bind_get_method) (class_name , "resolve_hostname\0" . as_ptr () as * const c_char) ; table . resolve_hostname_queue_item = (gd_api . godot_method_bind_get_method) (class_name , "resolve_hostname_queue_item\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:418:6088 [INFO] [stdout] | [INFO] [stdout] 418 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 418 | # [doc = "`core class MultiMeshInstance` inherits `GeometryInstance` (unsafe)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_multimeshinstance.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nNon reference counted objects such as the ones of this type are usually owned by the engine.\n\n`MultiMeshInstance` is a reference-only type. Persistent references can\nonly exist in the unsafe `Ref` form.\n\nIn the cases where Rust code owns an object of this type, for example if the object was just\ncreated on the Rust side and not passed to the engine yet, ownership should be either given\nto the engine or the object must be manually destroyed using `Ref::free`, or `Ref::queue_free`\nif it is a `Node`."] # [doc = "\n## Class hierarchy\n\nMultiMeshInstance inherits methods from:\n - [GeometryInstance](struct.GeometryInstance.html)\n - [VisualInstance](struct.VisualInstance.html)\n - [Spatial](struct.Spatial.html)\n - [Node](struct.Node.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct MultiMeshInstance { this : RawObject < Self > , } impl MultiMeshInstance { # [doc = "Creates a new instance of this object.\n\nBecause this type is not reference counted, the lifetime of the returned object\nis *not* automatically managed.\n\nImmediately after creation, the object is owned by the caller, and can be\npassed to the engine (in which case the engine will be responsible for\ndestroying the object) or destroyed manually using `Ref::free`, or preferably\n`Ref::queue_free` if it is a `Node`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = MultiMeshInstanceMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "The [MultiMesh] resource that will be used and shared among all instances of the [MultiMeshInstance]."] # [doc = ""] # [inline] pub fn multimesh (& self) -> Option < Ref < crate :: generated :: multi_mesh :: MultiMesh , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = MultiMeshInstanceMethodTable :: get (get_api ()) . get_multimesh ; let ret = crate :: icalls :: icallptr_obj (method_bind , self . this . sys () . as_ptr ()) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: multi_mesh :: MultiMesh , thread_access :: Shared >> :: move_from_sys (sys)) } } # [doc = "The [MultiMesh] resource that will be used and shared among all instances of the [MultiMeshInstance]."] # [doc = ""] # [inline] pub fn set_multimesh (& self , multimesh : impl AsArg < crate :: generated :: multi_mesh :: MultiMesh >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = MultiMeshInstanceMethodTable :: get (get_api ()) . set_multimesh ; let ret = crate :: icalls :: icallptr_void_obj (method_bind , self . this . sys () . as_ptr () , multimesh . as_arg_ptr ()) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for MultiMeshInstance { } unsafe impl GodotObject for MultiMeshInstance { type RefKind = ref_kind :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "MultiMeshInstance" } } impl QueueFree for MultiMeshInstance { # [inline] unsafe fn godot_queue_free (obj : * mut sys :: godot_object) { let method_bind : * mut sys :: godot_method_bind = crate :: generated :: node :: NodeMethodTable :: get (get_api ()) . queue_free ; crate :: icalls :: icallptr_void (method_bind , obj) } } impl std :: ops :: Deref for MultiMeshInstance { type Target = crate :: generated :: geometry_instance :: GeometryInstance ; # [inline] fn deref (& self) -> & crate :: generated :: geometry_instance :: GeometryInstance { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for MultiMeshInstance { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: geometry_instance :: GeometryInstance { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: geometry_instance :: GeometryInstance > for MultiMeshInstance { } unsafe impl SubClass < crate :: generated :: visual_instance :: VisualInstance > for MultiMeshInstance { } unsafe impl SubClass < crate :: generated :: spatial :: Spatial > for MultiMeshInstance { } unsafe impl SubClass < crate :: generated :: node :: Node > for MultiMeshInstance { } unsafe impl SubClass < crate :: generated :: object :: Object > for MultiMeshInstance { } impl Instanciable for MultiMeshInstance { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { MultiMeshInstance :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct MultiMeshInstanceMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_multimesh : * mut sys :: godot_method_bind , pub set_multimesh : * mut sys :: godot_method_bind } impl MultiMeshInstanceMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : MultiMeshInstanceMethodTable = MultiMeshInstanceMethodTable { class_constructor : None , get_multimesh : 0 as * mut sys :: godot_method_bind , set_multimesh : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { MultiMeshInstanceMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "MultiMeshInstance\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_multimesh = (gd_api . godot_method_bind_get_method) (class_name , "get_multimesh\0" . as_ptr () as * const c_char) ; table . set_multimesh = (gd_api . godot_method_bind_get_method) (class_name , "set_multimesh\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:4:8780 [INFO] [stdout] | [INFO] [stdout] 4 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] = note: `#[warn(static_mut_refs)]` on by default [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 4 | # [doc = "`core class AudioEffectPhaser` inherits `AudioEffect` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_audioeffectphaser.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nAudioEffectPhaser inherits methods from:\n - [AudioEffect](struct.AudioEffect.html)\n - [Resource](struct.Resource.html)\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct AudioEffectPhaser { this : RawObject < Self > , } impl AudioEffectPhaser { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AudioEffectPhaserMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "Governs how high the filter frequencies sweep. Low value will primarily affect bass frequencies. High value can sweep high into the treble. Value can range from 0.1 to 4."] # [doc = ""] # [inline] pub fn depth (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectPhaserMethodTable :: get (get_api ()) . get_depth ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Output percent of modified sound. Value can range from 0.1 to 0.9."] # [doc = ""] # [inline] pub fn feedback (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectPhaserMethodTable :: get (get_api ()) . get_feedback ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Determines the maximum frequency affected by the LFO modulations, in Hz. Value can range from 10 to 10000."] # [doc = ""] # [inline] pub fn range_max_hz (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectPhaserMethodTable :: get (get_api ()) . get_range_max_hz ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Determines the minimum frequency affected by the LFO modulations, in Hz. Value can range from 10 to 10000."] # [doc = ""] # [inline] pub fn range_min_hz (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectPhaserMethodTable :: get (get_api ()) . get_range_min_hz ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Adjusts the rate in Hz at which the effect sweeps up and down across the frequency range."] # [doc = ""] # [inline] pub fn rate_hz (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectPhaserMethodTable :: get (get_api ()) . get_rate_hz ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Governs how high the filter frequencies sweep. Low value will primarily affect bass frequencies. High value can sweep high into the treble. Value can range from 0.1 to 4."] # [doc = ""] # [inline] pub fn set_depth (& self , depth : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectPhaserMethodTable :: get (get_api ()) . set_depth ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , depth) ; } } # [doc = "Output percent of modified sound. Value can range from 0.1 to 0.9."] # [doc = ""] # [inline] pub fn set_feedback (& self , fbk : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectPhaserMethodTable :: get (get_api ()) . set_feedback ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , fbk) ; } } # [doc = "Determines the maximum frequency affected by the LFO modulations, in Hz. Value can range from 10 to 10000."] # [doc = ""] # [inline] pub fn set_range_max_hz (& self , hz : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectPhaserMethodTable :: get (get_api ()) . set_range_max_hz ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , hz) ; } } # [doc = "Determines the minimum frequency affected by the LFO modulations, in Hz. Value can range from 10 to 10000."] # [doc = ""] # [inline] pub fn set_range_min_hz (& self , hz : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectPhaserMethodTable :: get (get_api ()) . set_range_min_hz ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , hz) ; } } # [doc = "Adjusts the rate in Hz at which the effect sweeps up and down across the frequency range."] # [doc = ""] # [inline] pub fn set_rate_hz (& self , hz : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectPhaserMethodTable :: get (get_api ()) . set_rate_hz ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , hz) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for AudioEffectPhaser { } unsafe impl GodotObject for AudioEffectPhaser { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AudioEffectPhaser" } } impl std :: ops :: Deref for AudioEffectPhaser { type Target = crate :: generated :: audio_effect :: AudioEffect ; # [inline] fn deref (& self) -> & crate :: generated :: audio_effect :: AudioEffect { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AudioEffectPhaser { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: audio_effect :: AudioEffect { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: audio_effect :: AudioEffect > for AudioEffectPhaser { } unsafe impl SubClass < crate :: generated :: resource :: Resource > for AudioEffectPhaser { } unsafe impl SubClass < crate :: generated :: reference :: Reference > for AudioEffectPhaser { } unsafe impl SubClass < crate :: generated :: object :: Object > for AudioEffectPhaser { } impl Instanciable for AudioEffectPhaser { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { AudioEffectPhaser :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AudioEffectPhaserMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_depth : * mut sys :: godot_method_bind , pub get_feedback : * mut sys :: godot_method_bind , pub get_range_max_hz : * mut sys :: godot_method_bind , pub get_range_min_hz : * mut sys :: godot_method_bind , pub get_rate_hz : * mut sys :: godot_method_bind , pub set_depth : * mut sys :: godot_method_bind , pub set_feedback : * mut sys :: godot_method_bind , pub set_range_max_hz : * mut sys :: godot_method_bind , pub set_range_min_hz : * mut sys :: godot_method_bind , pub set_rate_hz : * mut sys :: godot_method_bind } impl AudioEffectPhaserMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AudioEffectPhaserMethodTable = AudioEffectPhaserMethodTable { class_constructor : None , get_depth : 0 as * mut sys :: godot_method_bind , get_feedback : 0 as * mut sys :: godot_method_bind , get_range_max_hz : 0 as * mut sys :: godot_method_bind , get_range_min_hz : 0 as * mut sys :: godot_method_bind , get_rate_hz : 0 as * mut sys :: godot_method_bind , set_depth : 0 as * mut sys :: godot_method_bind , set_feedback : 0 as * mut sys :: godot_method_bind , set_range_max_hz : 0 as * mut sys :: godot_method_bind , set_range_min_hz : 0 as * mut sys :: godot_method_bind , set_rate_hz : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { AudioEffectPhaserMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AudioEffectPhaser\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_depth = (gd_api . godot_method_bind_get_method) (class_name , "get_depth\0" . as_ptr () as * const c_char) ; table . get_feedback = (gd_api . godot_method_bind_get_method) (class_name , "get_feedback\0" . as_ptr () as * const c_char) ; table . get_range_max_hz = (gd_api . godot_method_bind_get_method) (class_name , "get_range_max_hz\0" . as_ptr () as * const c_char) ; table . get_range_min_hz = (gd_api . godot_method_bind_get_method) (class_name , "get_range_min_hz\0" . as_ptr () as * const c_char) ; table . get_rate_hz = (gd_api . godot_method_bind_get_method) (class_name , "get_rate_hz\0" . as_ptr () as * const c_char) ; table . set_depth = (gd_api . godot_method_bind_get_method) (class_name , "set_depth\0" . as_ptr () as * const c_char) ; table . set_feedback = (gd_api . godot_method_bind_get_method) (class_name , "set_feedback\0" . as_ptr () as * const c_char) ; table . set_range_max_hz = (gd_api . godot_method_bind_get_method) (class_name , "set_range_max_hz\0" . as_ptr () as * const c_char) ; table . set_range_min_hz = (gd_api . godot_method_bind_get_method) (class_name , "set_range_min_hz\0" . as_ptr () as * const c_char) ; table . set_rate_hz = (gd_api . godot_method_bind_get_method) (class_name , "set_rate_hz\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:424:8140 [INFO] [stdout] | [INFO] [stdout] 424 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 424 | # [doc = "`core class ProximityGroup` inherits `Spatial` (unsafe)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_proximitygroup.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nNon reference counted objects such as the ones of this type are usually owned by the engine.\n\n`ProximityGroup` is a reference-only type. Persistent references can\nonly exist in the unsafe `Ref` form.\n\nIn the cases where Rust code owns an object of this type, for example if the object was just\ncreated on the Rust side and not passed to the engine yet, ownership should be either given\nto the engine or the object must be manually destroyed using `Ref::free`, or `Ref::queue_free`\nif it is a `Node`."] # [doc = "\n## Class hierarchy\n\nProximityGroup inherits methods from:\n - [Spatial](struct.Spatial.html)\n - [Node](struct.Node.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct ProximityGroup { this : RawObject < Self > , } # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct DispatchMode (pub i64) ; impl DispatchMode { pub const PROXY : DispatchMode = DispatchMode (0i64) ; pub const SIGNAL : DispatchMode = DispatchMode (1i64) ; } impl From < i64 > for DispatchMode { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < DispatchMode > for i64 { # [inline] fn from (v : DispatchMode) -> Self { v . 0 } } # [doc = "Constants"] # [allow (non_upper_case_globals)] impl ProximityGroup { pub const MODE_PROXY : i64 = 0i64 ; pub const MODE_SIGNAL : i64 = 1i64 ; } impl ProximityGroup { # [doc = "Creates a new instance of this object.\n\nBecause this type is not reference counted, the lifetime of the returned object\nis *not* automatically managed.\n\nImmediately after creation, the object is owned by the caller, and can be\npassed to the engine (in which case the engine will be responsible for\ndestroying the object) or destroyed manually using `Ref::free`, or preferably\n`Ref::queue_free` if it is a `Node`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = ProximityGroupMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = ""] # [doc = ""] # [inline] pub fn broadcast (& self , method : impl Into < GodotString > , parameters : impl OwnedToVariant) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = ProximityGroupMethodTable :: get (get_api ()) . broadcast ; let ret = crate :: icalls :: icallptr_void_str_var (method_bind , self . this . sys () . as_ptr () , method . into () , parameters . owned_to_variant ()) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn dispatch_mode (& self) -> crate :: generated :: proximity_group :: DispatchMode { unsafe { let method_bind : * mut sys :: godot_method_bind = ProximityGroupMethodTable :: get (get_api ()) . get_dispatch_mode ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; crate :: generated :: proximity_group :: DispatchMode (ret) } } # [doc = ""] # [doc = ""] # [inline] pub fn grid_radius (& self) -> Vector3 { unsafe { let method_bind : * mut sys :: godot_method_bind = ProximityGroupMethodTable :: get (get_api ()) . get_grid_radius ; let ret = crate :: icalls :: icallptr_vec3 (method_bind , self . this . sys () . as_ptr ()) ; mem :: transmute (ret) } } # [doc = ""] # [doc = ""] # [inline] pub fn group_name (& self) -> GodotString { unsafe { let method_bind : * mut sys :: godot_method_bind = ProximityGroupMethodTable :: get (get_api ()) . get_group_name ; let ret = crate :: icalls :: icallptr_str (method_bind , self . this . sys () . as_ptr ()) ; GodotString :: from_sys (ret) } } # [doc = ""] # [doc = ""] # [inline] pub fn set_dispatch_mode (& self , mode : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = ProximityGroupMethodTable :: get (get_api ()) . set_dispatch_mode ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , mode) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn set_grid_radius (& self , radius : Vector3) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = ProximityGroupMethodTable :: get (get_api ()) . set_grid_radius ; let ret = crate :: icalls :: icallptr_void_vec3 (method_bind , self . this . sys () . as_ptr () , radius) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn set_group_name (& self , name : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = ProximityGroupMethodTable :: get (get_api ()) . set_group_name ; let ret = crate :: icalls :: icallptr_void_str (method_bind , self . this . sys () . as_ptr () , name . into ()) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for ProximityGroup { } unsafe impl GodotObject for ProximityGroup { type RefKind = ref_kind :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "ProximityGroup" } } impl QueueFree for ProximityGroup { # [inline] unsafe fn godot_queue_free (obj : * mut sys :: godot_object) { let method_bind : * mut sys :: godot_method_bind = crate :: generated :: node :: NodeMethodTable :: get (get_api ()) . queue_free ; crate :: icalls :: icallptr_void (method_bind , obj) } } impl std :: ops :: Deref for ProximityGroup { type Target = crate :: generated :: spatial :: Spatial ; # [inline] fn deref (& self) -> & crate :: generated :: spatial :: Spatial { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for ProximityGroup { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: spatial :: Spatial { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: spatial :: Spatial > for ProximityGroup { } unsafe impl SubClass < crate :: generated :: node :: Node > for ProximityGroup { } unsafe impl SubClass < crate :: generated :: object :: Object > for ProximityGroup { } impl Instanciable for ProximityGroup { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { ProximityGroup :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct ProximityGroupMethodTable { pub class_constructor : sys :: godot_class_constructor , pub broadcast : * mut sys :: godot_method_bind , pub get_dispatch_mode : * mut sys :: godot_method_bind , pub get_grid_radius : * mut sys :: godot_method_bind , pub get_group_name : * mut sys :: godot_method_bind , pub set_dispatch_mode : * mut sys :: godot_method_bind , pub set_grid_radius : * mut sys :: godot_method_bind , pub set_group_name : * mut sys :: godot_method_bind } impl ProximityGroupMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : ProximityGroupMethodTable = ProximityGroupMethodTable { class_constructor : None , broadcast : 0 as * mut sys :: godot_method_bind , get_dispatch_mode : 0 as * mut sys :: godot_method_bind , get_grid_radius : 0 as * mut sys :: godot_method_bind , get_group_name : 0 as * mut sys :: godot_method_bind , set_dispatch_mode : 0 as * mut sys :: godot_method_bind , set_grid_radius : 0 as * mut sys :: godot_method_bind , set_group_name : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { ProximityGroupMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "ProximityGroup\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . broadcast = (gd_api . godot_method_bind_get_method) (class_name , "broadcast\0" . as_ptr () as * const c_char) ; table . get_dispatch_mode = (gd_api . godot_method_bind_get_method) (class_name , "get_dispatch_mode\0" . as_ptr () as * const c_char) ; table . get_grid_radius = (gd_api . godot_method_bind_get_method) (class_name , "get_grid_radius\0" . as_ptr () as * const c_char) ; table . get_group_name = (gd_api . godot_method_bind_get_method) (class_name , "get_group_name\0" . as_ptr () as * const c_char) ; table . set_dispatch_mode = (gd_api . godot_method_bind_get_method) (class_name , "set_dispatch_mode\0" . as_ptr () as * const c_char) ; table . set_grid_radius = (gd_api . godot_method_bind_get_method) (class_name , "set_grid_radius\0" . as_ptr () as * const c_char) ; table . set_group_name = (gd_api . godot_method_bind_get_method) (class_name , "set_group_name\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:10:6196 [INFO] [stdout] | [INFO] [stdout] 10 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 10 | # [doc = "`core singleton class CameraServer` inherits `Object` (unsafe)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_cameraserver.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = ""] # [doc = "\n## Class hierarchy\n\nCameraServer inherits methods from:\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct CameraServer { this : RawObject < Self > , } # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct FeedImage (pub i64) ; impl FeedImage { pub const YCBCR_IMAGE : FeedImage = FeedImage (0i64) ; pub const RGBA_IMAGE : FeedImage = FeedImage (0i64) ; pub const Y_IMAGE : FeedImage = FeedImage (0i64) ; pub const CBCR_IMAGE : FeedImage = FeedImage (1i64) ; } impl From < i64 > for FeedImage { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < FeedImage > for i64 { # [inline] fn from (v : FeedImage) -> Self { v . 0 } } # [doc = "Constants"] # [allow (non_upper_case_globals)] impl CameraServer { pub const FEED_CBCR_IMAGE : i64 = 1i64 ; pub const FEED_RGBA_IMAGE : i64 = 0i64 ; pub const FEED_YCBCR_IMAGE : i64 = 0i64 ; pub const FEED_Y_IMAGE : i64 = 0i64 ; } impl CameraServer { # [doc = "Returns a reference to the singleton instance."] # [inline] pub fn godot_singleton () -> & 'static Self { unsafe { let this = (get_api () . godot_global_get_singleton) ("CameraServer\0" . as_ptr () as * mut _) ; let this = ptr :: NonNull :: new (this) . expect ("singleton should not be null") ; let this = RawObject :: from_sys_ref_unchecked :: < 'static > (this) ; Self :: cast_ref (this) } } # [doc = "Adds a camera feed to the camera server."] # [doc = ""] # [inline] pub fn add_feed (& self , feed : impl AsArg < crate :: generated :: camera_feed :: CameraFeed >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CameraServerMethodTable :: get (get_api ()) . add_feed ; let ret = crate :: icalls :: icallptr_void_obj (method_bind , self . this . sys () . as_ptr () , feed . as_arg_ptr ()) ; } } # [doc = "Returns an array of [CameraFeed]s."] # [doc = ""] # [inline] pub fn feeds (& self) -> VariantArray { unsafe { let method_bind : * mut sys :: godot_method_bind = CameraServerMethodTable :: get (get_api ()) . feeds ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < VariantArray > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns the [CameraFeed] with this id."] # [doc = ""] # [inline] pub fn get_feed (& self , index : i64) -> Option < Ref < crate :: generated :: camera_feed :: CameraFeed , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = CameraServerMethodTable :: get (get_api ()) . get_feed ; let ret = crate :: icalls :: icallptr_obj_i64 (method_bind , self . this . sys () . as_ptr () , index) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: camera_feed :: CameraFeed , thread_access :: Shared >> :: move_from_sys (sys)) } } # [doc = "Returns the number of [CameraFeed]s registered."] # [doc = ""] # [inline] pub fn get_feed_count (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = CameraServerMethodTable :: get (get_api ()) . get_feed_count ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Removes a [CameraFeed]."] # [doc = ""] # [inline] pub fn remove_feed (& self , feed : impl AsArg < crate :: generated :: camera_feed :: CameraFeed >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CameraServerMethodTable :: get (get_api ()) . remove_feed ; let ret = crate :: icalls :: icallptr_void_obj (method_bind , self . this . sys () . as_ptr () , feed . as_arg_ptr ()) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for CameraServer { } unsafe impl GodotObject for CameraServer { type RefKind = ref_kind :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "CameraServer" } } impl std :: ops :: Deref for CameraServer { type Target = crate :: generated :: object :: Object ; # [inline] fn deref (& self) -> & crate :: generated :: object :: Object { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for CameraServer { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: object :: Object { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: object :: Object > for CameraServer { } unsafe impl Send for CameraServer { } unsafe impl Sync for CameraServer { } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct CameraServerMethodTable { pub class_constructor : sys :: godot_class_constructor , pub add_feed : * mut sys :: godot_method_bind , pub feeds : * mut sys :: godot_method_bind , pub get_feed : * mut sys :: godot_method_bind , pub get_feed_count : * mut sys :: godot_method_bind , pub remove_feed : * mut sys :: godot_method_bind } impl CameraServerMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : CameraServerMethodTable = CameraServerMethodTable { class_constructor : None , add_feed : 0 as * mut sys :: godot_method_bind , feeds : 0 as * mut sys :: godot_method_bind , get_feed : 0 as * mut sys :: godot_method_bind , get_feed_count : 0 as * mut sys :: godot_method_bind , remove_feed : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { CameraServerMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "CameraServer\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . add_feed = (gd_api . godot_method_bind_get_method) (class_name , "add_feed\0" . as_ptr () as * const c_char) ; table . feeds = (gd_api . godot_method_bind_get_method) (class_name , "feeds\0" . as_ptr () as * const c_char) ; table . get_feed = (gd_api . godot_method_bind_get_method) (class_name , "get_feed\0" . as_ptr () as * const c_char) ; table . get_feed_count = (gd_api . godot_method_bind_get_method) (class_name , "get_feed_count\0" . as_ptr () as * const c_char) ; table . remove_feed = (gd_api . godot_method_bind_get_method) (class_name , "remove_feed\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:16:4512 [INFO] [stdout] | [INFO] [stdout] 16 | ...thodTable { class_constructor : None , } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 16 | # [doc = "`core class CheckBox` inherits `Button` (unsafe)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_checkbox.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nNon reference counted objects such as the ones of this type are usually owned by the engine.\n\n`CheckBox` is a reference-only type. Persistent references can\nonly exist in the unsafe `Ref` form.\n\nIn the cases where Rust code owns an object of this type, for example if the object was just\ncreated on the Rust side and not passed to the engine yet, ownership should be either given\nto the engine or the object must be manually destroyed using `Ref::free`, or `Ref::queue_free`\nif it is a `Node`."] # [doc = "\n## Class hierarchy\n\nCheckBox inherits methods from:\n - [Button](struct.Button.html)\n - [BaseButton](struct.BaseButton.html)\n - [Control](struct.Control.html)\n - [CanvasItem](struct.CanvasItem.html)\n - [Node](struct.Node.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct CheckBox { this : RawObject < Self > , } impl CheckBox { # [doc = "Creates a new instance of this object.\n\nBecause this type is not reference counted, the lifetime of the returned object\nis *not* automatically managed.\n\nImmediately after creation, the object is owned by the caller, and can be\npassed to the engine (in which case the engine will be responsible for\ndestroying the object) or destroyed manually using `Ref::free`, or preferably\n`Ref::queue_free` if it is a `Node`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = CheckBoxMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } } impl gdnative_core :: private :: godot_object :: Sealed for CheckBox { } unsafe impl GodotObject for CheckBox { type RefKind = ref_kind :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "CheckBox" } } impl QueueFree for CheckBox { # [inline] unsafe fn godot_queue_free (obj : * mut sys :: godot_object) { let method_bind : * mut sys :: godot_method_bind = crate :: generated :: node :: NodeMethodTable :: get (get_api ()) . queue_free ; crate :: icalls :: icallptr_void (method_bind , obj) } } impl std :: ops :: Deref for CheckBox { type Target = crate :: generated :: button :: Button ; # [inline] fn deref (& self) -> & crate :: generated :: button :: Button { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for CheckBox { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: button :: Button { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: button :: Button > for CheckBox { } unsafe impl SubClass < crate :: generated :: base_button :: BaseButton > for CheckBox { } unsafe impl SubClass < crate :: generated :: control :: Control > for CheckBox { } unsafe impl SubClass < crate :: generated :: canvas_item :: CanvasItem > for CheckBox { } unsafe impl SubClass < crate :: generated :: node :: Node > for CheckBox { } unsafe impl SubClass < crate :: generated :: object :: Object > for CheckBox { } impl Instanciable for CheckBox { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { CheckBox :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct CheckBoxMethodTable { pub class_constructor : sys :: godot_class_constructor , } impl CheckBoxMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : CheckBoxMethodTable = CheckBoxMethodTable { class_constructor : None , } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { CheckBoxMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "CheckBox\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:430:21553 [INFO] [stdout] | [INFO] [stdout] 430 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 430 | # [doc = "`core class Curve3D` inherits `Resource` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_curve3d.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nCurve3D inherits methods from:\n - [Resource](struct.Resource.html)\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct Curve3D { this : RawObject < Self > , } impl Curve3D { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = Curve3DMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "Adds a point to a curve at `position`, with control points `in` and `out`.\nIf `at_position` is given, the point is inserted before the point number `at_position`, moving that point (and every point after) after the inserted point. If `at_position` is not given, or is an illegal value (`at_position <0` or `at_position >= [method get_point_count]`), the point will be appended at the end of the point list.\n# Default Arguments\n* `in` - `Vector3( 0, 0, 0 )`\n* `out` - `Vector3( 0, 0, 0 )`\n* `at_position` - `-1`"] # [doc = ""] # [inline] pub fn add_point (& self , position : Vector3 , _in : Vector3 , out : Vector3 , at_position : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = Curve3DMethodTable :: get (get_api ()) . add_point ; let ret = crate :: icalls :: icallptr_void_vec3_vec3_vec3_i64 (method_bind , self . this . sys () . as_ptr () , position , _in , out , at_position) ; } } # [doc = "Removes all points from the curve."] # [doc = ""] # [inline] pub fn clear_points (& self) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = Curve3DMethodTable :: get (get_api ()) . clear_points ; let ret = crate :: icalls :: icallptr_void (method_bind , self . this . sys () . as_ptr ()) ; } } # [doc = "The distance in meters between two adjacent cached points. Changing it forces the cache to be recomputed the next time the [method get_baked_points] or [method get_baked_length] function is called. The smaller the distance, the more points in the cache and the more memory it will consume, so use with care."] # [doc = ""] # [inline] pub fn bake_interval (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = Curve3DMethodTable :: get (get_api ()) . get_bake_interval ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Returns the total length of the curve, based on the cached points. Given enough density (see [member bake_interval]), it should be approximate enough."] # [doc = ""] # [inline] pub fn get_baked_length (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = Curve3DMethodTable :: get (get_api ()) . get_baked_length ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Returns the cache of points as a [PoolVector3Array]."] # [doc = ""] # [inline] pub fn get_baked_points (& self) -> Vector3Array { unsafe { let method_bind : * mut sys :: godot_method_bind = Curve3DMethodTable :: get (get_api ()) . get_baked_points ; let ret = crate :: icalls :: icallptr_vec3arr (method_bind , self . this . sys () . as_ptr ()) ; Vector3Array :: from_sys (ret) } } # [doc = "Returns the cache of tilts as a [PoolRealArray]."] # [doc = ""] # [inline] pub fn get_baked_tilts (& self) -> Float32Array { unsafe { let method_bind : * mut sys :: godot_method_bind = Curve3DMethodTable :: get (get_api ()) . get_baked_tilts ; let ret = crate :: icalls :: icallptr_f32arr (method_bind , self . this . sys () . as_ptr ()) ; Float32Array :: from_sys (ret) } } # [doc = "Returns the cache of up vectors as a [PoolVector3Array].\nIf [member up_vector_enabled] is `false`, the cache will be empty."] # [doc = ""] # [inline] pub fn get_baked_up_vectors (& self) -> Vector3Array { unsafe { let method_bind : * mut sys :: godot_method_bind = Curve3DMethodTable :: get (get_api ()) . get_baked_up_vectors ; let ret = crate :: icalls :: icallptr_vec3arr (method_bind , self . this . sys () . as_ptr ()) ; Vector3Array :: from_sys (ret) } } # [doc = "Returns the closest offset to `to_point`. This offset is meant to be used in [method interpolate_baked] or [method interpolate_baked_up_vector].\n`to_point` must be in this curve's local space."] # [doc = ""] # [inline] pub fn get_closest_offset (& self , to_point : Vector3) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = Curve3DMethodTable :: get (get_api ()) . get_closest_offset ; let ret = crate :: icalls :: icallptr_f64_vec3 (method_bind , self . this . sys () . as_ptr () , to_point) ; ret as _ } } # [doc = "Returns the closest point (in curve's local space) to `to_point`.\n`to_point` must be in this curve's local space."] # [doc = ""] # [inline] pub fn get_closest_point (& self , to_point : Vector3) -> Vector3 { unsafe { let method_bind : * mut sys :: godot_method_bind = Curve3DMethodTable :: get (get_api ()) . get_closest_point ; let ret = crate :: icalls :: icallptr_vec3_vec3 (method_bind , self . this . sys () . as_ptr () , to_point) ; mem :: transmute (ret) } } # [doc = "Returns the number of points describing the curve."] # [doc = ""] # [inline] pub fn get_point_count (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = Curve3DMethodTable :: get (get_api ()) . get_point_count ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Returns the position of the control point leading to the vertex `idx`. If the index is out of bounds, the function sends an error to the console, and returns `(0, 0, 0)`."] # [doc = ""] # [inline] pub fn get_point_in (& self , idx : i64) -> Vector3 { unsafe { let method_bind : * mut sys :: godot_method_bind = Curve3DMethodTable :: get (get_api ()) . get_point_in ; let ret = crate :: icalls :: icallptr_vec3_i64 (method_bind , self . this . sys () . as_ptr () , idx) ; mem :: transmute (ret) } } # [doc = "Returns the position of the control point leading out of the vertex `idx`. If the index is out of bounds, the function sends an error to the console, and returns `(0, 0, 0)`."] # [doc = ""] # [inline] pub fn get_point_out (& self , idx : i64) -> Vector3 { unsafe { let method_bind : * mut sys :: godot_method_bind = Curve3DMethodTable :: get (get_api ()) . get_point_out ; let ret = crate :: icalls :: icallptr_vec3_i64 (method_bind , self . this . sys () . as_ptr () , idx) ; mem :: transmute (ret) } } # [doc = "Returns the position of the vertex `idx`. If the index is out of bounds, the function sends an error to the console, and returns `(0, 0, 0)`."] # [doc = ""] # [inline] pub fn get_point_position (& self , idx : i64) -> Vector3 { unsafe { let method_bind : * mut sys :: godot_method_bind = Curve3DMethodTable :: get (get_api ()) . get_point_position ; let ret = crate :: icalls :: icallptr_vec3_i64 (method_bind , self . this . sys () . as_ptr () , idx) ; mem :: transmute (ret) } } # [doc = "Returns the tilt angle in radians for the point `idx`. If the index is out of bounds, the function sends an error to the console, and returns `0`."] # [doc = ""] # [inline] pub fn get_point_tilt (& self , idx : i64) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = Curve3DMethodTable :: get (get_api ()) . get_point_tilt ; let ret = crate :: icalls :: icallptr_f64_i64 (method_bind , self . this . sys () . as_ptr () , idx) ; ret as _ } } # [doc = "Returns the position between the vertex `idx` and the vertex `idx + 1`, where `t` controls if the point is the first vertex (`t = 0.0`), the last vertex (`t = 1.0`), or in between. Values of `t` outside the range (`0.0 >= t <=1`) give strange, but predictable results.\nIf `idx` is out of bounds it is truncated to the first or last vertex, and `t` is ignored. If the curve has no points, the function sends an error to the console, and returns `(0, 0, 0)`."] # [doc = ""] # [inline] pub fn interpolate (& self , idx : i64 , t : f64) -> Vector3 { unsafe { let method_bind : * mut sys :: godot_method_bind = Curve3DMethodTable :: get (get_api ()) . interpolate ; let ret = crate :: icalls :: icallptr_vec3_i64_f64 (method_bind , self . this . sys () . as_ptr () , idx , t) ; mem :: transmute (ret) } } # [doc = "Returns a point within the curve at position `offset`, where `offset` is measured as a pixel distance along the curve.\nTo do that, it finds the two cached points where the `offset` lies between, then interpolates the values. This interpolation is cubic if `cubic` is set to `true`, or linear if set to `false`.\nCubic interpolation tends to follow the curves better, but linear is faster (and often, precise enough).\n# Default Arguments\n* `cubic` - `false`"] # [doc = ""] # [inline] pub fn interpolate_baked (& self , offset : f64 , cubic : bool) -> Vector3 { unsafe { let method_bind : * mut sys :: godot_method_bind = Curve3DMethodTable :: get (get_api ()) . interpolate_baked ; let ret = crate :: icalls :: icallptr_vec3_f64_bool (method_bind , self . this . sys () . as_ptr () , offset , cubic) ; mem :: transmute (ret) } } # [doc = "Returns an up vector within the curve at position `offset`, where `offset` is measured as a distance in 3D units along the curve.\nTo do that, it finds the two cached up vectors where the `offset` lies between, then interpolates the values. If `apply_tilt` is `true`, an interpolated tilt is applied to the interpolated up vector.\nIf the curve has no up vectors, the function sends an error to the console, and returns `(0, 1, 0)`.\n# Default Arguments\n* `apply_tilt` - `false`"] # [doc = ""] # [inline] pub fn interpolate_baked_up_vector (& self , offset : f64 , apply_tilt : bool) -> Vector3 { unsafe { let method_bind : * mut sys :: godot_method_bind = Curve3DMethodTable :: get (get_api ()) . interpolate_baked_up_vector ; let ret = crate :: icalls :: icallptr_vec3_f64_bool (method_bind , self . this . sys () . as_ptr () , offset , apply_tilt) ; mem :: transmute (ret) } } # [doc = "Returns the position at the vertex `fofs`. It calls [method interpolate] using the integer part of `fofs` as `idx`, and its fractional part as `t`."] # [doc = ""] # [inline] pub fn interpolatef (& self , fofs : f64) -> Vector3 { unsafe { let method_bind : * mut sys :: godot_method_bind = Curve3DMethodTable :: get (get_api ()) . interpolatef ; let ret = crate :: icalls :: icallptr_vec3_f64 (method_bind , self . this . sys () . as_ptr () , fofs) ; mem :: transmute (ret) } } # [doc = "If `true`, the curve will bake up vectors used for orientation. This is used when [member PathFollow.rotation_mode] is set to [constant PathFollow.ROTATION_ORIENTED]. Changing it forces the cache to be recomputed."] # [doc = ""] # [inline] pub fn is_up_vector_enabled (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = Curve3DMethodTable :: get (get_api ()) . is_up_vector_enabled ; let ret = crate :: icalls :: icallptr_bool (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Deletes the point `idx` from the curve. Sends an error to the console if `idx` is out of bounds."] # [doc = ""] # [inline] pub fn remove_point (& self , idx : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = Curve3DMethodTable :: get (get_api ()) . remove_point ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , idx) ; } } # [doc = "The distance in meters between two adjacent cached points. Changing it forces the cache to be recomputed the next time the [method get_baked_points] or [method get_baked_length] function is called. The smaller the distance, the more points in the cache and the more memory it will consume, so use with care."] # [doc = ""] # [inline] pub fn set_bake_interval (& self , distance : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = Curve3DMethodTable :: get (get_api ()) . set_bake_interval ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , distance) ; } } # [doc = "Sets the position of the control point leading to the vertex `idx`. If the index is out of bounds, the function sends an error to the console."] # [doc = ""] # [inline] pub fn set_point_in (& self , idx : i64 , position : Vector3) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = Curve3DMethodTable :: get (get_api ()) . set_point_in ; let ret = crate :: icalls :: icallptr_void_i64_vec3 (method_bind , self . this . sys () . as_ptr () , idx , position) ; } } # [doc = "Sets the position of the control point leading out of the vertex `idx`. If the index is out of bounds, the function sends an error to the console."] # [doc = ""] # [inline] pub fn set_point_out (& self , idx : i64 , position : Vector3) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = Curve3DMethodTable :: get (get_api ()) . set_point_out ; let ret = crate :: icalls :: icallptr_void_i64_vec3 (method_bind , self . this . sys () . as_ptr () , idx , position) ; } } # [doc = "Sets the position for the vertex `idx`. If the index is out of bounds, the function sends an error to the console."] # [doc = ""] # [inline] pub fn set_point_position (& self , idx : i64 , position : Vector3) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = Curve3DMethodTable :: get (get_api ()) . set_point_position ; let ret = crate :: icalls :: icallptr_void_i64_vec3 (method_bind , self . this . sys () . as_ptr () , idx , position) ; } } # [doc = "Sets the tilt angle in radians for the point `idx`. If the index is out of bounds, the function sends an error to the console.\nThe tilt controls the rotation along the look-at axis an object traveling the path would have. In the case of a curve controlling a [PathFollow], this tilt is an offset over the natural tilt the [PathFollow] calculates."] # [doc = ""] # [inline] pub fn set_point_tilt (& self , idx : i64 , tilt : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = Curve3DMethodTable :: get (get_api ()) . set_point_tilt ; let ret = crate :: icalls :: icallptr_void_i64_f64 (method_bind , self . this . sys () . as_ptr () , idx , tilt) ; } } # [doc = "If `true`, the curve will bake up vectors used for orientation. This is used when [member PathFollow.rotation_mode] is set to [constant PathFollow.ROTATION_ORIENTED]. Changing it forces the cache to be recomputed."] # [doc = ""] # [inline] pub fn set_up_vector_enabled (& self , enable : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = Curve3DMethodTable :: get (get_api ()) . set_up_vector_enabled ; let ret = crate :: icalls :: icallptr_void_bool (method_bind , self . this . sys () . as_ptr () , enable) ; } } # [doc = "Returns a list of points along the curve, with a curvature controlled point density. That is, the curvier parts will have more points than the straighter parts.\nThis approximation makes straight segments between each point, then subdivides those segments until the resulting shape is similar enough.\n`max_stages` controls how many subdivisions a curve segment may face before it is considered approximate enough. Each subdivision splits the segment in half, so the default 5 stages may mean up to 32 subdivisions per curve segment. Increase with care!\n`tolerance_degrees` controls how many degrees the midpoint of a segment may deviate from the real curve, before the segment has to be subdivided.\n# Default Arguments\n* `max_stages` - `5`\n* `tolerance_degrees` - `4`"] # [doc = ""] # [inline] pub fn tessellate (& self , max_stages : i64 , tolerance_degrees : f64) -> Vector3Array { unsafe { let method_bind : * mut sys :: godot_method_bind = Curve3DMethodTable :: get (get_api ()) . tessellate ; let ret = crate :: icalls :: icallptr_vec3arr_i64_f64 (method_bind , self . this . sys () . as_ptr () , max_stages , tolerance_degrees) ; Vector3Array :: from_sys (ret) } } } impl gdnative_core :: private :: godot_object :: Sealed for Curve3D { } unsafe impl GodotObject for Curve3D { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "Curve3D" } } impl std :: ops :: Deref for Curve3D { type Target = crate :: generated :: resource :: Resource ; # [inline] fn deref (& self) -> & crate :: generated :: resource :: Resource { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for Curve3D { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: resource :: Resource { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: resource :: Resource > for Curve3D { } unsafe impl SubClass < crate :: generated :: reference :: Reference > for Curve3D { } unsafe impl SubClass < crate :: generated :: object :: Object > for Curve3D { } impl Instanciable for Curve3D { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { Curve3D :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct Curve3DMethodTable { pub class_constructor : sys :: godot_class_constructor , pub add_point : * mut sys :: godot_method_bind , pub clear_points : * mut sys :: godot_method_bind , pub get_bake_interval : * mut sys :: godot_method_bind , pub get_baked_length : * mut sys :: godot_method_bind , pub get_baked_points : * mut sys :: godot_method_bind , pub get_baked_tilts : * mut sys :: godot_method_bind , pub get_baked_up_vectors : * mut sys :: godot_method_bind , pub get_closest_offset : * mut sys :: godot_method_bind , pub get_closest_point : * mut sys :: godot_method_bind , pub get_point_count : * mut sys :: godot_method_bind , pub get_point_in : * mut sys :: godot_method_bind , pub get_point_out : * mut sys :: godot_method_bind , pub get_point_position : * mut sys :: godot_method_bind , pub get_point_tilt : * mut sys :: godot_method_bind , pub interpolate : * mut sys :: godot_method_bind , pub interpolate_baked : * mut sys :: godot_method_bind , pub interpolate_baked_up_vector : * mut sys :: godot_method_bind , pub interpolatef : * mut sys :: godot_method_bind , pub is_up_vector_enabled : * mut sys :: godot_method_bind , pub remove_point : * mut sys :: godot_method_bind , pub set_bake_interval : * mut sys :: godot_method_bind , pub set_point_in : * mut sys :: godot_method_bind , pub set_point_out : * mut sys :: godot_method_bind , pub set_point_position : * mut sys :: godot_method_bind , pub set_point_tilt : * mut sys :: godot_method_bind , pub set_up_vector_enabled : * mut sys :: godot_method_bind , pub tessellate : * mut sys :: godot_method_bind } impl Curve3DMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : Curve3DMethodTable = Curve3DMethodTable { class_constructor : None , add_point : 0 as * mut sys :: godot_method_bind , clear_points : 0 as * mut sys :: godot_method_bind , get_bake_interval : 0 as * mut sys :: godot_method_bind , get_baked_length : 0 as * mut sys :: godot_method_bind , get_baked_points : 0 as * mut sys :: godot_method_bind , get_baked_tilts : 0 as * mut sys :: godot_method_bind , get_baked_up_vectors : 0 as * mut sys :: godot_method_bind , get_closest_offset : 0 as * mut sys :: godot_method_bind , get_closest_point : 0 as * mut sys :: godot_method_bind , get_point_count : 0 as * mut sys :: godot_method_bind , get_point_in : 0 as * mut sys :: godot_method_bind , get_point_out : 0 as * mut sys :: godot_method_bind , get_point_position : 0 as * mut sys :: godot_method_bind , get_point_tilt : 0 as * mut sys :: godot_method_bind , interpolate : 0 as * mut sys :: godot_method_bind , interpolate_baked : 0 as * mut sys :: godot_method_bind , interpolate_baked_up_vector : 0 as * mut sys :: godot_method_bind , interpolatef : 0 as * mut sys :: godot_method_bind , is_up_vector_enabled : 0 as * mut sys :: godot_method_bind , remove_point : 0 as * mut sys :: godot_method_bind , set_bake_interval : 0 as * mut sys :: godot_method_bind , set_point_in : 0 as * mut sys :: godot_method_bind , set_point_out : 0 as * mut sys :: godot_method_bind , set_point_position : 0 as * mut sys :: godot_method_bind , set_point_tilt : 0 as * mut sys :: godot_method_bind , set_up_vector_enabled : 0 as * mut sys :: godot_method_bind , tessellate : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { Curve3DMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "Curve3D\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . add_point = (gd_api . godot_method_bind_get_method) (class_name , "add_point\0" . as_ptr () as * const c_char) ; table . clear_points = (gd_api . godot_method_bind_get_method) (class_name , "clear_points\0" . as_ptr () as * const c_char) ; table . get_bake_interval = (gd_api . godot_method_bind_get_method) (class_name , "get_bake_interval\0" . as_ptr () as * const c_char) ; table . get_baked_length = (gd_api . godot_method_bind_get_method) (class_name , "get_baked_length\0" . as_ptr () as * const c_char) ; table . get_baked_points = (gd_api . godot_method_bind_get_method) (class_name , "get_baked_points\0" . as_ptr () as * const c_char) ; table . get_baked_tilts = (gd_api . godot_method_bind_get_method) (class_name , "get_baked_tilts\0" . as_ptr () as * const c_char) ; table . get_baked_up_vectors = (gd_api . godot_method_bind_get_method) (class_name , "get_baked_up_vectors\0" . as_ptr () as * const c_char) ; table . get_closest_offset = (gd_api . godot_method_bind_get_method) (class_name , "get_closest_offset\0" . as_ptr () as * const c_char) ; table . get_closest_point = (gd_api . godot_method_bind_get_method) (class_name , "get_closest_point\0" . as_ptr () as * const c_char) ; table . get_point_count = (gd_api . godot_method_bind_get_method) (class_name , "get_point_count\0" . as_ptr () as * const c_char) ; table . get_point_in = (gd_api . godot_method_bind_get_method) (class_name , "get_point_in\0" . as_ptr () as * const c_char) ; table . get_point_out = (gd_api . godot_method_bind_get_method) (class_name , "get_point_out\0" . as_ptr () as * const c_char) ; table . get_point_position = (gd_api . godot_method_bind_get_method) (class_name , "get_point_position\0" . as_ptr () as * const c_char) ; table . get_point_tilt = (gd_api . godot_method_bind_get_method) (class_name , "get_point_tilt\0" . as_ptr () as * const c_char) ; table . interpolate = (gd_api . godot_method_bind_get_method) (class_name , "interpolate\0" . as_ptr () as * const c_char) ; table . interpolate_baked = (gd_api . godot_method_bind_get_method) (class_name , "interpolate_baked\0" . as_ptr () as * const c_char) ; table . interpolate_baked_up_vector = (gd_api . godot_method_bind_get_method) (class_name , "interpolate_baked_up_vector\0" . as_ptr () as * const c_char) ; table . interpolatef = (gd_api . godot_method_bind_get_method) (class_name , "interpolatef\0" . as_ptr () as * const c_char) ; table . is_up_vector_enabled = (gd_api . godot_method_bind_get_method) (class_name , "is_up_vector_enabled\0" . as_ptr () as * const c_char) ; table . remove_point = (gd_api . godot_method_bind_get_method) (class_name , "remove_point\0" . as_ptr () as * const c_char) ; table . set_bake_interval = (gd_api . godot_method_bind_get_method) (class_name , "set_bake_interval\0" . as_ptr () as * const c_char) ; table . set_point_in = (gd_api . godot_method_bind_get_method) (class_name , "set_point_in\0" . as_ptr () as * const c_char) ; table . set_point_out = (gd_api . godot_method_bind_get_method) (class_name , "set_point_out\0" . as_ptr () as * const c_char) ; table . set_point_position = (gd_api . godot_method_bind_get_method) (class_name , "set_point_position\0" . as_ptr () as * const c_char) ; table . set_point_tilt = (gd_api . godot_method_bind_get_method) (class_name , "set_point_tilt\0" . as_ptr () as * const c_char) ; table . set_up_vector_enabled = (gd_api . godot_method_bind_get_method) (class_name , "set_up_vector_enabled\0" . as_ptr () as * const c_char) ; table . tessellate = (gd_api . godot_method_bind_get_method) (class_name , "tessellate\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:22:11978 [INFO] [stdout] | [INFO] [stdout] 22 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 22 | # [doc = "`core class SpriteFrames` inherits `Resource` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_spriteframes.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nSpriteFrames inherits methods from:\n - [Resource](struct.Resource.html)\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct SpriteFrames { this : RawObject < Self > , } impl SpriteFrames { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = SpriteFramesMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "Adds a new animation to the library."] # [doc = ""] # [inline] pub fn add_animation (& self , anim : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = SpriteFramesMethodTable :: get (get_api ()) . add_animation ; let ret = crate :: icalls :: icallptr_void_str (method_bind , self . this . sys () . as_ptr () , anim . into ()) ; } } # [doc = "Adds a frame to the given animation.\n# Default Arguments\n* `at_position` - `-1`"] # [doc = ""] # [inline] pub fn add_frame (& self , anim : impl Into < GodotString > , frame : impl AsArg < crate :: generated :: texture :: Texture > , at_position : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = SpriteFramesMethodTable :: get (get_api ()) . add_frame ; let ret = crate :: icalls :: icallptr_void_str_obj_i64 (method_bind , self . this . sys () . as_ptr () , anim . into () , frame . as_arg_ptr () , at_position) ; } } # [doc = "Removes all frames from the given animation."] # [doc = ""] # [inline] pub fn clear (& self , anim : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = SpriteFramesMethodTable :: get (get_api ()) . clear ; let ret = crate :: icalls :: icallptr_void_str (method_bind , self . this . sys () . as_ptr () , anim . into ()) ; } } # [doc = "Removes all animations. A \"default\" animation will be created."] # [doc = ""] # [inline] pub fn clear_all (& self) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = SpriteFramesMethodTable :: get (get_api ()) . clear_all ; let ret = crate :: icalls :: icallptr_void (method_bind , self . this . sys () . as_ptr ()) ; } } # [doc = "If `true`, the given animation will loop."] # [doc = ""] # [inline] pub fn get_animation_loop (& self , anim : impl Into < GodotString >) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = SpriteFramesMethodTable :: get (get_api ()) . get_animation_loop ; let ret = crate :: icalls :: icallptr_bool_str (method_bind , self . this . sys () . as_ptr () , anim . into ()) ; ret as _ } } # [doc = "Returns an array containing the names associated to each animation. Values are placed in alphabetical order."] # [doc = ""] # [inline] pub fn get_animation_names (& self) -> StringArray { unsafe { let method_bind : * mut sys :: godot_method_bind = SpriteFramesMethodTable :: get (get_api ()) . get_animation_names ; let ret = crate :: icalls :: icallptr_strarr (method_bind , self . this . sys () . as_ptr ()) ; StringArray :: from_sys (ret) } } # [doc = "The animation's speed in frames per second."] # [doc = ""] # [inline] pub fn get_animation_speed (& self , anim : impl Into < GodotString >) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = SpriteFramesMethodTable :: get (get_api ()) . get_animation_speed ; let ret = crate :: icalls :: icallptr_f64_str (method_bind , self . this . sys () . as_ptr () , anim . into ()) ; ret as _ } } # [doc = "Returns the animation's selected frame."] # [doc = ""] # [inline] pub fn get_frame (& self , anim : impl Into < GodotString > , idx : i64) -> Option < Ref < crate :: generated :: texture :: Texture , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = SpriteFramesMethodTable :: get (get_api ()) . get_frame ; let ret = crate :: icalls :: icallptr_obj_str_i64 (method_bind , self . this . sys () . as_ptr () , anim . into () , idx) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: texture :: Texture , thread_access :: Shared >> :: move_from_sys (sys)) } } # [doc = "Returns the number of frames in the animation."] # [doc = ""] # [inline] pub fn get_frame_count (& self , anim : impl Into < GodotString >) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = SpriteFramesMethodTable :: get (get_api ()) . get_frame_count ; let ret = crate :: icalls :: icallptr_i64_str (method_bind , self . this . sys () . as_ptr () , anim . into ()) ; ret as _ } } # [doc = "If `true`, the named animation exists."] # [doc = ""] # [inline] pub fn has_animation (& self , anim : impl Into < GodotString >) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = SpriteFramesMethodTable :: get (get_api ()) . has_animation ; let ret = crate :: icalls :: icallptr_bool_str (method_bind , self . this . sys () . as_ptr () , anim . into ()) ; ret as _ } } # [doc = "Removes the given animation."] # [doc = ""] # [inline] pub fn remove_animation (& self , anim : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = SpriteFramesMethodTable :: get (get_api ()) . remove_animation ; let ret = crate :: icalls :: icallptr_void_str (method_bind , self . this . sys () . as_ptr () , anim . into ()) ; } } # [doc = "Removes the animation's selected frame."] # [doc = ""] # [inline] pub fn remove_frame (& self , anim : impl Into < GodotString > , idx : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = SpriteFramesMethodTable :: get (get_api ()) . remove_frame ; let ret = crate :: icalls :: icallptr_void_str_i64 (method_bind , self . this . sys () . as_ptr () , anim . into () , idx) ; } } # [doc = "Changes the animation's name to `newname`."] # [doc = ""] # [inline] pub fn rename_animation (& self , anim : impl Into < GodotString > , newname : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = SpriteFramesMethodTable :: get (get_api ()) . rename_animation ; let ret = crate :: icalls :: icallptr_void_str_str (method_bind , self . this . sys () . as_ptr () , anim . into () , newname . into ()) ; } } # [doc = "If `true`, the animation will loop."] # [doc = ""] # [inline] pub fn set_animation_loop (& self , anim : impl Into < GodotString > , _loop : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = SpriteFramesMethodTable :: get (get_api ()) . set_animation_loop ; let ret = crate :: icalls :: icallptr_void_str_bool (method_bind , self . this . sys () . as_ptr () , anim . into () , _loop) ; } } # [doc = "The animation's speed in frames per second."] # [doc = ""] # [inline] pub fn set_animation_speed (& self , anim : impl Into < GodotString > , speed : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = SpriteFramesMethodTable :: get (get_api ()) . set_animation_speed ; let ret = crate :: icalls :: icallptr_void_str_f64 (method_bind , self . this . sys () . as_ptr () , anim . into () , speed) ; } } # [doc = "Sets the texture of the given frame."] # [doc = ""] # [inline] pub fn set_frame (& self , anim : impl Into < GodotString > , idx : i64 , txt : impl AsArg < crate :: generated :: texture :: Texture >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = SpriteFramesMethodTable :: get (get_api ()) . set_frame ; let ret = crate :: icalls :: icallptr_void_str_i64_obj (method_bind , self . this . sys () . as_ptr () , anim . into () , idx , txt . as_arg_ptr ()) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for SpriteFrames { } unsafe impl GodotObject for SpriteFrames { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "SpriteFrames" } } impl std :: ops :: Deref for SpriteFrames { type Target = crate :: generated :: resource :: Resource ; # [inline] fn deref (& self) -> & crate :: generated :: resource :: Resource { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for SpriteFrames { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: resource :: Resource { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: resource :: Resource > for SpriteFrames { } unsafe impl SubClass < crate :: generated :: reference :: Reference > for SpriteFrames { } unsafe impl SubClass < crate :: generated :: object :: Object > for SpriteFrames { } impl Instanciable for SpriteFrames { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { SpriteFrames :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct SpriteFramesMethodTable { pub class_constructor : sys :: godot_class_constructor , pub add_animation : * mut sys :: godot_method_bind , pub add_frame : * mut sys :: godot_method_bind , pub clear : * mut sys :: godot_method_bind , pub clear_all : * mut sys :: godot_method_bind , pub get_animation_loop : * mut sys :: godot_method_bind , pub get_animation_names : * mut sys :: godot_method_bind , pub get_animation_speed : * mut sys :: godot_method_bind , pub get_frame : * mut sys :: godot_method_bind , pub get_frame_count : * mut sys :: godot_method_bind , pub has_animation : * mut sys :: godot_method_bind , pub remove_animation : * mut sys :: godot_method_bind , pub remove_frame : * mut sys :: godot_method_bind , pub rename_animation : * mut sys :: godot_method_bind , pub set_animation_loop : * mut sys :: godot_method_bind , pub set_animation_speed : * mut sys :: godot_method_bind , pub set_frame : * mut sys :: godot_method_bind } impl SpriteFramesMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : SpriteFramesMethodTable = SpriteFramesMethodTable { class_constructor : None , add_animation : 0 as * mut sys :: godot_method_bind , add_frame : 0 as * mut sys :: godot_method_bind , clear : 0 as * mut sys :: godot_method_bind , clear_all : 0 as * mut sys :: godot_method_bind , get_animation_loop : 0 as * mut sys :: godot_method_bind , get_animation_names : 0 as * mut sys :: godot_method_bind , get_animation_speed : 0 as * mut sys :: godot_method_bind , get_frame : 0 as * mut sys :: godot_method_bind , get_frame_count : 0 as * mut sys :: godot_method_bind , has_animation : 0 as * mut sys :: godot_method_bind , remove_animation : 0 as * mut sys :: godot_method_bind , remove_frame : 0 as * mut sys :: godot_method_bind , rename_animation : 0 as * mut sys :: godot_method_bind , set_animation_loop : 0 as * mut sys :: godot_method_bind , set_animation_speed : 0 as * mut sys :: godot_method_bind , set_frame : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { SpriteFramesMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "SpriteFrames\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . add_animation = (gd_api . godot_method_bind_get_method) (class_name , "add_animation\0" . as_ptr () as * const c_char) ; table . add_frame = (gd_api . godot_method_bind_get_method) (class_name , "add_frame\0" . as_ptr () as * const c_char) ; table . clear = (gd_api . godot_method_bind_get_method) (class_name , "clear\0" . as_ptr () as * const c_char) ; table . clear_all = (gd_api . godot_method_bind_get_method) (class_name , "clear_all\0" . as_ptr () as * const c_char) ; table . get_animation_loop = (gd_api . godot_method_bind_get_method) (class_name , "get_animation_loop\0" . as_ptr () as * const c_char) ; table . get_animation_names = (gd_api . godot_method_bind_get_method) (class_name , "get_animation_names\0" . as_ptr () as * const c_char) ; table . get_animation_speed = (gd_api . godot_method_bind_get_method) (class_name , "get_animation_speed\0" . as_ptr () as * const c_char) ; table . get_frame = (gd_api . godot_method_bind_get_method) (class_name , "get_frame\0" . as_ptr () as * const c_char) ; table . get_frame_count = (gd_api . godot_method_bind_get_method) (class_name , "get_frame_count\0" . as_ptr () as * const c_char) ; table . has_animation = (gd_api . godot_method_bind_get_method) (class_name , "has_animation\0" . as_ptr () as * const c_char) ; table . remove_animation = (gd_api . godot_method_bind_get_method) (class_name , "remove_animation\0" . as_ptr () as * const c_char) ; table . remove_frame = (gd_api . godot_method_bind_get_method) (class_name , "remove_frame\0" . as_ptr () as * const c_char) ; table . rename_animation = (gd_api . godot_method_bind_get_method) (class_name , "rename_animation\0" . as_ptr () as * const c_char) ; table . set_animation_loop = (gd_api . godot_method_bind_get_method) (class_name , "set_animation_loop\0" . as_ptr () as * const c_char) ; table . set_animation_speed = (gd_api . godot_method_bind_get_method) (class_name , "set_animation_speed\0" . as_ptr () as * const c_char) ; table . set_frame = (gd_api . godot_method_bind_get_method) (class_name , "set_frame\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:436:3679 [INFO] [stdout] | [INFO] [stdout] 436 | ...thodTable { class_constructor : None , } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 436 | # [doc = "`core class VisualScriptExpression` inherits `VisualScriptNode` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_visualscriptexpression.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nVisualScriptExpression inherits methods from:\n - [VisualScriptNode](struct.VisualScriptNode.html)\n - [Resource](struct.Resource.html)\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct VisualScriptExpression { this : RawObject < Self > , } impl VisualScriptExpression { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = VisualScriptExpressionMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } } impl gdnative_core :: private :: godot_object :: Sealed for VisualScriptExpression { } unsafe impl GodotObject for VisualScriptExpression { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "VisualScriptExpression" } } impl std :: ops :: Deref for VisualScriptExpression { type Target = crate :: generated :: visual_script_node :: VisualScriptNode ; # [inline] fn deref (& self) -> & crate :: generated :: visual_script_node :: VisualScriptNode { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for VisualScriptExpression { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: visual_script_node :: VisualScriptNode { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: visual_script_node :: VisualScriptNode > for VisualScriptExpression { } unsafe impl SubClass < crate :: generated :: resource :: Resource > for VisualScriptExpression { } unsafe impl SubClass < crate :: generated :: reference :: Reference > for VisualScriptExpression { } unsafe impl SubClass < crate :: generated :: object :: Object > for VisualScriptExpression { } impl Instanciable for VisualScriptExpression { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { VisualScriptExpression :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct VisualScriptExpressionMethodTable { pub class_constructor : sys :: godot_class_constructor , } impl VisualScriptExpressionMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : VisualScriptExpressionMethodTable = VisualScriptExpressionMethodTable { class_constructor : None , } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { VisualScriptExpressionMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "VisualScriptExpression\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:28:3380 [INFO] [stdout] | [INFO] [stdout] 28 | ...thodTable { class_constructor : None , } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 28 | # [doc = "`core class Texture3D` inherits `TextureLayered` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_texture3d.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nTexture3D inherits methods from:\n - [TextureLayered](struct.TextureLayered.html)\n - [Resource](struct.Resource.html)\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct Texture3D { this : RawObject < Self > , } impl Texture3D { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = Texture3DMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } } impl gdnative_core :: private :: godot_object :: Sealed for Texture3D { } unsafe impl GodotObject for Texture3D { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "Texture3D" } } impl std :: ops :: Deref for Texture3D { type Target = crate :: generated :: texture_layered :: TextureLayered ; # [inline] fn deref (& self) -> & crate :: generated :: texture_layered :: TextureLayered { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for Texture3D { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: texture_layered :: TextureLayered { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: texture_layered :: TextureLayered > for Texture3D { } unsafe impl SubClass < crate :: generated :: resource :: Resource > for Texture3D { } unsafe impl SubClass < crate :: generated :: reference :: Reference > for Texture3D { } unsafe impl SubClass < crate :: generated :: object :: Object > for Texture3D { } impl Instanciable for Texture3D { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { Texture3D :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct Texture3DMethodTable { pub class_constructor : sys :: godot_class_constructor , } impl Texture3DMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : Texture3DMethodTable = Texture3DMethodTable { class_constructor : None , } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { Texture3DMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "Texture3D\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:34:4483 [INFO] [stdout] | [INFO] [stdout] 34 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 34 | # [doc = "`core class RectangleShape2D` inherits `Shape2D` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_rectangleshape2d.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nRectangleShape2D inherits methods from:\n - [Shape2D](struct.Shape2D.html)\n - [Resource](struct.Resource.html)\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct RectangleShape2D { this : RawObject < Self > , } impl RectangleShape2D { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = RectangleShape2DMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "The rectangle's half extents. The width and height of this shape is twice the half extents."] # [doc = ""] # [inline] pub fn extents (& self) -> Vector2 { unsafe { let method_bind : * mut sys :: godot_method_bind = RectangleShape2DMethodTable :: get (get_api ()) . get_extents ; let ret = crate :: icalls :: icallptr_vec2 (method_bind , self . this . sys () . as_ptr ()) ; mem :: transmute (ret) } } # [doc = "The rectangle's half extents. The width and height of this shape is twice the half extents."] # [doc = ""] # [inline] pub fn set_extents (& self , extents : Vector2) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = RectangleShape2DMethodTable :: get (get_api ()) . set_extents ; let ret = crate :: icalls :: icallptr_void_vec2 (method_bind , self . this . sys () . as_ptr () , extents) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for RectangleShape2D { } unsafe impl GodotObject for RectangleShape2D { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "RectangleShape2D" } } impl std :: ops :: Deref for RectangleShape2D { type Target = crate :: generated :: shape_2d :: Shape2D ; # [inline] fn deref (& self) -> & crate :: generated :: shape_2d :: Shape2D { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for RectangleShape2D { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: shape_2d :: Shape2D { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: shape_2d :: Shape2D > for RectangleShape2D { } unsafe impl SubClass < crate :: generated :: resource :: Resource > for RectangleShape2D { } unsafe impl SubClass < crate :: generated :: reference :: Reference > for RectangleShape2D { } unsafe impl SubClass < crate :: generated :: object :: Object > for RectangleShape2D { } impl Instanciable for RectangleShape2D { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { RectangleShape2D :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct RectangleShape2DMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_extents : * mut sys :: godot_method_bind , pub set_extents : * mut sys :: godot_method_bind } impl RectangleShape2DMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : RectangleShape2DMethodTable = RectangleShape2DMethodTable { class_constructor : None , get_extents : 0 as * mut sys :: godot_method_bind , set_extents : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { RectangleShape2DMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "RectangleShape2D\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_extents = (gd_api . godot_method_bind_get_method) (class_name , "get_extents\0" . as_ptr () as * const c_char) ; table . set_extents = (gd_api . godot_method_bind_get_method) (class_name , "set_extents\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:442:7452 [INFO] [stdout] | [INFO] [stdout] 442 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 442 | # [doc = "`core class World` inherits `Resource` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_world.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nWorld inherits methods from:\n - [Resource](struct.Resource.html)\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct World { this : RawObject < Self > , } impl World { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = WorldMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "Direct access to the world's physics 3D space state. Used for querying current and potential collisions. Must only be accessed from within `_physics_process(delta)`."] # [doc = ""] # [inline] pub fn direct_space_state (& self) -> Option < Ref < crate :: generated :: physics_direct_space_state :: PhysicsDirectSpaceState , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = WorldMethodTable :: get (get_api ()) . get_direct_space_state ; let ret = crate :: icalls :: icallptr_obj (method_bind , self . this . sys () . as_ptr ()) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: physics_direct_space_state :: PhysicsDirectSpaceState , thread_access :: Shared >> :: move_from_sys (sys)) } } # [doc = "The World's [Environment]."] # [doc = ""] # [inline] pub fn environment (& self) -> Option < Ref < crate :: generated :: environment :: Environment , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = WorldMethodTable :: get (get_api ()) . get_environment ; let ret = crate :: icalls :: icallptr_obj (method_bind , self . this . sys () . as_ptr ()) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: environment :: Environment , thread_access :: Shared >> :: move_from_sys (sys)) } } # [doc = "The World's fallback_environment will be used if the World's [Environment] fails or is missing."] # [doc = ""] # [inline] pub fn fallback_environment (& self) -> Option < Ref < crate :: generated :: environment :: Environment , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = WorldMethodTable :: get (get_api ()) . get_fallback_environment ; let ret = crate :: icalls :: icallptr_obj (method_bind , self . this . sys () . as_ptr ()) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: environment :: Environment , thread_access :: Shared >> :: move_from_sys (sys)) } } # [doc = "The World's visual scenario."] # [doc = ""] # [inline] pub fn scenario (& self) -> Rid { unsafe { let method_bind : * mut sys :: godot_method_bind = WorldMethodTable :: get (get_api ()) . get_scenario ; let ret = crate :: icalls :: icallptr_rid (method_bind , self . this . sys () . as_ptr ()) ; Rid :: from_sys (ret) } } # [doc = "The World's physics space."] # [doc = ""] # [inline] pub fn space (& self) -> Rid { unsafe { let method_bind : * mut sys :: godot_method_bind = WorldMethodTable :: get (get_api ()) . get_space ; let ret = crate :: icalls :: icallptr_rid (method_bind , self . this . sys () . as_ptr ()) ; Rid :: from_sys (ret) } } # [doc = "The World's [Environment]."] # [doc = ""] # [inline] pub fn set_environment (& self , env : impl AsArg < crate :: generated :: environment :: Environment >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = WorldMethodTable :: get (get_api ()) . set_environment ; let ret = crate :: icalls :: icallptr_void_obj (method_bind , self . this . sys () . as_ptr () , env . as_arg_ptr ()) ; } } # [doc = "The World's fallback_environment will be used if the World's [Environment] fails or is missing."] # [doc = ""] # [inline] pub fn set_fallback_environment (& self , env : impl AsArg < crate :: generated :: environment :: Environment >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = WorldMethodTable :: get (get_api ()) . set_fallback_environment ; let ret = crate :: icalls :: icallptr_void_obj (method_bind , self . this . sys () . as_ptr () , env . as_arg_ptr ()) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for World { } unsafe impl GodotObject for World { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "World" } } impl std :: ops :: Deref for World { type Target = crate :: generated :: resource :: Resource ; # [inline] fn deref (& self) -> & crate :: generated :: resource :: Resource { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for World { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: resource :: Resource { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: resource :: Resource > for World { } unsafe impl SubClass < crate :: generated :: reference :: Reference > for World { } unsafe impl SubClass < crate :: generated :: object :: Object > for World { } impl Instanciable for World { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { World :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct WorldMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_direct_space_state : * mut sys :: godot_method_bind , pub get_environment : * mut sys :: godot_method_bind , pub get_fallback_environment : * mut sys :: godot_method_bind , pub get_scenario : * mut sys :: godot_method_bind , pub get_space : * mut sys :: godot_method_bind , pub set_environment : * mut sys :: godot_method_bind , pub set_fallback_environment : * mut sys :: godot_method_bind } impl WorldMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : WorldMethodTable = WorldMethodTable { class_constructor : None , get_direct_space_state : 0 as * mut sys :: godot_method_bind , get_environment : 0 as * mut sys :: godot_method_bind , get_fallback_environment : 0 as * mut sys :: godot_method_bind , get_scenario : 0 as * mut sys :: godot_method_bind , get_space : 0 as * mut sys :: godot_method_bind , set_environment : 0 as * mut sys :: godot_method_bind , set_fallback_environment : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { WorldMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "World\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_direct_space_state = (gd_api . godot_method_bind_get_method) (class_name , "get_direct_space_state\0" . as_ptr () as * const c_char) ; table . get_environment = (gd_api . godot_method_bind_get_method) (class_name , "get_environment\0" . as_ptr () as * const c_char) ; table . get_fallback_environment = (gd_api . godot_method_bind_get_method) (class_name , "get_fallback_environment\0" . as_ptr () as * const c_char) ; table . get_scenario = (gd_api . godot_method_bind_get_method) (class_name , "get_scenario\0" . as_ptr () as * const c_char) ; table . get_space = (gd_api . godot_method_bind_get_method) (class_name , "get_space\0" . as_ptr () as * const c_char) ; table . set_environment = (gd_api . godot_method_bind_get_method) (class_name , "set_environment\0" . as_ptr () as * const c_char) ; table . set_fallback_environment = (gd_api . godot_method_bind_get_method) (class_name , "set_fallback_environment\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:40:5075 [INFO] [stdout] | [INFO] [stdout] 40 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 40 | # [doc = "`core class CylinderShape` inherits `Shape` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_cylindershape.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nCylinderShape inherits methods from:\n - [Shape](struct.Shape.html)\n - [Resource](struct.Resource.html)\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct CylinderShape { this : RawObject < Self > , } impl CylinderShape { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = CylinderShapeMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "The cylinder's height."] # [doc = ""] # [inline] pub fn height (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = CylinderShapeMethodTable :: get (get_api ()) . get_height ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "The cylinder's radius."] # [doc = ""] # [inline] pub fn radius (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = CylinderShapeMethodTable :: get (get_api ()) . get_radius ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "The cylinder's height."] # [doc = ""] # [inline] pub fn set_height (& self , height : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CylinderShapeMethodTable :: get (get_api ()) . set_height ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , height) ; } } # [doc = "The cylinder's radius."] # [doc = ""] # [inline] pub fn set_radius (& self , radius : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CylinderShapeMethodTable :: get (get_api ()) . set_radius ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , radius) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for CylinderShape { } unsafe impl GodotObject for CylinderShape { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "CylinderShape" } } impl std :: ops :: Deref for CylinderShape { type Target = crate :: generated :: shape :: Shape ; # [inline] fn deref (& self) -> & crate :: generated :: shape :: Shape { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for CylinderShape { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: shape :: Shape { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: shape :: Shape > for CylinderShape { } unsafe impl SubClass < crate :: generated :: resource :: Resource > for CylinderShape { } unsafe impl SubClass < crate :: generated :: reference :: Reference > for CylinderShape { } unsafe impl SubClass < crate :: generated :: object :: Object > for CylinderShape { } impl Instanciable for CylinderShape { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { CylinderShape :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct CylinderShapeMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_height : * mut sys :: godot_method_bind , pub get_radius : * mut sys :: godot_method_bind , pub set_height : * mut sys :: godot_method_bind , pub set_radius : * mut sys :: godot_method_bind } impl CylinderShapeMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : CylinderShapeMethodTable = CylinderShapeMethodTable { class_constructor : None , get_height : 0 as * mut sys :: godot_method_bind , get_radius : 0 as * mut sys :: godot_method_bind , set_height : 0 as * mut sys :: godot_method_bind , set_radius : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { CylinderShapeMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "CylinderShape\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_height = (gd_api . godot_method_bind_get_method) (class_name , "get_height\0" . as_ptr () as * const c_char) ; table . get_radius = (gd_api . godot_method_bind_get_method) (class_name , "get_radius\0" . as_ptr () as * const c_char) ; table . set_height = (gd_api . godot_method_bind_get_method) (class_name , "set_height\0" . as_ptr () as * const c_char) ; table . set_radius = (gd_api . godot_method_bind_get_method) (class_name , "set_radius\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:46:5943 [INFO] [stdout] | [INFO] [stdout] 46 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 46 | # [doc = "`core class VisibilityNotifier` inherits `Spatial` (unsafe)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_visibilitynotifier.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nNon reference counted objects such as the ones of this type are usually owned by the engine.\n\n`VisibilityNotifier` is a reference-only type. Persistent references can\nonly exist in the unsafe `Ref` form.\n\nIn the cases where Rust code owns an object of this type, for example if the object was just\ncreated on the Rust side and not passed to the engine yet, ownership should be either given\nto the engine or the object must be manually destroyed using `Ref::free`, or `Ref::queue_free`\nif it is a `Node`."] # [doc = "\n## Class hierarchy\n\nVisibilityNotifier inherits methods from:\n - [Spatial](struct.Spatial.html)\n - [Node](struct.Node.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct VisibilityNotifier { this : RawObject < Self > , } impl VisibilityNotifier { # [doc = "Creates a new instance of this object.\n\nBecause this type is not reference counted, the lifetime of the returned object\nis *not* automatically managed.\n\nImmediately after creation, the object is owned by the caller, and can be\npassed to the engine (in which case the engine will be responsible for\ndestroying the object) or destroyed manually using `Ref::free`, or preferably\n`Ref::queue_free` if it is a `Node`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = VisibilityNotifierMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "The VisibilityNotifier's bounding box."] # [doc = ""] # [inline] pub fn aabb (& self) -> Aabb { unsafe { let method_bind : * mut sys :: godot_method_bind = VisibilityNotifierMethodTable :: get (get_api ()) . get_aabb ; let ret = crate :: icalls :: icallptr_aabb (method_bind , self . this . sys () . as_ptr ()) ; mem :: transmute (ret) } } # [doc = "If `true`, the bounding box is on the screen.\n**Note:** It takes one frame for the node's visibility to be assessed once added to the scene tree, so this method will return `false` right after it is instantiated, even if it will be on screen in the draw pass."] # [doc = ""] # [inline] pub fn is_on_screen (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = VisibilityNotifierMethodTable :: get (get_api ()) . is_on_screen ; let ret = crate :: icalls :: icallptr_bool (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "The VisibilityNotifier's bounding box."] # [doc = ""] # [inline] pub fn set_aabb (& self , rect : Aabb) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = VisibilityNotifierMethodTable :: get (get_api ()) . set_aabb ; let ret = crate :: icalls :: icallptr_void_aabb (method_bind , self . this . sys () . as_ptr () , rect) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for VisibilityNotifier { } unsafe impl GodotObject for VisibilityNotifier { type RefKind = ref_kind :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "VisibilityNotifier" } } impl QueueFree for VisibilityNotifier { # [inline] unsafe fn godot_queue_free (obj : * mut sys :: godot_object) { let method_bind : * mut sys :: godot_method_bind = crate :: generated :: node :: NodeMethodTable :: get (get_api ()) . queue_free ; crate :: icalls :: icallptr_void (method_bind , obj) } } impl std :: ops :: Deref for VisibilityNotifier { type Target = crate :: generated :: spatial :: Spatial ; # [inline] fn deref (& self) -> & crate :: generated :: spatial :: Spatial { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for VisibilityNotifier { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: spatial :: Spatial { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: spatial :: Spatial > for VisibilityNotifier { } unsafe impl SubClass < crate :: generated :: node :: Node > for VisibilityNotifier { } unsafe impl SubClass < crate :: generated :: object :: Object > for VisibilityNotifier { } impl Instanciable for VisibilityNotifier { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { VisibilityNotifier :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct VisibilityNotifierMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_aabb : * mut sys :: godot_method_bind , pub is_on_screen : * mut sys :: godot_method_bind , pub set_aabb : * mut sys :: godot_method_bind } impl VisibilityNotifierMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : VisibilityNotifierMethodTable = VisibilityNotifierMethodTable { class_constructor : None , get_aabb : 0 as * mut sys :: godot_method_bind , is_on_screen : 0 as * mut sys :: godot_method_bind , set_aabb : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { VisibilityNotifierMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "VisibilityNotifier\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_aabb = (gd_api . godot_method_bind_get_method) (class_name , "get_aabb\0" . as_ptr () as * const c_char) ; table . is_on_screen = (gd_api . godot_method_bind_get_method) (class_name , "is_on_screen\0" . as_ptr () as * const c_char) ; table . set_aabb = (gd_api . godot_method_bind_get_method) (class_name , "set_aabb\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:52:2890 [INFO] [stdout] | [INFO] [stdout] 52 | ...thodTable { class_constructor : None , } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 52 | # [doc = "`tools class EditorResourcePreviewGenerator` inherits `Reference` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_editorresourcepreviewgenerator.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nEditorResourcePreviewGenerator inherits methods from:\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = "\n## Tool\n\nThis class is used to interact with Godot's editor."] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct EditorResourcePreviewGenerator { this : RawObject < Self > , } impl EditorResourcePreviewGenerator { } impl gdnative_core :: private :: godot_object :: Sealed for EditorResourcePreviewGenerator { } unsafe impl GodotObject for EditorResourcePreviewGenerator { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "EditorResourcePreviewGenerator" } } impl std :: ops :: Deref for EditorResourcePreviewGenerator { type Target = crate :: generated :: reference :: Reference ; # [inline] fn deref (& self) -> & crate :: generated :: reference :: Reference { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for EditorResourcePreviewGenerator { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: reference :: Reference { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: reference :: Reference > for EditorResourcePreviewGenerator { } unsafe impl SubClass < crate :: generated :: object :: Object > for EditorResourcePreviewGenerator { } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct EditorResourcePreviewGeneratorMethodTable { pub class_constructor : sys :: godot_class_constructor , } impl EditorResourcePreviewGeneratorMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : EditorResourcePreviewGeneratorMethodTable = EditorResourcePreviewGeneratorMethodTable { class_constructor : None , } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { EditorResourcePreviewGeneratorMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "EditorResourcePreviewGenerator\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:448:21662 [INFO] [stdout] | [INFO] [stdout] 448 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 448 | # [doc = "`core class PhysicsDirectBodyState` inherits `Object` (unsafe)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_physicsdirectbodystate.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = ""] # [doc = "\n## Class hierarchy\n\nPhysicsDirectBodyState inherits methods from:\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct PhysicsDirectBodyState { this : RawObject < Self > , } impl PhysicsDirectBodyState { # [doc = "Adds a constant directional force without affecting rotation.\nThis is equivalent to `add_force(force, Vector3(0,0,0))`."] # [doc = ""] # [inline] pub fn add_central_force (& self , force : Vector3) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = PhysicsDirectBodyStateMethodTable :: get (get_api ()) . add_central_force ; let ret = crate :: icalls :: icallptr_void_vec3 (method_bind , self . this . sys () . as_ptr () , force) ; } } # [doc = "Adds a positioned force to the body. Both the force and the offset from the body origin are in global coordinates."] # [doc = ""] # [inline] pub fn add_force (& self , force : Vector3 , position : Vector3) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = PhysicsDirectBodyStateMethodTable :: get (get_api ()) . add_force ; let ret = crate :: icalls :: icallptr_void_vec3_vec3 (method_bind , self . this . sys () . as_ptr () , force , position) ; } } # [doc = "Adds a constant rotational force without affecting position."] # [doc = ""] # [inline] pub fn add_torque (& self , torque : Vector3) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = PhysicsDirectBodyStateMethodTable :: get (get_api ()) . add_torque ; let ret = crate :: icalls :: icallptr_void_vec3 (method_bind , self . this . sys () . as_ptr () , torque) ; } } # [doc = "Applies a single directional impulse without affecting rotation.\nThis is equivalent to `apply_impulse(Vector3(0, 0, 0), impulse)`."] # [doc = ""] # [inline] pub fn apply_central_impulse (& self , j : Vector3) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = PhysicsDirectBodyStateMethodTable :: get (get_api ()) . apply_central_impulse ; let ret = crate :: icalls :: icallptr_void_vec3 (method_bind , self . this . sys () . as_ptr () , j) ; } } # [doc = "Applies a positioned impulse to the body. An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason it should only be used when simulating one-time impacts. The position uses the rotation of the global coordinate system, but is centered at the object's origin."] # [doc = ""] # [inline] pub fn apply_impulse (& self , position : Vector3 , j : Vector3) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = PhysicsDirectBodyStateMethodTable :: get (get_api ()) . apply_impulse ; let ret = crate :: icalls :: icallptr_void_vec3_vec3 (method_bind , self . this . sys () . as_ptr () , position , j) ; } } # [doc = "Apply a torque impulse (which will be affected by the body mass and shape). This will rotate the body around the vector `j` passed as parameter."] # [doc = ""] # [inline] pub fn apply_torque_impulse (& self , j : Vector3) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = PhysicsDirectBodyStateMethodTable :: get (get_api ()) . apply_torque_impulse ; let ret = crate :: icalls :: icallptr_void_vec3 (method_bind , self . this . sys () . as_ptr () , j) ; } } # [doc = "The body's rotational velocity."] # [doc = ""] # [inline] pub fn angular_velocity (& self) -> Vector3 { unsafe { let method_bind : * mut sys :: godot_method_bind = PhysicsDirectBodyStateMethodTable :: get (get_api ()) . get_angular_velocity ; let ret = crate :: icalls :: icallptr_vec3 (method_bind , self . this . sys () . as_ptr ()) ; mem :: transmute (ret) } } # [doc = ""] # [doc = ""] # [inline] pub fn center_of_mass (& self) -> Vector3 { unsafe { let method_bind : * mut sys :: godot_method_bind = PhysicsDirectBodyStateMethodTable :: get (get_api ()) . get_center_of_mass ; let ret = crate :: icalls :: icallptr_vec3 (method_bind , self . this . sys () . as_ptr ()) ; mem :: transmute (ret) } } # [doc = "Returns the collider's [RID]."] # [doc = ""] # [inline] pub fn get_contact_collider (& self , contact_idx : i64) -> Rid { unsafe { let method_bind : * mut sys :: godot_method_bind = PhysicsDirectBodyStateMethodTable :: get (get_api ()) . get_contact_collider ; let ret = crate :: icalls :: icallptr_rid_i64 (method_bind , self . this . sys () . as_ptr () , contact_idx) ; Rid :: from_sys (ret) } } # [doc = "Returns the collider's object id."] # [doc = ""] # [inline] pub fn get_contact_collider_id (& self , contact_idx : i64) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = PhysicsDirectBodyStateMethodTable :: get (get_api ()) . get_contact_collider_id ; let ret = crate :: icalls :: icallptr_i64_i64 (method_bind , self . this . sys () . as_ptr () , contact_idx) ; ret as _ } } # [doc = "Returns the collider object."] # [doc = ""] # [inline] pub fn get_contact_collider_object (& self , contact_idx : i64) -> Option < Ref < crate :: generated :: object :: Object , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = PhysicsDirectBodyStateMethodTable :: get (get_api ()) . get_contact_collider_object ; let ret = crate :: icalls :: icallptr_obj_i64 (method_bind , self . this . sys () . as_ptr () , contact_idx) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: object :: Object , thread_access :: Shared >> :: move_from_sys (sys)) } } # [doc = "Returns the contact position in the collider."] # [doc = ""] # [inline] pub fn get_contact_collider_position (& self , contact_idx : i64) -> Vector3 { unsafe { let method_bind : * mut sys :: godot_method_bind = PhysicsDirectBodyStateMethodTable :: get (get_api ()) . get_contact_collider_position ; let ret = crate :: icalls :: icallptr_vec3_i64 (method_bind , self . this . sys () . as_ptr () , contact_idx) ; mem :: transmute (ret) } } # [doc = "Returns the collider's shape index."] # [doc = ""] # [inline] pub fn get_contact_collider_shape (& self , contact_idx : i64) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = PhysicsDirectBodyStateMethodTable :: get (get_api ()) . get_contact_collider_shape ; let ret = crate :: icalls :: icallptr_i64_i64 (method_bind , self . this . sys () . as_ptr () , contact_idx) ; ret as _ } } # [doc = "Returns the linear velocity vector at the collider's contact point."] # [doc = ""] # [inline] pub fn get_contact_collider_velocity_at_position (& self , contact_idx : i64) -> Vector3 { unsafe { let method_bind : * mut sys :: godot_method_bind = PhysicsDirectBodyStateMethodTable :: get (get_api ()) . get_contact_collider_velocity_at_position ; let ret = crate :: icalls :: icallptr_vec3_i64 (method_bind , self . this . sys () . as_ptr () , contact_idx) ; mem :: transmute (ret) } } # [doc = "Returns the number of contacts this body has with other bodies.\n**Note:** By default, this returns 0 unless bodies are configured to monitor contacts. See [member RigidBody.contact_monitor]."] # [doc = ""] # [inline] pub fn get_contact_count (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = PhysicsDirectBodyStateMethodTable :: get (get_api ()) . get_contact_count ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Impulse created by the contact. Only implemented for Bullet physics."] # [doc = ""] # [inline] pub fn get_contact_impulse (& self , contact_idx : i64) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = PhysicsDirectBodyStateMethodTable :: get (get_api ()) . get_contact_impulse ; let ret = crate :: icalls :: icallptr_f64_i64 (method_bind , self . this . sys () . as_ptr () , contact_idx) ; ret as _ } } # [doc = "Returns the local normal at the contact point."] # [doc = ""] # [inline] pub fn get_contact_local_normal (& self , contact_idx : i64) -> Vector3 { unsafe { let method_bind : * mut sys :: godot_method_bind = PhysicsDirectBodyStateMethodTable :: get (get_api ()) . get_contact_local_normal ; let ret = crate :: icalls :: icallptr_vec3_i64 (method_bind , self . this . sys () . as_ptr () , contact_idx) ; mem :: transmute (ret) } } # [doc = "Returns the local position of the contact point."] # [doc = ""] # [inline] pub fn get_contact_local_position (& self , contact_idx : i64) -> Vector3 { unsafe { let method_bind : * mut sys :: godot_method_bind = PhysicsDirectBodyStateMethodTable :: get (get_api ()) . get_contact_local_position ; let ret = crate :: icalls :: icallptr_vec3_i64 (method_bind , self . this . sys () . as_ptr () , contact_idx) ; mem :: transmute (ret) } } # [doc = "Returns the local shape index of the collision."] # [doc = ""] # [inline] pub fn get_contact_local_shape (& self , contact_idx : i64) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = PhysicsDirectBodyStateMethodTable :: get (get_api ()) . get_contact_local_shape ; let ret = crate :: icalls :: icallptr_i64_i64 (method_bind , self . this . sys () . as_ptr () , contact_idx) ; ret as _ } } # [doc = "The inverse of the inertia of the body."] # [doc = ""] # [inline] pub fn inverse_inertia (& self) -> Vector3 { unsafe { let method_bind : * mut sys :: godot_method_bind = PhysicsDirectBodyStateMethodTable :: get (get_api ()) . get_inverse_inertia ; let ret = crate :: icalls :: icallptr_vec3 (method_bind , self . this . sys () . as_ptr ()) ; mem :: transmute (ret) } } # [doc = "The inverse of the mass of the body."] # [doc = ""] # [inline] pub fn inverse_mass (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = PhysicsDirectBodyStateMethodTable :: get (get_api ()) . get_inverse_mass ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "The body's linear velocity."] # [doc = ""] # [inline] pub fn linear_velocity (& self) -> Vector3 { unsafe { let method_bind : * mut sys :: godot_method_bind = PhysicsDirectBodyStateMethodTable :: get (get_api ()) . get_linear_velocity ; let ret = crate :: icalls :: icallptr_vec3 (method_bind , self . this . sys () . as_ptr ()) ; mem :: transmute (ret) } } # [doc = ""] # [doc = ""] # [inline] pub fn principal_inertia_axes (& self) -> Basis { unsafe { let method_bind : * mut sys :: godot_method_bind = PhysicsDirectBodyStateMethodTable :: get (get_api ()) . get_principal_inertia_axes ; let ret = crate :: icalls :: icallptr_basis (method_bind , self . this . sys () . as_ptr ()) ; mem :: transmute (ret) } } # [doc = "Returns the current state of the space, useful for queries."] # [doc = ""] # [inline] pub fn get_space_state (& self) -> Option < Ref < crate :: generated :: physics_direct_space_state :: PhysicsDirectSpaceState , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = PhysicsDirectBodyStateMethodTable :: get (get_api ()) . get_space_state ; let ret = crate :: icalls :: icallptr_obj (method_bind , self . this . sys () . as_ptr ()) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: physics_direct_space_state :: PhysicsDirectSpaceState , thread_access :: Shared >> :: move_from_sys (sys)) } } # [doc = "The timestep (delta) used for the simulation."] # [doc = ""] # [inline] pub fn step (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = PhysicsDirectBodyStateMethodTable :: get (get_api ()) . get_step ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "The rate at which the body stops rotating, if there are not any other forces moving it."] # [doc = ""] # [inline] pub fn total_angular_damp (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = PhysicsDirectBodyStateMethodTable :: get (get_api ()) . get_total_angular_damp ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "The total gravity vector being currently applied to this body."] # [doc = ""] # [inline] pub fn total_gravity (& self) -> Vector3 { unsafe { let method_bind : * mut sys :: godot_method_bind = PhysicsDirectBodyStateMethodTable :: get (get_api ()) . get_total_gravity ; let ret = crate :: icalls :: icallptr_vec3 (method_bind , self . this . sys () . as_ptr ()) ; mem :: transmute (ret) } } # [doc = "The rate at which the body stops moving, if there are not any other forces moving it."] # [doc = ""] # [inline] pub fn total_linear_damp (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = PhysicsDirectBodyStateMethodTable :: get (get_api ()) . get_total_linear_damp ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "The body's transformation matrix."] # [doc = ""] # [inline] pub fn transform (& self) -> Transform { unsafe { let method_bind : * mut sys :: godot_method_bind = PhysicsDirectBodyStateMethodTable :: get (get_api ()) . get_transform ; let ret = crate :: icalls :: icallptr_trans (method_bind , self . this . sys () . as_ptr ()) ; mem :: transmute (ret) } } # [doc = "Calls the built-in force integration code."] # [doc = ""] # [inline] pub fn integrate_forces (& self) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = PhysicsDirectBodyStateMethodTable :: get (get_api ()) . integrate_forces ; let ret = crate :: icalls :: icallptr_void (method_bind , self . this . sys () . as_ptr ()) ; } } # [doc = "If `true`, this body is currently sleeping (not active)."] # [doc = ""] # [inline] pub fn is_sleeping (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = PhysicsDirectBodyStateMethodTable :: get (get_api ()) . is_sleeping ; let ret = crate :: icalls :: icallptr_bool (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "The body's rotational velocity."] # [doc = ""] # [inline] pub fn set_angular_velocity (& self , velocity : Vector3) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = PhysicsDirectBodyStateMethodTable :: get (get_api ()) . set_angular_velocity ; let ret = crate :: icalls :: icallptr_void_vec3 (method_bind , self . this . sys () . as_ptr () , velocity) ; } } # [doc = "The body's linear velocity."] # [doc = ""] # [inline] pub fn set_linear_velocity (& self , velocity : Vector3) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = PhysicsDirectBodyStateMethodTable :: get (get_api ()) . set_linear_velocity ; let ret = crate :: icalls :: icallptr_void_vec3 (method_bind , self . this . sys () . as_ptr () , velocity) ; } } # [doc = "If `true`, this body is currently sleeping (not active)."] # [doc = ""] # [inline] pub fn set_sleep_state (& self , enabled : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = PhysicsDirectBodyStateMethodTable :: get (get_api ()) . set_sleep_state ; let ret = crate :: icalls :: icallptr_void_bool (method_bind , self . this . sys () . as_ptr () , enabled) ; } } # [doc = "The body's transformation matrix."] # [doc = ""] # [inline] pub fn set_transform (& self , transform : Transform) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = PhysicsDirectBodyStateMethodTable :: get (get_api ()) . set_transform ; let ret = crate :: icalls :: icallptr_void_trans (method_bind , self . this . sys () . as_ptr () , transform) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for PhysicsDirectBodyState { } unsafe impl GodotObject for PhysicsDirectBodyState { type RefKind = ref_kind :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "PhysicsDirectBodyState" } } impl std :: ops :: Deref for PhysicsDirectBodyState { type Target = crate :: generated :: object :: Object ; # [inline] fn deref (& self) -> & crate :: generated :: object :: Object { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for PhysicsDirectBodyState { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: object :: Object { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: object :: Object > for PhysicsDirectBodyState { } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct PhysicsDirectBodyStateMethodTable { pub class_constructor : sys :: godot_class_constructor , pub add_central_force : * mut sys :: godot_method_bind , pub add_force : * mut sys :: godot_method_bind , pub add_torque : * mut sys :: godot_method_bind , pub apply_central_impulse : * mut sys :: godot_method_bind , pub apply_impulse : * mut sys :: godot_method_bind , pub apply_torque_impulse : * mut sys :: godot_method_bind , pub get_angular_velocity : * mut sys :: godot_method_bind , pub get_center_of_mass : * mut sys :: godot_method_bind , pub get_contact_collider : * mut sys :: godot_method_bind , pub get_contact_collider_id : * mut sys :: godot_method_bind , pub get_contact_collider_object : * mut sys :: godot_method_bind , pub get_contact_collider_position : * mut sys :: godot_method_bind , pub get_contact_collider_shape : * mut sys :: godot_method_bind , pub get_contact_collider_velocity_at_position : * mut sys :: godot_method_bind , pub get_contact_count : * mut sys :: godot_method_bind , pub get_contact_impulse : * mut sys :: godot_method_bind , pub get_contact_local_normal : * mut sys :: godot_method_bind , pub get_contact_local_position : * mut sys :: godot_method_bind , pub get_contact_local_shape : * mut sys :: godot_method_bind , pub get_inverse_inertia : * mut sys :: godot_method_bind , pub get_inverse_mass : * mut sys :: godot_method_bind , pub get_linear_velocity : * mut sys :: godot_method_bind , pub get_principal_inertia_axes : * mut sys :: godot_method_bind , pub get_space_state : * mut sys :: godot_method_bind , pub get_step : * mut sys :: godot_method_bind , pub get_total_angular_damp : * mut sys :: godot_method_bind , pub get_total_gravity : * mut sys :: godot_method_bind , pub get_total_linear_damp : * mut sys :: godot_method_bind , pub get_transform : * mut sys :: godot_method_bind , pub integrate_forces : * mut sys :: godot_method_bind , pub is_sleeping : * mut sys :: godot_method_bind , pub set_angular_velocity : * mut sys :: godot_method_bind , pub set_linear_velocity : * mut sys :: godot_method_bind , pub set_sleep_state : * mut sys :: godot_method_bind , pub set_transform : * mut sys :: godot_method_bind } impl PhysicsDirectBodyStateMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : PhysicsDirectBodyStateMethodTable = PhysicsDirectBodyStateMethodTable { class_constructor : None , add_central_force : 0 as * mut sys :: godot_method_bind , add_force : 0 as * mut sys :: godot_method_bind , add_torque : 0 as * mut sys :: godot_method_bind , apply_central_impulse : 0 as * mut sys :: godot_method_bind , apply_impulse : 0 as * mut sys :: godot_method_bind , apply_torque_impulse : 0 as * mut sys :: godot_method_bind , get_angular_velocity : 0 as * mut sys :: godot_method_bind , get_center_of_mass : 0 as * mut sys :: godot_method_bind , get_contact_collider : 0 as * mut sys :: godot_method_bind , get_contact_collider_id : 0 as * mut sys :: godot_method_bind , get_contact_collider_object : 0 as * mut sys :: godot_method_bind , get_contact_collider_position : 0 as * mut sys :: godot_method_bind , get_contact_collider_shape : 0 as * mut sys :: godot_method_bind , get_contact_collider_velocity_at_position : 0 as * mut sys :: godot_method_bind , get_contact_count : 0 as * mut sys :: godot_method_bind , get_contact_impulse : 0 as * mut sys :: godot_method_bind , get_contact_local_normal : 0 as * mut sys :: godot_method_bind , get_contact_local_position : 0 as * mut sys :: godot_method_bind , get_contact_local_shape : 0 as * mut sys :: godot_method_bind , get_inverse_inertia : 0 as * mut sys :: godot_method_bind , get_inverse_mass : 0 as * mut sys :: godot_method_bind , get_linear_velocity : 0 as * mut sys :: godot_method_bind , get_principal_inertia_axes : 0 as * mut sys :: godot_method_bind , get_space_state : 0 as * mut sys :: godot_method_bind , get_step : 0 as * mut sys :: godot_method_bind , get_total_angular_damp : 0 as * mut sys :: godot_method_bind , get_total_gravity : 0 as * mut sys :: godot_method_bind , get_total_linear_damp : 0 as * mut sys :: godot_method_bind , get_transform : 0 as * mut sys :: godot_method_bind , integrate_forces : 0 as * mut sys :: godot_method_bind , is_sleeping : 0 as * mut sys :: godot_method_bind , set_angular_velocity : 0 as * mut sys :: godot_method_bind , set_linear_velocity : 0 as * mut sys :: godot_method_bind , set_sleep_state : 0 as * mut sys :: godot_method_bind , set_transform : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { PhysicsDirectBodyStateMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "PhysicsDirectBodyState\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . add_central_force = (gd_api . godot_method_bind_get_method) (class_name , "add_central_force\0" . as_ptr () as * const c_char) ; table . add_force = (gd_api . godot_method_bind_get_method) (class_name , "add_force\0" . as_ptr () as * const c_char) ; table . add_torque = (gd_api . godot_method_bind_get_method) (class_name , "add_torque\0" . as_ptr () as * const c_char) ; table . apply_central_impulse = (gd_api . godot_method_bind_get_method) (class_name , "apply_central_impulse\0" . as_ptr () as * const c_char) ; table . apply_impulse = (gd_api . godot_method_bind_get_method) (class_name , "apply_impulse\0" . as_ptr () as * const c_char) ; table . apply_torque_impulse = (gd_api . godot_method_bind_get_method) (class_name , "apply_torque_impulse\0" . as_ptr () as * const c_char) ; table . get_angular_velocity = (gd_api . godot_method_bind_get_method) (class_name , "get_angular_velocity\0" . as_ptr () as * const c_char) ; table . get_center_of_mass = (gd_api . godot_method_bind_get_method) (class_name , "get_center_of_mass\0" . as_ptr () as * const c_char) ; table . get_contact_collider = (gd_api . godot_method_bind_get_method) (class_name , "get_contact_collider\0" . as_ptr () as * const c_char) ; table . get_contact_collider_id = (gd_api . godot_method_bind_get_method) (class_name , "get_contact_collider_id\0" . as_ptr () as * const c_char) ; table . get_contact_collider_object = (gd_api . godot_method_bind_get_method) (class_name , "get_contact_collider_object\0" . as_ptr () as * const c_char) ; table . get_contact_collider_position = (gd_api . godot_method_bind_get_method) (class_name , "get_contact_collider_position\0" . as_ptr () as * const c_char) ; table . get_contact_collider_shape = (gd_api . godot_method_bind_get_method) (class_name , "get_contact_collider_shape\0" . as_ptr () as * const c_char) ; table . get_contact_collider_velocity_at_position = (gd_api . godot_method_bind_get_method) (class_name , "get_contact_collider_velocity_at_position\0" . as_ptr () as * const c_char) ; table . get_contact_count = (gd_api . godot_method_bind_get_method) (class_name , "get_contact_count\0" . as_ptr () as * const c_char) ; table . get_contact_impulse = (gd_api . godot_method_bind_get_method) (class_name , "get_contact_impulse\0" . as_ptr () as * const c_char) ; table . get_contact_local_normal = (gd_api . godot_method_bind_get_method) (class_name , "get_contact_local_normal\0" . as_ptr () as * const c_char) ; table . get_contact_local_position = (gd_api . godot_method_bind_get_method) (class_name , "get_contact_local_position\0" . as_ptr () as * const c_char) ; table . get_contact_local_shape = (gd_api . godot_method_bind_get_method) (class_name , "get_contact_local_shape\0" . as_ptr () as * const c_char) ; table . get_inverse_inertia = (gd_api . godot_method_bind_get_method) (class_name , "get_inverse_inertia\0" . as_ptr () as * const c_char) ; table . get_inverse_mass = (gd_api . godot_method_bind_get_method) (class_name , "get_inverse_mass\0" . as_ptr () as * const c_char) ; table . get_linear_velocity = (gd_api . godot_method_bind_get_method) (class_name , "get_linear_velocity\0" . as_ptr () as * const c_char) ; table . get_principal_inertia_axes = (gd_api . godot_method_bind_get_method) (class_name , "get_principal_inertia_axes\0" . as_ptr () as * const c_char) ; table . get_space_state = (gd_api . godot_method_bind_get_method) (class_name , "get_space_state\0" . as_ptr () as * const c_char) ; table . get_step = (gd_api . godot_method_bind_get_method) (class_name , "get_step\0" . as_ptr () as * const c_char) ; table . get_total_angular_damp = (gd_api . godot_method_bind_get_method) (class_name , "get_total_angular_damp\0" . as_ptr () as * const c_char) ; table . get_total_gravity = (gd_api . godot_method_bind_get_method) (class_name , "get_total_gravity\0" . as_ptr () as * const c_char) ; table . get_total_linear_damp = (gd_api . godot_method_bind_get_method) (class_name , "get_total_linear_damp\0" . as_ptr () as * const c_char) ; table . get_transform = (gd_api . godot_method_bind_get_method) (class_name , "get_transform\0" . as_ptr () as * const c_char) ; table . integrate_forces = (gd_api . godot_method_bind_get_method) (class_name , "integrate_forces\0" . as_ptr () as * const c_char) ; table . is_sleeping = (gd_api . godot_method_bind_get_method) (class_name , "is_sleeping\0" . as_ptr () as * const c_char) ; table . set_angular_velocity = (gd_api . godot_method_bind_get_method) (class_name , "set_angular_velocity\0" . as_ptr () as * const c_char) ; table . set_linear_velocity = (gd_api . godot_method_bind_get_method) (class_name , "set_linear_velocity\0" . as_ptr () as * const c_char) ; table . set_sleep_state = (gd_api . godot_method_bind_get_method) (class_name , "set_sleep_state\0" . as_ptr () as * const c_char) ; table . set_transform = (gd_api . godot_method_bind_get_method) (class_name , "set_transform\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:58:13122 [INFO] [stdout] | [INFO] [stdout] 58 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 58 | # [doc = "`core class AnimatedTexture` inherits `Texture` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_animatedtexture.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nAnimatedTexture inherits methods from:\n - [Texture](struct.Texture.html)\n - [Resource](struct.Resource.html)\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct AnimatedTexture { this : RawObject < Self > , } # [doc = "Constants"] # [allow (non_upper_case_globals)] impl AnimatedTexture { pub const MAX_FRAMES : i64 = 256i64 ; } impl AnimatedTexture { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AnimatedTextureMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "Sets the currently visible frame of the texture."] # [doc = ""] # [inline] pub fn current_frame (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimatedTextureMethodTable :: get (get_api ()) . get_current_frame ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Animation speed in frames per second. This value defines the default time interval between two frames of the animation, and thus the overall duration of the animation loop based on the [member frames] property. A value of 0 means no predefined number of frames per second, the animation will play according to each frame's frame delay (see [method set_frame_delay]).\nFor example, an animation with 8 frames, no frame delay and a `fps` value of 2 will run for 4 seconds, with each frame lasting 0.5 seconds."] # [doc = ""] # [inline] pub fn fps (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimatedTextureMethodTable :: get (get_api ()) . get_fps ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Returns the given frame's delay value."] # [doc = ""] # [inline] pub fn frame_delay (& self , frame : i64) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimatedTextureMethodTable :: get (get_api ()) . get_frame_delay ; let ret = crate :: icalls :: icallptr_f64_i64 (method_bind , self . this . sys () . as_ptr () , frame) ; ret as _ } } # [doc = "Returns the given frame's [Texture]."] # [doc = ""] # [inline] pub fn frame_texture (& self , frame : i64) -> Option < Ref < crate :: generated :: texture :: Texture , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimatedTextureMethodTable :: get (get_api ()) . get_frame_texture ; let ret = crate :: icalls :: icallptr_obj_i64 (method_bind , self . this . sys () . as_ptr () , frame) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: texture :: Texture , thread_access :: Shared >> :: move_from_sys (sys)) } } # [doc = "Number of frames to use in the animation. While you can create the frames independently with [method set_frame_texture], you need to set this value for the animation to take new frames into account. The maximum number of frames is [constant MAX_FRAMES]."] # [doc = ""] # [inline] pub fn frames (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimatedTextureMethodTable :: get (get_api ()) . get_frames ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "If `true`, the animation will only play once and will not loop back to the first frame after reaching the end. Note that reaching the end will not set [member pause] to `true`."] # [doc = ""] # [inline] pub fn oneshot (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimatedTextureMethodTable :: get (get_api ()) . get_oneshot ; let ret = crate :: icalls :: icallptr_bool (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "If `true`, the animation will pause where it currently is (i.e. at [member current_frame]). The animation will continue from where it was paused when changing this property to `false`."] # [doc = ""] # [inline] pub fn pause (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimatedTextureMethodTable :: get (get_api ()) . get_pause ; let ret = crate :: icalls :: icallptr_bool (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Sets the currently visible frame of the texture."] # [doc = ""] # [inline] pub fn set_current_frame (& self , frame : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimatedTextureMethodTable :: get (get_api ()) . set_current_frame ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , frame) ; } } # [doc = "Animation speed in frames per second. This value defines the default time interval between two frames of the animation, and thus the overall duration of the animation loop based on the [member frames] property. A value of 0 means no predefined number of frames per second, the animation will play according to each frame's frame delay (see [method set_frame_delay]).\nFor example, an animation with 8 frames, no frame delay and a `fps` value of 2 will run for 4 seconds, with each frame lasting 0.5 seconds."] # [doc = ""] # [inline] pub fn set_fps (& self , fps : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimatedTextureMethodTable :: get (get_api ()) . set_fps ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , fps) ; } } # [doc = "_Sample code is GDScript unless otherwise noted._\n\nSets an additional delay (in seconds) between this frame and the next one, that will be added to the time interval defined by [member fps]. By default, frames have no delay defined. If a delay value is defined, the final time interval between this frame and the next will be `1.0 / fps + delay`.\nFor example, for an animation with 3 frames, 2 FPS and a frame delay on the second frame of 1.2, the resulting playback will be:\n```gdscript\nFrame 0: 0.5 s (1 / fps)\nFrame 1: 1.7 s (1 / fps + 1.2)\nFrame 2: 0.5 s (1 / fps)\nTotal duration: 2.7 s\n```"] # [doc = ""] # [inline] pub fn set_frame_delay (& self , frame : i64 , delay : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimatedTextureMethodTable :: get (get_api ()) . set_frame_delay ; let ret = crate :: icalls :: icallptr_void_i64_f64 (method_bind , self . this . sys () . as_ptr () , frame , delay) ; } } # [doc = "Assigns a [Texture] to the given frame. Frame IDs start at 0, so the first frame has ID 0, and the last frame of the animation has ID [member frames] - 1.\nYou can define any number of textures up to [constant MAX_FRAMES], but keep in mind that only frames from 0 to [member frames] - 1 will be part of the animation."] # [doc = ""] # [inline] pub fn set_frame_texture (& self , frame : i64 , texture : impl AsArg < crate :: generated :: texture :: Texture >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimatedTextureMethodTable :: get (get_api ()) . set_frame_texture ; let ret = crate :: icalls :: icallptr_void_i64_obj (method_bind , self . this . sys () . as_ptr () , frame , texture . as_arg_ptr ()) ; } } # [doc = "Number of frames to use in the animation. While you can create the frames independently with [method set_frame_texture], you need to set this value for the animation to take new frames into account. The maximum number of frames is [constant MAX_FRAMES]."] # [doc = ""] # [inline] pub fn set_frames (& self , frames : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimatedTextureMethodTable :: get (get_api ()) . set_frames ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , frames) ; } } # [doc = "If `true`, the animation will only play once and will not loop back to the first frame after reaching the end. Note that reaching the end will not set [member pause] to `true`."] # [doc = ""] # [inline] pub fn set_oneshot (& self , oneshot : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimatedTextureMethodTable :: get (get_api ()) . set_oneshot ; let ret = crate :: icalls :: icallptr_void_bool (method_bind , self . this . sys () . as_ptr () , oneshot) ; } } # [doc = "If `true`, the animation will pause where it currently is (i.e. at [member current_frame]). The animation will continue from where it was paused when changing this property to `false`."] # [doc = ""] # [inline] pub fn set_pause (& self , pause : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimatedTextureMethodTable :: get (get_api ()) . set_pause ; let ret = crate :: icalls :: icallptr_void_bool (method_bind , self . this . sys () . as_ptr () , pause) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for AnimatedTexture { } unsafe impl GodotObject for AnimatedTexture { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AnimatedTexture" } } impl std :: ops :: Deref for AnimatedTexture { type Target = crate :: generated :: texture :: Texture ; # [inline] fn deref (& self) -> & crate :: generated :: texture :: Texture { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AnimatedTexture { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: texture :: Texture { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: texture :: Texture > for AnimatedTexture { } unsafe impl SubClass < crate :: generated :: resource :: Resource > for AnimatedTexture { } unsafe impl SubClass < crate :: generated :: reference :: Reference > for AnimatedTexture { } unsafe impl SubClass < crate :: generated :: object :: Object > for AnimatedTexture { } impl Instanciable for AnimatedTexture { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { AnimatedTexture :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AnimatedTextureMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_current_frame : * mut sys :: godot_method_bind , pub get_fps : * mut sys :: godot_method_bind , pub get_frame_delay : * mut sys :: godot_method_bind , pub get_frame_texture : * mut sys :: godot_method_bind , pub get_frames : * mut sys :: godot_method_bind , pub get_oneshot : * mut sys :: godot_method_bind , pub get_pause : * mut sys :: godot_method_bind , pub set_current_frame : * mut sys :: godot_method_bind , pub set_fps : * mut sys :: godot_method_bind , pub set_frame_delay : * mut sys :: godot_method_bind , pub set_frame_texture : * mut sys :: godot_method_bind , pub set_frames : * mut sys :: godot_method_bind , pub set_oneshot : * mut sys :: godot_method_bind , pub set_pause : * mut sys :: godot_method_bind } impl AnimatedTextureMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AnimatedTextureMethodTable = AnimatedTextureMethodTable { class_constructor : None , get_current_frame : 0 as * mut sys :: godot_method_bind , get_fps : 0 as * mut sys :: godot_method_bind , get_frame_delay : 0 as * mut sys :: godot_method_bind , get_frame_texture : 0 as * mut sys :: godot_method_bind , get_frames : 0 as * mut sys :: godot_method_bind , get_oneshot : 0 as * mut sys :: godot_method_bind , get_pause : 0 as * mut sys :: godot_method_bind , set_current_frame : 0 as * mut sys :: godot_method_bind , set_fps : 0 as * mut sys :: godot_method_bind , set_frame_delay : 0 as * mut sys :: godot_method_bind , set_frame_texture : 0 as * mut sys :: godot_method_bind , set_frames : 0 as * mut sys :: godot_method_bind , set_oneshot : 0 as * mut sys :: godot_method_bind , set_pause : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { AnimatedTextureMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AnimatedTexture\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_current_frame = (gd_api . godot_method_bind_get_method) (class_name , "get_current_frame\0" . as_ptr () as * const c_char) ; table . get_fps = (gd_api . godot_method_bind_get_method) (class_name , "get_fps\0" . as_ptr () as * const c_char) ; table . get_frame_delay = (gd_api . godot_method_bind_get_method) (class_name , "get_frame_delay\0" . as_ptr () as * const c_char) ; table . get_frame_texture = (gd_api . godot_method_bind_get_method) (class_name , "get_frame_texture\0" . as_ptr () as * const c_char) ; table . get_frames = (gd_api . godot_method_bind_get_method) (class_name , "get_frames\0" . as_ptr () as * const c_char) ; table . get_oneshot = (gd_api . godot_method_bind_get_method) (class_name , "get_oneshot\0" . as_ptr () as * const c_char) ; table . get_pause = (gd_api . godot_method_bind_get_method) (class_name , "get_pause\0" . as_ptr () as * const c_char) ; table . set_current_frame = (gd_api . godot_method_bind_get_method) (class_name , "set_current_frame\0" . as_ptr () as * const c_char) ; table . set_fps = (gd_api . godot_method_bind_get_method) (class_name , "set_fps\0" . as_ptr () as * const c_char) ; table . set_frame_delay = (gd_api . godot_method_bind_get_method) (class_name , "set_frame_delay\0" . as_ptr () as * const c_char) ; table . set_frame_texture = (gd_api . godot_method_bind_get_method) (class_name , "set_frame_texture\0" . as_ptr () as * const c_char) ; table . set_frames = (gd_api . godot_method_bind_get_method) (class_name , "set_frames\0" . as_ptr () as * const c_char) ; table . set_oneshot = (gd_api . godot_method_bind_get_method) (class_name , "set_oneshot\0" . as_ptr () as * const c_char) ; table . set_pause = (gd_api . godot_method_bind_get_method) (class_name , "set_pause\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:64:4445 [INFO] [stdout] | [INFO] [stdout] 64 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 64 | # [doc = "`core class ConvexPolygonShape` inherits `Shape` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_convexpolygonshape.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nConvexPolygonShape inherits methods from:\n - [Shape](struct.Shape.html)\n - [Resource](struct.Resource.html)\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct ConvexPolygonShape { this : RawObject < Self > , } impl ConvexPolygonShape { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = ConvexPolygonShapeMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "The list of 3D points forming the convex polygon shape."] # [doc = ""] # [inline] pub fn points (& self) -> Vector3Array { unsafe { let method_bind : * mut sys :: godot_method_bind = ConvexPolygonShapeMethodTable :: get (get_api ()) . get_points ; let ret = crate :: icalls :: icallptr_vec3arr (method_bind , self . this . sys () . as_ptr ()) ; Vector3Array :: from_sys (ret) } } # [doc = "The list of 3D points forming the convex polygon shape."] # [doc = ""] # [inline] pub fn set_points (& self , points : Vector3Array) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = ConvexPolygonShapeMethodTable :: get (get_api ()) . set_points ; let ret = crate :: icalls :: icallptr_void_vec3arr (method_bind , self . this . sys () . as_ptr () , points) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for ConvexPolygonShape { } unsafe impl GodotObject for ConvexPolygonShape { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "ConvexPolygonShape" } } impl std :: ops :: Deref for ConvexPolygonShape { type Target = crate :: generated :: shape :: Shape ; # [inline] fn deref (& self) -> & crate :: generated :: shape :: Shape { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for ConvexPolygonShape { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: shape :: Shape { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: shape :: Shape > for ConvexPolygonShape { } unsafe impl SubClass < crate :: generated :: resource :: Resource > for ConvexPolygonShape { } unsafe impl SubClass < crate :: generated :: reference :: Reference > for ConvexPolygonShape { } unsafe impl SubClass < crate :: generated :: object :: Object > for ConvexPolygonShape { } impl Instanciable for ConvexPolygonShape { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { ConvexPolygonShape :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct ConvexPolygonShapeMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_points : * mut sys :: godot_method_bind , pub set_points : * mut sys :: godot_method_bind } impl ConvexPolygonShapeMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : ConvexPolygonShapeMethodTable = ConvexPolygonShapeMethodTable { class_constructor : None , get_points : 0 as * mut sys :: godot_method_bind , set_points : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { ConvexPolygonShapeMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "ConvexPolygonShape\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_points = (gd_api . godot_method_bind_get_method) (class_name , "get_points\0" . as_ptr () as * const c_char) ; table . set_points = (gd_api . godot_method_bind_get_method) (class_name , "set_points\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:76:8153 [INFO] [stdout] | [INFO] [stdout] 76 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 76 | # [doc = "`core class VisualInstance` inherits `Spatial` (unsafe)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_visualinstance.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = ""] # [doc = "\n## Class hierarchy\n\nVisualInstance inherits methods from:\n - [Spatial](struct.Spatial.html)\n - [Node](struct.Node.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct VisualInstance { this : RawObject < Self > , } impl VisualInstance { # [doc = "Returns the [AABB] (also known as the bounding box) for this [VisualInstance]. See also [method get_transformed_aabb]."] # [doc = ""] # [inline] pub fn get_aabb (& self) -> Aabb { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualInstanceMethodTable :: get (get_api ()) . get_aabb ; let ret = crate :: icalls :: icallptr_aabb (method_bind , self . this . sys () . as_ptr ()) ; mem :: transmute (ret) } } # [doc = "Returns the RID of the resource associated with this [VisualInstance]. For example, if the Node is a [MeshInstance], this will return the RID of the associated [Mesh]."] # [doc = ""] # [inline] pub fn get_base (& self) -> Rid { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualInstanceMethodTable :: get (get_api ()) . get_base ; let ret = crate :: icalls :: icallptr_rid (method_bind , self . this . sys () . as_ptr ()) ; Rid :: from_sys (ret) } } # [doc = "Returns the RID of this instance. This RID is the same as the RID returned by [method VisualServer.instance_create]. This RID is needed if you want to call [VisualServer] functions directly on this [VisualInstance]."] # [doc = ""] # [inline] pub fn get_instance (& self) -> Rid { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualInstanceMethodTable :: get (get_api ()) . get_instance ; let ret = crate :: icalls :: icallptr_rid (method_bind , self . this . sys () . as_ptr ()) ; Rid :: from_sys (ret) } } # [doc = "The render layer(s) this [VisualInstance] is drawn on.\nThis object will only be visible for [Camera]s whose cull mask includes the render object this [VisualInstance] is set to."] # [doc = ""] # [inline] pub fn layer_mask (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualInstanceMethodTable :: get (get_api ()) . get_layer_mask ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Returns `true` when the specified layer is enabled in [member layers] and `false` otherwise."] # [doc = ""] # [inline] pub fn get_layer_mask_bit (& self , layer : i64) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualInstanceMethodTable :: get (get_api ()) . get_layer_mask_bit ; let ret = crate :: icalls :: icallptr_bool_i64 (method_bind , self . this . sys () . as_ptr () , layer) ; ret as _ } } # [doc = "Returns the transformed [AABB] (also known as the bounding box) for this [VisualInstance].\nTransformed in this case means the [AABB] plus the position, rotation, and scale of the [Spatial]'s [Transform]. See also [method get_aabb]."] # [doc = ""] # [inline] pub fn get_transformed_aabb (& self) -> Aabb { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualInstanceMethodTable :: get (get_api ()) . get_transformed_aabb ; let ret = crate :: icalls :: icallptr_aabb (method_bind , self . this . sys () . as_ptr ()) ; mem :: transmute (ret) } } # [doc = "Sets the resource that is instantiated by this [VisualInstance], which changes how the engine handles the [VisualInstance] under the hood. Equivalent to [method VisualServer.instance_set_base]."] # [doc = ""] # [inline] pub fn set_base (& self , base : Rid) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualInstanceMethodTable :: get (get_api ()) . set_base ; let ret = crate :: icalls :: icallptr_void_rid (method_bind , self . this . sys () . as_ptr () , base) ; } } # [doc = "The render layer(s) this [VisualInstance] is drawn on.\nThis object will only be visible for [Camera]s whose cull mask includes the render object this [VisualInstance] is set to."] # [doc = ""] # [inline] pub fn set_layer_mask (& self , mask : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualInstanceMethodTable :: get (get_api ()) . set_layer_mask ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , mask) ; } } # [doc = "Enables a particular layer in [member layers]."] # [doc = ""] # [inline] pub fn set_layer_mask_bit (& self , layer : i64 , enabled : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualInstanceMethodTable :: get (get_api ()) . set_layer_mask_bit ; let ret = crate :: icalls :: icallptr_void_i64_bool (method_bind , self . this . sys () . as_ptr () , layer , enabled) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for VisualInstance { } unsafe impl GodotObject for VisualInstance { type RefKind = ref_kind :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "VisualInstance" } } impl QueueFree for VisualInstance { # [inline] unsafe fn godot_queue_free (obj : * mut sys :: godot_object) { let method_bind : * mut sys :: godot_method_bind = crate :: generated :: node :: NodeMethodTable :: get (get_api ()) . queue_free ; crate :: icalls :: icallptr_void (method_bind , obj) } } impl std :: ops :: Deref for VisualInstance { type Target = crate :: generated :: spatial :: Spatial ; # [inline] fn deref (& self) -> & crate :: generated :: spatial :: Spatial { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for VisualInstance { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: spatial :: Spatial { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: spatial :: Spatial > for VisualInstance { } unsafe impl SubClass < crate :: generated :: node :: Node > for VisualInstance { } unsafe impl SubClass < crate :: generated :: object :: Object > for VisualInstance { } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct VisualInstanceMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_aabb : * mut sys :: godot_method_bind , pub get_base : * mut sys :: godot_method_bind , pub get_instance : * mut sys :: godot_method_bind , pub get_layer_mask : * mut sys :: godot_method_bind , pub get_layer_mask_bit : * mut sys :: godot_method_bind , pub get_transformed_aabb : * mut sys :: godot_method_bind , pub set_base : * mut sys :: godot_method_bind , pub set_layer_mask : * mut sys :: godot_method_bind , pub set_layer_mask_bit : * mut sys :: godot_method_bind } impl VisualInstanceMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : VisualInstanceMethodTable = VisualInstanceMethodTable { class_constructor : None , get_aabb : 0 as * mut sys :: godot_method_bind , get_base : 0 as * mut sys :: godot_method_bind , get_instance : 0 as * mut sys :: godot_method_bind , get_layer_mask : 0 as * mut sys :: godot_method_bind , get_layer_mask_bit : 0 as * mut sys :: godot_method_bind , get_transformed_aabb : 0 as * mut sys :: godot_method_bind , set_base : 0 as * mut sys :: godot_method_bind , set_layer_mask : 0 as * mut sys :: godot_method_bind , set_layer_mask_bit : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { VisualInstanceMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "VisualInstance\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_aabb = (gd_api . godot_method_bind_get_method) (class_name , "get_aabb\0" . as_ptr () as * const c_char) ; table . get_base = (gd_api . godot_method_bind_get_method) (class_name , "get_base\0" . as_ptr () as * const c_char) ; table . get_instance = (gd_api . godot_method_bind_get_method) (class_name , "get_instance\0" . as_ptr () as * const c_char) ; table . get_layer_mask = (gd_api . godot_method_bind_get_method) (class_name , "get_layer_mask\0" . as_ptr () as * const c_char) ; table . get_layer_mask_bit = (gd_api . godot_method_bind_get_method) (class_name , "get_layer_mask_bit\0" . as_ptr () as * const c_char) ; table . get_transformed_aabb = (gd_api . godot_method_bind_get_method) (class_name , "get_transformed_aabb\0" . as_ptr () as * const c_char) ; table . set_base = (gd_api . godot_method_bind_get_method) (class_name , "set_base\0" . as_ptr () as * const c_char) ; table . set_layer_mask = (gd_api . godot_method_bind_get_method) (class_name , "set_layer_mask\0" . as_ptr () as * const c_char) ; table . set_layer_mask_bit = (gd_api . godot_method_bind_get_method) (class_name , "set_layer_mask_bit\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:454:21646 [INFO] [stdout] | [INFO] [stdout] 454 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 454 | # [doc = "`core class GraphEdit` inherits `Control` (unsafe)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_graphedit.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nNon reference counted objects such as the ones of this type are usually owned by the engine.\n\n`GraphEdit` is a reference-only type. Persistent references can\nonly exist in the unsafe `Ref` form.\n\nIn the cases where Rust code owns an object of this type, for example if the object was just\ncreated on the Rust side and not passed to the engine yet, ownership should be either given\nto the engine or the object must be manually destroyed using `Ref::free`, or `Ref::queue_free`\nif it is a `Node`."] # [doc = "\n## Class hierarchy\n\nGraphEdit inherits methods from:\n - [Control](struct.Control.html)\n - [CanvasItem](struct.CanvasItem.html)\n - [Node](struct.Node.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct GraphEdit { this : RawObject < Self > , } impl GraphEdit { # [doc = "Creates a new instance of this object.\n\nBecause this type is not reference counted, the lifetime of the returned object\nis *not* automatically managed.\n\nImmediately after creation, the object is owned by the caller, and can be\npassed to the engine (in which case the engine will be responsible for\ndestroying the object) or destroyed manually using `Ref::free`, or preferably\n`Ref::queue_free` if it is a `Node`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = GraphEditMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "Makes possible the connection between two different slot types. The type is defined with the [method GraphNode.set_slot] method."] # [doc = ""] # [inline] pub fn add_valid_connection_type (& self , from_type : i64 , to_type : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = GraphEditMethodTable :: get (get_api ()) . add_valid_connection_type ; let ret = crate :: icalls :: icallptr_void_i64_i64 (method_bind , self . this . sys () . as_ptr () , from_type , to_type) ; } } # [doc = "Makes possible to disconnect nodes when dragging from the slot at the left if it has the specified type."] # [doc = ""] # [inline] pub fn add_valid_left_disconnect_type (& self , _type : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = GraphEditMethodTable :: get (get_api ()) . add_valid_left_disconnect_type ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , _type) ; } } # [doc = "Makes possible to disconnect nodes when dragging from the slot at the right if it has the specified type."] # [doc = ""] # [inline] pub fn add_valid_right_disconnect_type (& self , _type : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = GraphEditMethodTable :: get (get_api ()) . add_valid_right_disconnect_type ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , _type) ; } } # [doc = "Removes all connections between nodes."] # [doc = ""] # [inline] pub fn clear_connections (& self) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = GraphEditMethodTable :: get (get_api ()) . clear_connections ; let ret = crate :: icalls :: icallptr_void (method_bind , self . this . sys () . as_ptr ()) ; } } # [doc = "Create a connection between the `from_port` slot of the `from` GraphNode and the `to_port` slot of the `to` GraphNode. If the connection already exists, no connection is created."] # [doc = ""] # [inline] pub fn connect_node (& self , from : impl Into < GodotString > , from_port : i64 , to : impl Into < GodotString > , to_port : i64) -> GodotResult { unsafe { let method_bind : * mut sys :: godot_method_bind = GraphEditMethodTable :: get (get_api ()) . connect_node ; let ret = crate :: icalls :: icallptr_i64_str_i64_str_i64 (method_bind , self . this . sys () . as_ptr () , from . into () , from_port , to . into () , to_port) ; GodotError :: result_from_sys (ret as _) } } # [doc = "Removes the connection between the `from_port` slot of the `from` GraphNode and the `to_port` slot of the `to` GraphNode. If the connection does not exist, no connection is removed."] # [doc = ""] # [inline] pub fn disconnect_node (& self , from : impl Into < GodotString > , from_port : i64 , to : impl Into < GodotString > , to_port : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = GraphEditMethodTable :: get (get_api ()) . disconnect_node ; let ret = crate :: icalls :: icallptr_void_str_i64_str_i64 (method_bind , self . this . sys () . as_ptr () , from . into () , from_port , to . into () , to_port) ; } } # [doc = "Returns an Array containing the list of connections. A connection consists in a structure of the form `{ from_port: 0, from: \"GraphNode name 0\", to_port: 1, to: \"GraphNode name 1\" }`."] # [doc = ""] # [inline] pub fn get_connection_list (& self) -> VariantArray { unsafe { let method_bind : * mut sys :: godot_method_bind = GraphEditMethodTable :: get (get_api ()) . get_connection_list ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < VariantArray > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = ""] # [doc = ""] # [inline] pub fn minimap_opacity (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = GraphEditMethodTable :: get (get_api ()) . get_minimap_opacity ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = ""] # [doc = ""] # [inline] pub fn minimap_size (& self) -> Vector2 { unsafe { let method_bind : * mut sys :: godot_method_bind = GraphEditMethodTable :: get (get_api ()) . get_minimap_size ; let ret = crate :: icalls :: icallptr_vec2 (method_bind , self . this . sys () . as_ptr ()) ; mem :: transmute (ret) } } # [doc = "The scroll offset."] # [doc = ""] # [inline] pub fn scroll_ofs (& self) -> Vector2 { unsafe { let method_bind : * mut sys :: godot_method_bind = GraphEditMethodTable :: get (get_api ()) . get_scroll_ofs ; let ret = crate :: icalls :: icallptr_vec2 (method_bind , self . this . sys () . as_ptr ()) ; mem :: transmute (ret) } } # [doc = "The snapping distance in pixels."] # [doc = ""] # [inline] pub fn snap (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = GraphEditMethodTable :: get (get_api ()) . get_snap ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "The current zoom value."] # [doc = ""] # [inline] pub fn zoom (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = GraphEditMethodTable :: get (get_api ()) . get_zoom ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Gets the [HBoxContainer] that contains the zooming and grid snap controls in the top left of the graph.\nWarning: The intended usage of this function is to allow you to reposition or add your own custom controls to the container. This is an internal control and as such should not be freed. If you wish to hide this or any of it's children use their [member CanvasItem.visible] property instead."] # [doc = ""] # [inline] pub fn get_zoom_hbox (& self) -> Option < Ref < crate :: generated :: hbox_container :: HBoxContainer , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = GraphEditMethodTable :: get (get_api ()) . get_zoom_hbox ; let ret = crate :: icalls :: icallptr_obj (method_bind , self . this . sys () . as_ptr ()) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: hbox_container :: HBoxContainer , thread_access :: Shared >> :: move_from_sys (sys)) } } # [doc = ""] # [doc = ""] # [inline] pub fn is_minimap_enabled (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = GraphEditMethodTable :: get (get_api ()) . is_minimap_enabled ; let ret = crate :: icalls :: icallptr_bool (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Returns `true` if the `from_port` slot of the `from` GraphNode is connected to the `to_port` slot of the `to` GraphNode."] # [doc = ""] # [inline] pub fn is_node_connected (& self , from : impl Into < GodotString > , from_port : i64 , to : impl Into < GodotString > , to_port : i64) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = GraphEditMethodTable :: get (get_api ()) . is_node_connected ; let ret = crate :: icalls :: icallptr_bool_str_i64_str_i64 (method_bind , self . this . sys () . as_ptr () , from . into () , from_port , to . into () , to_port) ; ret as _ } } # [doc = "If `true`, enables disconnection of existing connections in the GraphEdit by dragging the right end."] # [doc = ""] # [inline] pub fn is_right_disconnects_enabled (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = GraphEditMethodTable :: get (get_api ()) . is_right_disconnects_enabled ; let ret = crate :: icalls :: icallptr_bool (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "If `true`, enables snapping."] # [doc = ""] # [inline] pub fn is_using_snap (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = GraphEditMethodTable :: get (get_api ()) . is_using_snap ; let ret = crate :: icalls :: icallptr_bool (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Returns whether it's possible to connect slots of the specified types."] # [doc = ""] # [inline] pub fn is_valid_connection_type (& self , from_type : i64 , to_type : i64) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = GraphEditMethodTable :: get (get_api ()) . is_valid_connection_type ; let ret = crate :: icalls :: icallptr_bool_i64_i64 (method_bind , self . this . sys () . as_ptr () , from_type , to_type) ; ret as _ } } # [doc = "Makes it not possible to connect between two different slot types. The type is defined with the [method GraphNode.set_slot] method."] # [doc = ""] # [inline] pub fn remove_valid_connection_type (& self , from_type : i64 , to_type : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = GraphEditMethodTable :: get (get_api ()) . remove_valid_connection_type ; let ret = crate :: icalls :: icallptr_void_i64_i64 (method_bind , self . this . sys () . as_ptr () , from_type , to_type) ; } } # [doc = "Removes the possibility to disconnect nodes when dragging from the slot at the left if it has the specified type."] # [doc = ""] # [inline] pub fn remove_valid_left_disconnect_type (& self , _type : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = GraphEditMethodTable :: get (get_api ()) . remove_valid_left_disconnect_type ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , _type) ; } } # [doc = "Removes the possibility to disconnect nodes when dragging from the slot at the right if it has the specified type."] # [doc = ""] # [inline] pub fn remove_valid_right_disconnect_type (& self , _type : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = GraphEditMethodTable :: get (get_api ()) . remove_valid_right_disconnect_type ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , _type) ; } } # [doc = "Sets the coloration of the connection between `from`'s `from_port` and `to`'s `to_port` with the color provided in the `activity` theme property."] # [doc = ""] # [inline] pub fn set_connection_activity (& self , from : impl Into < GodotString > , from_port : i64 , to : impl Into < GodotString > , to_port : i64 , amount : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = GraphEditMethodTable :: get (get_api ()) . set_connection_activity ; let ret = crate :: icalls :: icallptr_void_str_i64_str_i64_f64 (method_bind , self . this . sys () . as_ptr () , from . into () , from_port , to . into () , to_port , amount) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn set_minimap_enabled (& self , enable : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = GraphEditMethodTable :: get (get_api ()) . set_minimap_enabled ; let ret = crate :: icalls :: icallptr_void_bool (method_bind , self . this . sys () . as_ptr () , enable) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn set_minimap_opacity (& self , p_opacity : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = GraphEditMethodTable :: get (get_api ()) . set_minimap_opacity ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , p_opacity) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn set_minimap_size (& self , p_size : Vector2) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = GraphEditMethodTable :: get (get_api ()) . set_minimap_size ; let ret = crate :: icalls :: icallptr_void_vec2 (method_bind , self . this . sys () . as_ptr () , p_size) ; } } # [doc = "If `true`, enables disconnection of existing connections in the GraphEdit by dragging the right end."] # [doc = ""] # [inline] pub fn set_right_disconnects (& self , enable : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = GraphEditMethodTable :: get (get_api ()) . set_right_disconnects ; let ret = crate :: icalls :: icallptr_void_bool (method_bind , self . this . sys () . as_ptr () , enable) ; } } # [doc = "The scroll offset."] # [doc = ""] # [inline] pub fn set_scroll_ofs (& self , ofs : Vector2) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = GraphEditMethodTable :: get (get_api ()) . set_scroll_ofs ; let ret = crate :: icalls :: icallptr_void_vec2 (method_bind , self . this . sys () . as_ptr () , ofs) ; } } # [doc = "Sets the specified `node` as the one selected."] # [doc = ""] # [inline] pub fn set_selected (& self , node : impl AsArg < crate :: generated :: node :: Node >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = GraphEditMethodTable :: get (get_api ()) . set_selected ; let ret = crate :: icalls :: icallptr_void_obj (method_bind , self . this . sys () . as_ptr () , node . as_arg_ptr ()) ; } } # [doc = "The snapping distance in pixels."] # [doc = ""] # [inline] pub fn set_snap (& self , pixels : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = GraphEditMethodTable :: get (get_api ()) . set_snap ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , pixels) ; } } # [doc = "If `true`, enables snapping."] # [doc = ""] # [inline] pub fn set_use_snap (& self , enable : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = GraphEditMethodTable :: get (get_api ()) . set_use_snap ; let ret = crate :: icalls :: icallptr_void_bool (method_bind , self . this . sys () . as_ptr () , enable) ; } } # [doc = "The current zoom value."] # [doc = ""] # [inline] pub fn set_zoom (& self , p_zoom : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = GraphEditMethodTable :: get (get_api ()) . set_zoom ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , p_zoom) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for GraphEdit { } unsafe impl GodotObject for GraphEdit { type RefKind = ref_kind :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "GraphEdit" } } impl QueueFree for GraphEdit { # [inline] unsafe fn godot_queue_free (obj : * mut sys :: godot_object) { let method_bind : * mut sys :: godot_method_bind = crate :: generated :: node :: NodeMethodTable :: get (get_api ()) . queue_free ; crate :: icalls :: icallptr_void (method_bind , obj) } } impl std :: ops :: Deref for GraphEdit { type Target = crate :: generated :: control :: Control ; # [inline] fn deref (& self) -> & crate :: generated :: control :: Control { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for GraphEdit { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: control :: Control { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: control :: Control > for GraphEdit { } unsafe impl SubClass < crate :: generated :: canvas_item :: CanvasItem > for GraphEdit { } unsafe impl SubClass < crate :: generated :: node :: Node > for GraphEdit { } unsafe impl SubClass < crate :: generated :: object :: Object > for GraphEdit { } impl Instanciable for GraphEdit { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { GraphEdit :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct GraphEditMethodTable { pub class_constructor : sys :: godot_class_constructor , pub add_valid_connection_type : * mut sys :: godot_method_bind , pub add_valid_left_disconnect_type : * mut sys :: godot_method_bind , pub add_valid_right_disconnect_type : * mut sys :: godot_method_bind , pub clear_connections : * mut sys :: godot_method_bind , pub connect_node : * mut sys :: godot_method_bind , pub disconnect_node : * mut sys :: godot_method_bind , pub get_connection_list : * mut sys :: godot_method_bind , pub get_minimap_opacity : * mut sys :: godot_method_bind , pub get_minimap_size : * mut sys :: godot_method_bind , pub get_scroll_ofs : * mut sys :: godot_method_bind , pub get_snap : * mut sys :: godot_method_bind , pub get_zoom : * mut sys :: godot_method_bind , pub get_zoom_hbox : * mut sys :: godot_method_bind , pub is_minimap_enabled : * mut sys :: godot_method_bind , pub is_node_connected : * mut sys :: godot_method_bind , pub is_right_disconnects_enabled : * mut sys :: godot_method_bind , pub is_using_snap : * mut sys :: godot_method_bind , pub is_valid_connection_type : * mut sys :: godot_method_bind , pub remove_valid_connection_type : * mut sys :: godot_method_bind , pub remove_valid_left_disconnect_type : * mut sys :: godot_method_bind , pub remove_valid_right_disconnect_type : * mut sys :: godot_method_bind , pub set_connection_activity : * mut sys :: godot_method_bind , pub set_minimap_enabled : * mut sys :: godot_method_bind , pub set_minimap_opacity : * mut sys :: godot_method_bind , pub set_minimap_size : * mut sys :: godot_method_bind , pub set_right_disconnects : * mut sys :: godot_method_bind , pub set_scroll_ofs : * mut sys :: godot_method_bind , pub set_selected : * mut sys :: godot_method_bind , pub set_snap : * mut sys :: godot_method_bind , pub set_use_snap : * mut sys :: godot_method_bind , pub set_zoom : * mut sys :: godot_method_bind } impl GraphEditMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : GraphEditMethodTable = GraphEditMethodTable { class_constructor : None , add_valid_connection_type : 0 as * mut sys :: godot_method_bind , add_valid_left_disconnect_type : 0 as * mut sys :: godot_method_bind , add_valid_right_disconnect_type : 0 as * mut sys :: godot_method_bind , clear_connections : 0 as * mut sys :: godot_method_bind , connect_node : 0 as * mut sys :: godot_method_bind , disconnect_node : 0 as * mut sys :: godot_method_bind , get_connection_list : 0 as * mut sys :: godot_method_bind , get_minimap_opacity : 0 as * mut sys :: godot_method_bind , get_minimap_size : 0 as * mut sys :: godot_method_bind , get_scroll_ofs : 0 as * mut sys :: godot_method_bind , get_snap : 0 as * mut sys :: godot_method_bind , get_zoom : 0 as * mut sys :: godot_method_bind , get_zoom_hbox : 0 as * mut sys :: godot_method_bind , is_minimap_enabled : 0 as * mut sys :: godot_method_bind , is_node_connected : 0 as * mut sys :: godot_method_bind , is_right_disconnects_enabled : 0 as * mut sys :: godot_method_bind , is_using_snap : 0 as * mut sys :: godot_method_bind , is_valid_connection_type : 0 as * mut sys :: godot_method_bind , remove_valid_connection_type : 0 as * mut sys :: godot_method_bind , remove_valid_left_disconnect_type : 0 as * mut sys :: godot_method_bind , remove_valid_right_disconnect_type : 0 as * mut sys :: godot_method_bind , set_connection_activity : 0 as * mut sys :: godot_method_bind , set_minimap_enabled : 0 as * mut sys :: godot_method_bind , set_minimap_opacity : 0 as * mut sys :: godot_method_bind , set_minimap_size : 0 as * mut sys :: godot_method_bind , set_right_disconnects : 0 as * mut sys :: godot_method_bind , set_scroll_ofs : 0 as * mut sys :: godot_method_bind , set_selected : 0 as * mut sys :: godot_method_bind , set_snap : 0 as * mut sys :: godot_method_bind , set_use_snap : 0 as * mut sys :: godot_method_bind , set_zoom : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { GraphEditMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "GraphEdit\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . add_valid_connection_type = (gd_api . godot_method_bind_get_method) (class_name , "add_valid_connection_type\0" . as_ptr () as * const c_char) ; table . add_valid_left_disconnect_type = (gd_api . godot_method_bind_get_method) (class_name , "add_valid_left_disconnect_type\0" . as_ptr () as * const c_char) ; table . add_valid_right_disconnect_type = (gd_api . godot_method_bind_get_method) (class_name , "add_valid_right_disconnect_type\0" . as_ptr () as * const c_char) ; table . clear_connections = (gd_api . godot_method_bind_get_method) (class_name , "clear_connections\0" . as_ptr () as * const c_char) ; table . connect_node = (gd_api . godot_method_bind_get_method) (class_name , "connect_node\0" . as_ptr () as * const c_char) ; table . disconnect_node = (gd_api . godot_method_bind_get_method) (class_name , "disconnect_node\0" . as_ptr () as * const c_char) ; table . get_connection_list = (gd_api . godot_method_bind_get_method) (class_name , "get_connection_list\0" . as_ptr () as * const c_char) ; table . get_minimap_opacity = (gd_api . godot_method_bind_get_method) (class_name , "get_minimap_opacity\0" . as_ptr () as * const c_char) ; table . get_minimap_size = (gd_api . godot_method_bind_get_method) (class_name , "get_minimap_size\0" . as_ptr () as * const c_char) ; table . get_scroll_ofs = (gd_api . godot_method_bind_get_method) (class_name , "get_scroll_ofs\0" . as_ptr () as * const c_char) ; table . get_snap = (gd_api . godot_method_bind_get_method) (class_name , "get_snap\0" . as_ptr () as * const c_char) ; table . get_zoom = (gd_api . godot_method_bind_get_method) (class_name , "get_zoom\0" . as_ptr () as * const c_char) ; table . get_zoom_hbox = (gd_api . godot_method_bind_get_method) (class_name , "get_zoom_hbox\0" . as_ptr () as * const c_char) ; table . is_minimap_enabled = (gd_api . godot_method_bind_get_method) (class_name , "is_minimap_enabled\0" . as_ptr () as * const c_char) ; table . is_node_connected = (gd_api . godot_method_bind_get_method) (class_name , "is_node_connected\0" . as_ptr () as * const c_char) ; table . is_right_disconnects_enabled = (gd_api . godot_method_bind_get_method) (class_name , "is_right_disconnects_enabled\0" . as_ptr () as * const c_char) ; table . is_using_snap = (gd_api . godot_method_bind_get_method) (class_name , "is_using_snap\0" . as_ptr () as * const c_char) ; table . is_valid_connection_type = (gd_api . godot_method_bind_get_method) (class_name , "is_valid_connection_type\0" . as_ptr () as * const c_char) ; table . remove_valid_connection_type = (gd_api . godot_method_bind_get_method) (class_name , "remove_valid_connection_type\0" . as_ptr () as * const c_char) ; table . remove_valid_left_disconnect_type = (gd_api . godot_method_bind_get_method) (class_name , "remove_valid_left_disconnect_type\0" . as_ptr () as * const c_char) ; table . remove_valid_right_disconnect_type = (gd_api . godot_method_bind_get_method) (class_name , "remove_valid_right_disconnect_type\0" . as_ptr () as * const c_char) ; table . set_connection_activity = (gd_api . godot_method_bind_get_method) (class_name , "set_connection_activity\0" . as_ptr () as * const c_char) ; table . set_minimap_enabled = (gd_api . godot_method_bind_get_method) (class_name , "set_minimap_enabled\0" . as_ptr () as * const c_char) ; table . set_minimap_opacity = (gd_api . godot_method_bind_get_method) (class_name , "set_minimap_opacity\0" . as_ptr () as * const c_char) ; table . set_minimap_size = (gd_api . godot_method_bind_get_method) (class_name , "set_minimap_size\0" . as_ptr () as * const c_char) ; table . set_right_disconnects = (gd_api . godot_method_bind_get_method) (class_name , "set_right_disconnects\0" . as_ptr () as * const c_char) ; table . set_scroll_ofs = (gd_api . godot_method_bind_get_method) (class_name , "set_scroll_ofs\0" . as_ptr () as * const c_char) ; table . set_selected = (gd_api . godot_method_bind_get_method) (class_name , "set_selected\0" . as_ptr () as * const c_char) ; table . set_snap = (gd_api . godot_method_bind_get_method) (class_name , "set_snap\0" . as_ptr () as * const c_char) ; table . set_use_snap = (gd_api . godot_method_bind_get_method) (class_name , "set_use_snap\0" . as_ptr () as * const c_char) ; table . set_zoom = (gd_api . godot_method_bind_get_method) (class_name , "set_zoom\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:460:4465 [INFO] [stdout] | [INFO] [stdout] 460 | ...thodTable { class_constructor : None , } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 460 | # [doc = "`core class VSlider` inherits `Slider` (unsafe)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_vslider.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nNon reference counted objects such as the ones of this type are usually owned by the engine.\n\n`VSlider` is a reference-only type. Persistent references can\nonly exist in the unsafe `Ref` form.\n\nIn the cases where Rust code owns an object of this type, for example if the object was just\ncreated on the Rust side and not passed to the engine yet, ownership should be either given\nto the engine or the object must be manually destroyed using `Ref::free`, or `Ref::queue_free`\nif it is a `Node`."] # [doc = "\n## Class hierarchy\n\nVSlider inherits methods from:\n - [Slider](struct.Slider.html)\n - [Range](struct.Range.html)\n - [Control](struct.Control.html)\n - [CanvasItem](struct.CanvasItem.html)\n - [Node](struct.Node.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct VSlider { this : RawObject < Self > , } impl VSlider { # [doc = "Creates a new instance of this object.\n\nBecause this type is not reference counted, the lifetime of the returned object\nis *not* automatically managed.\n\nImmediately after creation, the object is owned by the caller, and can be\npassed to the engine (in which case the engine will be responsible for\ndestroying the object) or destroyed manually using `Ref::free`, or preferably\n`Ref::queue_free` if it is a `Node`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = VSliderMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } } impl gdnative_core :: private :: godot_object :: Sealed for VSlider { } unsafe impl GodotObject for VSlider { type RefKind = ref_kind :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "VSlider" } } impl QueueFree for VSlider { # [inline] unsafe fn godot_queue_free (obj : * mut sys :: godot_object) { let method_bind : * mut sys :: godot_method_bind = crate :: generated :: node :: NodeMethodTable :: get (get_api ()) . queue_free ; crate :: icalls :: icallptr_void (method_bind , obj) } } impl std :: ops :: Deref for VSlider { type Target = crate :: generated :: slider :: Slider ; # [inline] fn deref (& self) -> & crate :: generated :: slider :: Slider { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for VSlider { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: slider :: Slider { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: slider :: Slider > for VSlider { } unsafe impl SubClass < crate :: generated :: range :: Range > for VSlider { } unsafe impl SubClass < crate :: generated :: control :: Control > for VSlider { } unsafe impl SubClass < crate :: generated :: canvas_item :: CanvasItem > for VSlider { } unsafe impl SubClass < crate :: generated :: node :: Node > for VSlider { } unsafe impl SubClass < crate :: generated :: object :: Object > for VSlider { } impl Instanciable for VSlider { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { VSlider :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct VSliderMethodTable { pub class_constructor : sys :: godot_class_constructor , } impl VSliderMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : VSliderMethodTable = VSliderMethodTable { class_constructor : None , } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { VSliderMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "VSlider\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:466:4670 [INFO] [stdout] | [INFO] [stdout] 466 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 466 | # [doc = "`core class VisualScriptGlobalConstant` inherits `VisualScriptNode` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_visualscriptglobalconstant.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nVisualScriptGlobalConstant inherits methods from:\n - [VisualScriptNode](struct.VisualScriptNode.html)\n - [Resource](struct.Resource.html)\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct VisualScriptGlobalConstant { this : RawObject < Self > , } impl VisualScriptGlobalConstant { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = VisualScriptGlobalConstantMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = ""] # [doc = ""] # [inline] pub fn global_constant (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualScriptGlobalConstantMethodTable :: get (get_api ()) . get_global_constant ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = ""] # [doc = ""] # [inline] pub fn set_global_constant (& self , index : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualScriptGlobalConstantMethodTable :: get (get_api ()) . set_global_constant ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , index) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for VisualScriptGlobalConstant { } unsafe impl GodotObject for VisualScriptGlobalConstant { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "VisualScriptGlobalConstant" } } impl std :: ops :: Deref for VisualScriptGlobalConstant { type Target = crate :: generated :: visual_script_node :: VisualScriptNode ; # [inline] fn deref (& self) -> & crate :: generated :: visual_script_node :: VisualScriptNode { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for VisualScriptGlobalConstant { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: visual_script_node :: VisualScriptNode { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: visual_script_node :: VisualScriptNode > for VisualScriptGlobalConstant { } unsafe impl SubClass < crate :: generated :: resource :: Resource > for VisualScriptGlobalConstant { } unsafe impl SubClass < crate :: generated :: reference :: Reference > for VisualScriptGlobalConstant { } unsafe impl SubClass < crate :: generated :: object :: Object > for VisualScriptGlobalConstant { } impl Instanciable for VisualScriptGlobalConstant { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { VisualScriptGlobalConstant :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct VisualScriptGlobalConstantMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_global_constant : * mut sys :: godot_method_bind , pub set_global_constant : * mut sys :: godot_method_bind } impl VisualScriptGlobalConstantMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : VisualScriptGlobalConstantMethodTable = VisualScriptGlobalConstantMethodTable { class_constructor : None , get_global_constant : 0 as * mut sys :: godot_method_bind , set_global_constant : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { VisualScriptGlobalConstantMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "VisualScriptGlobalConstant\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_global_constant = (gd_api . godot_method_bind_get_method) (class_name , "get_global_constant\0" . as_ptr () as * const c_char) ; table . set_global_constant = (gd_api . godot_method_bind_get_method) (class_name , "set_global_constant\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:472:4565 [INFO] [stdout] | [INFO] [stdout] 472 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 472 | # [doc = "`core class VisualScriptEmitSignal` inherits `VisualScriptNode` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_visualscriptemitsignal.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nVisualScriptEmitSignal inherits methods from:\n - [VisualScriptNode](struct.VisualScriptNode.html)\n - [Resource](struct.Resource.html)\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct VisualScriptEmitSignal { this : RawObject < Self > , } impl VisualScriptEmitSignal { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = VisualScriptEmitSignalMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = ""] # [doc = ""] # [inline] pub fn signal (& self) -> GodotString { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualScriptEmitSignalMethodTable :: get (get_api ()) . get_signal ; let ret = crate :: icalls :: icallptr_str (method_bind , self . this . sys () . as_ptr ()) ; GodotString :: from_sys (ret) } } # [doc = ""] # [doc = ""] # [inline] pub fn set_signal (& self , name : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualScriptEmitSignalMethodTable :: get (get_api ()) . set_signal ; let ret = crate :: icalls :: icallptr_void_str (method_bind , self . this . sys () . as_ptr () , name . into ()) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for VisualScriptEmitSignal { } unsafe impl GodotObject for VisualScriptEmitSignal { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "VisualScriptEmitSignal" } } impl std :: ops :: Deref for VisualScriptEmitSignal { type Target = crate :: generated :: visual_script_node :: VisualScriptNode ; # [inline] fn deref (& self) -> & crate :: generated :: visual_script_node :: VisualScriptNode { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for VisualScriptEmitSignal { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: visual_script_node :: VisualScriptNode { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: visual_script_node :: VisualScriptNode > for VisualScriptEmitSignal { } unsafe impl SubClass < crate :: generated :: resource :: Resource > for VisualScriptEmitSignal { } unsafe impl SubClass < crate :: generated :: reference :: Reference > for VisualScriptEmitSignal { } unsafe impl SubClass < crate :: generated :: object :: Object > for VisualScriptEmitSignal { } impl Instanciable for VisualScriptEmitSignal { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { VisualScriptEmitSignal :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct VisualScriptEmitSignalMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_signal : * mut sys :: godot_method_bind , pub set_signal : * mut sys :: godot_method_bind } impl VisualScriptEmitSignalMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : VisualScriptEmitSignalMethodTable = VisualScriptEmitSignalMethodTable { class_constructor : None , get_signal : 0 as * mut sys :: godot_method_bind , set_signal : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { VisualScriptEmitSignalMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "VisualScriptEmitSignal\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_signal = (gd_api . godot_method_bind_get_method) (class_name , "get_signal\0" . as_ptr () as * const c_char) ; table . set_signal = (gd_api . godot_method_bind_get_method) (class_name , "set_signal\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:82:27512 [INFO] [stdout] | [INFO] [stdout] 82 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 82 | # [doc = "`tools class EditorPlugin` inherits `Node` (unsafe)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_editorplugin.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = ""] # [doc = "\n## Class hierarchy\n\nEditorPlugin inherits methods from:\n - [Node](struct.Node.html)\n - [Object](struct.Object.html)\n"] # [doc = "\n## Tool\n\nThis class is used to interact with Godot's editor."] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct EditorPlugin { this : RawObject < Self > , } # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct CustomControlContainer (pub i64) ; impl CustomControlContainer { pub const TOOLBAR : CustomControlContainer = CustomControlContainer (0i64) ; pub const SPATIAL_EDITOR_MENU : CustomControlContainer = CustomControlContainer (1i64) ; pub const SPATIAL_EDITOR_SIDE_LEFT : CustomControlContainer = CustomControlContainer (2i64) ; pub const SPATIAL_EDITOR_SIDE_RIGHT : CustomControlContainer = CustomControlContainer (3i64) ; pub const SPATIAL_EDITOR_BOTTOM : CustomControlContainer = CustomControlContainer (4i64) ; pub const CANVAS_EDITOR_MENU : CustomControlContainer = CustomControlContainer (5i64) ; pub const CANVAS_EDITOR_SIDE_LEFT : CustomControlContainer = CustomControlContainer (6i64) ; pub const CANVAS_EDITOR_SIDE_RIGHT : CustomControlContainer = CustomControlContainer (7i64) ; pub const CANVAS_EDITOR_BOTTOM : CustomControlContainer = CustomControlContainer (8i64) ; pub const PROPERTY_EDITOR_BOTTOM : CustomControlContainer = CustomControlContainer (9i64) ; pub const PROJECT_SETTING_TAB_LEFT : CustomControlContainer = CustomControlContainer (10i64) ; pub const PROJECT_SETTING_TAB_RIGHT : CustomControlContainer = CustomControlContainer (11i64) ; } impl From < i64 > for CustomControlContainer { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < CustomControlContainer > for i64 { # [inline] fn from (v : CustomControlContainer) -> Self { v . 0 } } # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct DockSlot (pub i64) ; impl DockSlot { pub const LEFT_UL : DockSlot = DockSlot (0i64) ; pub const LEFT_BL : DockSlot = DockSlot (1i64) ; pub const LEFT_UR : DockSlot = DockSlot (2i64) ; pub const LEFT_BR : DockSlot = DockSlot (3i64) ; pub const RIGHT_UL : DockSlot = DockSlot (4i64) ; pub const RIGHT_BL : DockSlot = DockSlot (5i64) ; pub const RIGHT_UR : DockSlot = DockSlot (6i64) ; pub const RIGHT_BR : DockSlot = DockSlot (7i64) ; pub const MAX : DockSlot = DockSlot (8i64) ; } impl From < i64 > for DockSlot { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < DockSlot > for i64 { # [inline] fn from (v : DockSlot) -> Self { v . 0 } } # [doc = "Constants"] # [allow (non_upper_case_globals)] impl EditorPlugin { pub const CONTAINER_CANVAS_EDITOR_BOTTOM : i64 = 8i64 ; pub const CONTAINER_CANVAS_EDITOR_MENU : i64 = 5i64 ; pub const CONTAINER_CANVAS_EDITOR_SIDE_LEFT : i64 = 6i64 ; pub const CONTAINER_CANVAS_EDITOR_SIDE_RIGHT : i64 = 7i64 ; pub const CONTAINER_PROJECT_SETTING_TAB_LEFT : i64 = 10i64 ; pub const CONTAINER_PROJECT_SETTING_TAB_RIGHT : i64 = 11i64 ; pub const CONTAINER_PROPERTY_EDITOR_BOTTOM : i64 = 9i64 ; pub const CONTAINER_SPATIAL_EDITOR_BOTTOM : i64 = 4i64 ; pub const CONTAINER_SPATIAL_EDITOR_MENU : i64 = 1i64 ; pub const CONTAINER_SPATIAL_EDITOR_SIDE_LEFT : i64 = 2i64 ; pub const CONTAINER_SPATIAL_EDITOR_SIDE_RIGHT : i64 = 3i64 ; pub const CONTAINER_TOOLBAR : i64 = 0i64 ; pub const DOCK_SLOT_LEFT_BL : i64 = 1i64 ; pub const DOCK_SLOT_LEFT_BR : i64 = 3i64 ; pub const DOCK_SLOT_LEFT_UL : i64 = 0i64 ; pub const DOCK_SLOT_LEFT_UR : i64 = 2i64 ; pub const DOCK_SLOT_MAX : i64 = 8i64 ; pub const DOCK_SLOT_RIGHT_BL : i64 = 5i64 ; pub const DOCK_SLOT_RIGHT_BR : i64 = 7i64 ; pub const DOCK_SLOT_RIGHT_UL : i64 = 4i64 ; pub const DOCK_SLOT_RIGHT_UR : i64 = 6i64 ; } impl EditorPlugin { # [doc = "Adds a script at `path` to the Autoload list as `name`."] # [doc = ""] # [inline] pub fn add_autoload_singleton (& self , name : impl Into < GodotString > , path : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorPluginMethodTable :: get (get_api ()) . add_autoload_singleton ; let ret = crate :: icalls :: icallptr_void_str_str (method_bind , self . this . sys () . as_ptr () , name . into () , path . into ()) ; } } # [doc = "Adds a control to the bottom panel (together with Output, Debug, Animation, etc). Returns a reference to the button added. It's up to you to hide/show the button when needed. When your plugin is deactivated, make sure to remove your custom control with [method remove_control_from_bottom_panel] and free it with [method Node.queue_free]."] # [doc = ""] # [inline] pub fn add_control_to_bottom_panel (& self , control : impl AsArg < crate :: generated :: control :: Control > , title : impl Into < GodotString >) -> Option < Ref < crate :: generated :: tool_button :: ToolButton , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorPluginMethodTable :: get (get_api ()) . add_control_to_bottom_panel ; let ret = crate :: icalls :: icallptr_obj_obj_str (method_bind , self . this . sys () . as_ptr () , control . as_arg_ptr () , title . into ()) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: tool_button :: ToolButton , thread_access :: Shared >> :: move_from_sys (sys)) } } # [doc = "Adds a custom control to a container (see [enum CustomControlContainer]). There are many locations where custom controls can be added in the editor UI.\nPlease remember that you have to manage the visibility of your custom controls yourself (and likely hide it after adding it).\nWhen your plugin is deactivated, make sure to remove your custom control with [method remove_control_from_container] and free it with [method Node.queue_free]."] # [doc = ""] # [inline] pub fn add_control_to_container (& self , container : i64 , control : impl AsArg < crate :: generated :: control :: Control >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorPluginMethodTable :: get (get_api ()) . add_control_to_container ; let ret = crate :: icalls :: icallptr_void_i64_obj (method_bind , self . this . sys () . as_ptr () , container , control . as_arg_ptr ()) ; } } # [doc = "Adds the control to a specific dock slot (see [enum DockSlot] for options).\nIf the dock is repositioned and as long as the plugin is active, the editor will save the dock position on further sessions.\nWhen your plugin is deactivated, make sure to remove your custom control with [method remove_control_from_docks] and free it with [method Node.queue_free]."] # [doc = ""] # [inline] pub fn add_control_to_dock (& self , slot : i64 , control : impl AsArg < crate :: generated :: control :: Control >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorPluginMethodTable :: get (get_api ()) . add_control_to_dock ; let ret = crate :: icalls :: icallptr_void_i64_obj (method_bind , self . this . sys () . as_ptr () , slot , control . as_arg_ptr ()) ; } } # [doc = "Adds a custom type, which will appear in the list of nodes or resources. An icon can be optionally passed.\nWhen given node or resource is selected, the base type will be instanced (ie, \"Spatial\", \"Control\", \"Resource\"), then the script will be loaded and set to this object.\nYou can use the virtual method [method handles] to check if your custom object is being edited by checking the script or using the `is` keyword.\nDuring run-time, this will be a simple object with a script so this function does not need to be called then."] # [doc = ""] # [inline] pub fn add_custom_type (& self , _type : impl Into < GodotString > , base : impl Into < GodotString > , script : impl AsArg < crate :: generated :: script :: Script > , icon : impl AsArg < crate :: generated :: texture :: Texture >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorPluginMethodTable :: get (get_api ()) . add_custom_type ; let ret = crate :: icalls :: icallptr_void_str_str_obj_obj (method_bind , self . this . sys () . as_ptr () , _type . into () , base . into () , script . as_arg_ptr () , icon . as_arg_ptr ()) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn add_export_plugin (& self , plugin : impl AsArg < crate :: generated :: editor_export_plugin :: EditorExportPlugin >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorPluginMethodTable :: get (get_api ()) . add_export_plugin ; let ret = crate :: icalls :: icallptr_void_obj (method_bind , self . this . sys () . as_ptr () , plugin . as_arg_ptr ()) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn add_import_plugin (& self , importer : impl AsArg < crate :: generated :: editor_import_plugin :: EditorImportPlugin >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorPluginMethodTable :: get (get_api ()) . add_import_plugin ; let ret = crate :: icalls :: icallptr_void_obj (method_bind , self . this . sys () . as_ptr () , importer . as_arg_ptr ()) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn add_inspector_plugin (& self , plugin : impl AsArg < crate :: generated :: editor_inspector_plugin :: EditorInspectorPlugin >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorPluginMethodTable :: get (get_api ()) . add_inspector_plugin ; let ret = crate :: icalls :: icallptr_void_obj (method_bind , self . this . sys () . as_ptr () , plugin . as_arg_ptr ()) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn add_scene_import_plugin (& self , scene_importer : impl AsArg < crate :: generated :: editor_scene_importer :: EditorSceneImporter >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorPluginMethodTable :: get (get_api ()) . add_scene_import_plugin ; let ret = crate :: icalls :: icallptr_void_obj (method_bind , self . this . sys () . as_ptr () , scene_importer . as_arg_ptr ()) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn add_spatial_gizmo_plugin (& self , plugin : impl AsArg < crate :: generated :: editor_spatial_gizmo_plugin :: EditorSpatialGizmoPlugin >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorPluginMethodTable :: get (get_api ()) . add_spatial_gizmo_plugin ; let ret = crate :: icalls :: icallptr_void_obj (method_bind , self . this . sys () . as_ptr () , plugin . as_arg_ptr ()) ; } } # [doc = "Adds a custom menu item to **Project > Tools** as `name` that calls `callback` on an instance of `handler` with a parameter `ud` when user activates it.\n# Default Arguments\n* `ud` - `null`"] # [doc = ""] # [inline] pub fn add_tool_menu_item (& self , name : impl Into < GodotString > , handler : impl AsArg < crate :: generated :: object :: Object > , callback : impl Into < GodotString > , ud : impl OwnedToVariant) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorPluginMethodTable :: get (get_api ()) . add_tool_menu_item ; let ret = crate :: icalls :: icallptr_void_str_obj_str_var (method_bind , self . this . sys () . as_ptr () , name . into () , handler . as_arg_ptr () , callback . into () , ud . owned_to_variant ()) ; } } # [doc = "Adds a custom submenu under **Project > Tools >** `name`. `submenu` should be an object of class [PopupMenu]. This submenu should be cleaned up using `remove_tool_menu_item(name)`."] # [doc = ""] # [inline] pub fn add_tool_submenu_item (& self , name : impl Into < GodotString > , submenu : impl AsArg < crate :: generated :: object :: Object >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorPluginMethodTable :: get (get_api ()) . add_tool_submenu_item ; let ret = crate :: icalls :: icallptr_void_str_obj (method_bind , self . this . sys () . as_ptr () , name . into () , submenu . as_arg_ptr ()) ; } } # [doc = "Returns the [EditorInterface] object that gives you control over Godot editor's window and its functionalities."] # [doc = ""] # [inline] pub fn get_editor_interface (& self) -> Option < Ref < crate :: generated :: editor_interface :: EditorInterface , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorPluginMethodTable :: get (get_api ()) . get_editor_interface ; let ret = crate :: icalls :: icallptr_obj (method_bind , self . this . sys () . as_ptr ()) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: editor_interface :: EditorInterface , thread_access :: Shared >> :: move_from_sys (sys)) } } # [doc = "Gets the Editor's dialogue used for making scripts.\n**Note:** Users can configure it before use."] # [doc = ""] # [inline] pub fn get_script_create_dialog (& self) -> Option < Ref < crate :: generated :: script_create_dialog :: ScriptCreateDialog , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorPluginMethodTable :: get (get_api ()) . get_script_create_dialog ; let ret = crate :: icalls :: icallptr_obj (method_bind , self . this . sys () . as_ptr ()) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: script_create_dialog :: ScriptCreateDialog , thread_access :: Shared >> :: move_from_sys (sys)) } } # [doc = "Gets the undo/redo object. Most actions in the editor can be undoable, so use this object to make sure this happens when it's worth it."] # [doc = ""] # [inline] pub fn get_undo_redo (& self) -> Option < Ref < crate :: generated :: undo_redo :: UndoRedo , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorPluginMethodTable :: get (get_api ()) . get_undo_redo ; let ret = crate :: icalls :: icallptr_obj (method_bind , self . this . sys () . as_ptr ()) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: undo_redo :: UndoRedo , thread_access :: Shared >> :: move_from_sys (sys)) } } # [doc = ""] # [doc = ""] # [inline] pub fn hide_bottom_panel (& self) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorPluginMethodTable :: get (get_api ()) . hide_bottom_panel ; let ret = crate :: icalls :: icallptr_void (method_bind , self . this . sys () . as_ptr ()) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn make_bottom_panel_item_visible (& self , item : impl AsArg < crate :: generated :: control :: Control >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorPluginMethodTable :: get (get_api ()) . make_bottom_panel_item_visible ; let ret = crate :: icalls :: icallptr_void_obj (method_bind , self . this . sys () . as_ptr () , item . as_arg_ptr ()) ; } } # [doc = "Queue save the project's editor layout."] # [doc = ""] # [inline] pub fn queue_save_layout (& self) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorPluginMethodTable :: get (get_api ()) . queue_save_layout ; let ret = crate :: icalls :: icallptr_void (method_bind , self . this . sys () . as_ptr ()) ; } } # [doc = "Removes an Autoload `name` from the list."] # [doc = ""] # [inline] pub fn remove_autoload_singleton (& self , name : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorPluginMethodTable :: get (get_api ()) . remove_autoload_singleton ; let ret = crate :: icalls :: icallptr_void_str (method_bind , self . this . sys () . as_ptr () , name . into ()) ; } } # [doc = "Removes the control from the bottom panel. You have to manually [method Node.queue_free] the control."] # [doc = ""] # [inline] pub fn remove_control_from_bottom_panel (& self , control : impl AsArg < crate :: generated :: control :: Control >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorPluginMethodTable :: get (get_api ()) . remove_control_from_bottom_panel ; let ret = crate :: icalls :: icallptr_void_obj (method_bind , self . this . sys () . as_ptr () , control . as_arg_ptr ()) ; } } # [doc = "Removes the control from the specified container. You have to manually [method Node.queue_free] the control."] # [doc = ""] # [inline] pub fn remove_control_from_container (& self , container : i64 , control : impl AsArg < crate :: generated :: control :: Control >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorPluginMethodTable :: get (get_api ()) . remove_control_from_container ; let ret = crate :: icalls :: icallptr_void_i64_obj (method_bind , self . this . sys () . as_ptr () , container , control . as_arg_ptr ()) ; } } # [doc = "Removes the control from the dock. You have to manually [method Node.queue_free] the control."] # [doc = ""] # [inline] pub fn remove_control_from_docks (& self , control : impl AsArg < crate :: generated :: control :: Control >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorPluginMethodTable :: get (get_api ()) . remove_control_from_docks ; let ret = crate :: icalls :: icallptr_void_obj (method_bind , self . this . sys () . as_ptr () , control . as_arg_ptr ()) ; } } # [doc = "Removes a custom type added by [method add_custom_type]."] # [doc = ""] # [inline] pub fn remove_custom_type (& self , _type : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorPluginMethodTable :: get (get_api ()) . remove_custom_type ; let ret = crate :: icalls :: icallptr_void_str (method_bind , self . this . sys () . as_ptr () , _type . into ()) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn remove_export_plugin (& self , plugin : impl AsArg < crate :: generated :: editor_export_plugin :: EditorExportPlugin >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorPluginMethodTable :: get (get_api ()) . remove_export_plugin ; let ret = crate :: icalls :: icallptr_void_obj (method_bind , self . this . sys () . as_ptr () , plugin . as_arg_ptr ()) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn remove_import_plugin (& self , importer : impl AsArg < crate :: generated :: editor_import_plugin :: EditorImportPlugin >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorPluginMethodTable :: get (get_api ()) . remove_import_plugin ; let ret = crate :: icalls :: icallptr_void_obj (method_bind , self . this . sys () . as_ptr () , importer . as_arg_ptr ()) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn remove_inspector_plugin (& self , plugin : impl AsArg < crate :: generated :: editor_inspector_plugin :: EditorInspectorPlugin >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorPluginMethodTable :: get (get_api ()) . remove_inspector_plugin ; let ret = crate :: icalls :: icallptr_void_obj (method_bind , self . this . sys () . as_ptr () , plugin . as_arg_ptr ()) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn remove_scene_import_plugin (& self , scene_importer : impl AsArg < crate :: generated :: editor_scene_importer :: EditorSceneImporter >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorPluginMethodTable :: get (get_api ()) . remove_scene_import_plugin ; let ret = crate :: icalls :: icallptr_void_obj (method_bind , self . this . sys () . as_ptr () , scene_importer . as_arg_ptr ()) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn remove_spatial_gizmo_plugin (& self , plugin : impl AsArg < crate :: generated :: editor_spatial_gizmo_plugin :: EditorSpatialGizmoPlugin >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorPluginMethodTable :: get (get_api ()) . remove_spatial_gizmo_plugin ; let ret = crate :: icalls :: icallptr_void_obj (method_bind , self . this . sys () . as_ptr () , plugin . as_arg_ptr ()) ; } } # [doc = "Removes a menu `name` from **Project > Tools**."] # [doc = ""] # [inline] pub fn remove_tool_menu_item (& self , name : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorPluginMethodTable :: get (get_api ()) . remove_tool_menu_item ; let ret = crate :: icalls :: icallptr_void_str (method_bind , self . this . sys () . as_ptr () , name . into ()) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn set_force_draw_over_forwarding_enabled (& self) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorPluginMethodTable :: get (get_api ()) . set_force_draw_over_forwarding_enabled ; let ret = crate :: icalls :: icallptr_void (method_bind , self . this . sys () . as_ptr ()) ; } } # [doc = "Use this method if you always want to receive inputs from 3D view screen inside [method forward_spatial_gui_input]. It might be especially usable if your plugin will want to use raycast in the scene."] # [doc = ""] # [inline] pub fn set_input_event_forwarding_always_enabled (& self) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorPluginMethodTable :: get (get_api ()) . set_input_event_forwarding_always_enabled ; let ret = crate :: icalls :: icallptr_void (method_bind , self . this . sys () . as_ptr ()) ; } } # [doc = "Updates the overlays of the editor (2D/3D) viewport."] # [doc = ""] # [inline] pub fn update_overlays (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorPluginMethodTable :: get (get_api ()) . update_overlays ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } } impl gdnative_core :: private :: godot_object :: Sealed for EditorPlugin { } unsafe impl GodotObject for EditorPlugin { type RefKind = ref_kind :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "EditorPlugin" } } impl QueueFree for EditorPlugin { # [inline] unsafe fn godot_queue_free (obj : * mut sys :: godot_object) { let method_bind : * mut sys :: godot_method_bind = crate :: generated :: node :: NodeMethodTable :: get (get_api ()) . queue_free ; crate :: icalls :: icallptr_void (method_bind , obj) } } impl std :: ops :: Deref for EditorPlugin { type Target = crate :: generated :: node :: Node ; # [inline] fn deref (& self) -> & crate :: generated :: node :: Node { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for EditorPlugin { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: node :: Node { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: node :: Node > for EditorPlugin { } unsafe impl SubClass < crate :: generated :: object :: Object > for EditorPlugin { } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct EditorPluginMethodTable { pub class_constructor : sys :: godot_class_constructor , pub add_autoload_singleton : * mut sys :: godot_method_bind , pub add_control_to_bottom_panel : * mut sys :: godot_method_bind , pub add_control_to_container : * mut sys :: godot_method_bind , pub add_control_to_dock : * mut sys :: godot_method_bind , pub add_custom_type : * mut sys :: godot_method_bind , pub add_export_plugin : * mut sys :: godot_method_bind , pub add_import_plugin : * mut sys :: godot_method_bind , pub add_inspector_plugin : * mut sys :: godot_method_bind , pub add_scene_import_plugin : * mut sys :: godot_method_bind , pub add_spatial_gizmo_plugin : * mut sys :: godot_method_bind , pub add_tool_menu_item : * mut sys :: godot_method_bind , pub add_tool_submenu_item : * mut sys :: godot_method_bind , pub get_editor_interface : * mut sys :: godot_method_bind , pub get_script_create_dialog : * mut sys :: godot_method_bind , pub get_undo_redo : * mut sys :: godot_method_bind , pub hide_bottom_panel : * mut sys :: godot_method_bind , pub make_bottom_panel_item_visible : * mut sys :: godot_method_bind , pub queue_save_layout : * mut sys :: godot_method_bind , pub remove_autoload_singleton : * mut sys :: godot_method_bind , pub remove_control_from_bottom_panel : * mut sys :: godot_method_bind , pub remove_control_from_container : * mut sys :: godot_method_bind , pub remove_control_from_docks : * mut sys :: godot_method_bind , pub remove_custom_type : * mut sys :: godot_method_bind , pub remove_export_plugin : * mut sys :: godot_method_bind , pub remove_import_plugin : * mut sys :: godot_method_bind , pub remove_inspector_plugin : * mut sys :: godot_method_bind , pub remove_scene_import_plugin : * mut sys :: godot_method_bind , pub remove_spatial_gizmo_plugin : * mut sys :: godot_method_bind , pub remove_tool_menu_item : * mut sys :: godot_method_bind , pub set_force_draw_over_forwarding_enabled : * mut sys :: godot_method_bind , pub set_input_event_forwarding_always_enabled : * mut sys :: godot_method_bind , pub update_overlays : * mut sys :: godot_method_bind } impl EditorPluginMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : EditorPluginMethodTable = EditorPluginMethodTable { class_constructor : None , add_autoload_singleton : 0 as * mut sys :: godot_method_bind , add_control_to_bottom_panel : 0 as * mut sys :: godot_method_bind , add_control_to_container : 0 as * mut sys :: godot_method_bind , add_control_to_dock : 0 as * mut sys :: godot_method_bind , add_custom_type : 0 as * mut sys :: godot_method_bind , add_export_plugin : 0 as * mut sys :: godot_method_bind , add_import_plugin : 0 as * mut sys :: godot_method_bind , add_inspector_plugin : 0 as * mut sys :: godot_method_bind , add_scene_import_plugin : 0 as * mut sys :: godot_method_bind , add_spatial_gizmo_plugin : 0 as * mut sys :: godot_method_bind , add_tool_menu_item : 0 as * mut sys :: godot_method_bind , add_tool_submenu_item : 0 as * mut sys :: godot_method_bind , get_editor_interface : 0 as * mut sys :: godot_method_bind , get_script_create_dialog : 0 as * mut sys :: godot_method_bind , get_undo_redo : 0 as * mut sys :: godot_method_bind , hide_bottom_panel : 0 as * mut sys :: godot_method_bind , make_bottom_panel_item_visible : 0 as * mut sys :: godot_method_bind , queue_save_layout : 0 as * mut sys :: godot_method_bind , remove_autoload_singleton : 0 as * mut sys :: godot_method_bind , remove_control_from_bottom_panel : 0 as * mut sys :: godot_method_bind , remove_control_from_container : 0 as * mut sys :: godot_method_bind , remove_control_from_docks : 0 as * mut sys :: godot_method_bind , remove_custom_type : 0 as * mut sys :: godot_method_bind , remove_export_plugin : 0 as * mut sys :: godot_method_bind , remove_import_plugin : 0 as * mut sys :: godot_method_bind , remove_inspector_plugin : 0 as * mut sys :: godot_method_bind , remove_scene_import_plugin : 0 as * mut sys :: godot_method_bind , remove_spatial_gizmo_plugin : 0 as * mut sys :: godot_method_bind , remove_tool_menu_item : 0 as * mut sys :: godot_method_bind , set_force_draw_over_forwarding_enabled : 0 as * mut sys :: godot_method_bind , set_input_event_forwarding_always_enabled : 0 as * mut sys :: godot_method_bind , update_overlays : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { EditorPluginMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "EditorPlugin\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . add_autoload_singleton = (gd_api . godot_method_bind_get_method) (class_name , "add_autoload_singleton\0" . as_ptr () as * const c_char) ; table . add_control_to_bottom_panel = (gd_api . godot_method_bind_get_method) (class_name , "add_control_to_bottom_panel\0" . as_ptr () as * const c_char) ; table . add_control_to_container = (gd_api . godot_method_bind_get_method) (class_name , "add_control_to_container\0" . as_ptr () as * const c_char) ; table . add_control_to_dock = (gd_api . godot_method_bind_get_method) (class_name , "add_control_to_dock\0" . as_ptr () as * const c_char) ; table . add_custom_type = (gd_api . godot_method_bind_get_method) (class_name , "add_custom_type\0" . as_ptr () as * const c_char) ; table . add_export_plugin = (gd_api . godot_method_bind_get_method) (class_name , "add_export_plugin\0" . as_ptr () as * const c_char) ; table . add_import_plugin = (gd_api . godot_method_bind_get_method) (class_name , "add_import_plugin\0" . as_ptr () as * const c_char) ; table . add_inspector_plugin = (gd_api . godot_method_bind_get_method) (class_name , "add_inspector_plugin\0" . as_ptr () as * const c_char) ; table . add_scene_import_plugin = (gd_api . godot_method_bind_get_method) (class_name , "add_scene_import_plugin\0" . as_ptr () as * const c_char) ; table . add_spatial_gizmo_plugin = (gd_api . godot_method_bind_get_method) (class_name , "add_spatial_gizmo_plugin\0" . as_ptr () as * const c_char) ; table . add_tool_menu_item = (gd_api . godot_method_bind_get_method) (class_name , "add_tool_menu_item\0" . as_ptr () as * const c_char) ; table . add_tool_submenu_item = (gd_api . godot_method_bind_get_method) (class_name , "add_tool_submenu_item\0" . as_ptr () as * const c_char) ; table . get_editor_interface = (gd_api . godot_method_bind_get_method) (class_name , "get_editor_interface\0" . as_ptr () as * const c_char) ; table . get_script_create_dialog = (gd_api . godot_method_bind_get_method) (class_name , "get_script_create_dialog\0" . as_ptr () as * const c_char) ; table . get_undo_redo = (gd_api . godot_method_bind_get_method) (class_name , "get_undo_redo\0" . as_ptr () as * const c_char) ; table . hide_bottom_panel = (gd_api . godot_method_bind_get_method) (class_name , "hide_bottom_panel\0" . as_ptr () as * const c_char) ; table . make_bottom_panel_item_visible = (gd_api . godot_method_bind_get_method) (class_name , "make_bottom_panel_item_visible\0" . as_ptr () as * const c_char) ; table . queue_save_layout = (gd_api . godot_method_bind_get_method) (class_name , "queue_save_layout\0" . as_ptr () as * const c_char) ; table . remove_autoload_singleton = (gd_api . godot_method_bind_get_method) (class_name , "remove_autoload_singleton\0" . as_ptr () as * const c_char) ; table . remove_control_from_bottom_panel = (gd_api . godot_method_bind_get_method) (class_name , "remove_control_from_bottom_panel\0" . as_ptr () as * const c_char) ; table . remove_control_from_container = (gd_api . godot_method_bind_get_method) (class_name , "remove_control_from_container\0" . as_ptr () as * const c_char) ; table . remove_control_from_docks = (gd_api . godot_method_bind_get_method) (class_name , "remove_control_from_docks\0" . as_ptr () as * const c_char) ; table . remove_custom_type = (gd_api . godot_method_bind_get_method) (class_name , "remove_custom_type\0" . as_ptr () as * const c_char) ; table . remove_export_plugin = (gd_api . godot_method_bind_get_method) (class_name , "remove_export_plugin\0" . as_ptr () as * const c_char) ; table . remove_import_plugin = (gd_api . godot_method_bind_get_method) (class_name , "remove_import_plugin\0" . as_ptr () as * const c_char) ; table . remove_inspector_plugin = (gd_api . godot_method_bind_get_method) (class_name , "remove_inspector_plugin\0" . as_ptr () as * const c_char) ; table . remove_scene_import_plugin = (gd_api . godot_method_bind_get_method) (class_name , "remove_scene_import_plugin\0" . as_ptr () as * const c_char) ; table . remove_spatial_gizmo_plugin = (gd_api . godot_method_bind_get_method) (class_name , "remove_spatial_gizmo_plugin\0" . as_ptr () as * const c_char) ; table . remove_tool_menu_item = (gd_api . godot_method_bind_get_method) (class_name , "remove_tool_menu_item\0" . as_ptr () as * const c_char) ; table . set_force_draw_over_forwarding_enabled = (gd_api . godot_method_bind_get_method) (class_name , "set_force_draw_over_forwarding_enabled\0" . as_ptr () as * const c_char) ; table . set_input_event_forwarding_always_enabled = (gd_api . godot_method_bind_get_method) (class_name , "set_input_event_forwarding_always_enabled\0" . as_ptr () as * const c_char) ; table . update_overlays = (gd_api . godot_method_bind_get_method) (class_name , "update_overlays\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:478:5045 [INFO] [stdout] | [INFO] [stdout] 478 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 478 | # [doc = "`core class LineShape2D` inherits `Shape2D` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_lineshape2d.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nLineShape2D inherits methods from:\n - [Shape2D](struct.Shape2D.html)\n - [Resource](struct.Resource.html)\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct LineShape2D { this : RawObject < Self > , } impl LineShape2D { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = LineShape2DMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "The line's distance from the origin."] # [doc = ""] # [inline] pub fn d (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = LineShape2DMethodTable :: get (get_api ()) . get_d ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "The line's normal."] # [doc = ""] # [inline] pub fn normal (& self) -> Vector2 { unsafe { let method_bind : * mut sys :: godot_method_bind = LineShape2DMethodTable :: get (get_api ()) . get_normal ; let ret = crate :: icalls :: icallptr_vec2 (method_bind , self . this . sys () . as_ptr ()) ; mem :: transmute (ret) } } # [doc = "The line's distance from the origin."] # [doc = ""] # [inline] pub fn set_d (& self , d : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = LineShape2DMethodTable :: get (get_api ()) . set_d ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , d) ; } } # [doc = "The line's normal."] # [doc = ""] # [inline] pub fn set_normal (& self , normal : Vector2) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = LineShape2DMethodTable :: get (get_api ()) . set_normal ; let ret = crate :: icalls :: icallptr_void_vec2 (method_bind , self . this . sys () . as_ptr () , normal) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for LineShape2D { } unsafe impl GodotObject for LineShape2D { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "LineShape2D" } } impl std :: ops :: Deref for LineShape2D { type Target = crate :: generated :: shape_2d :: Shape2D ; # [inline] fn deref (& self) -> & crate :: generated :: shape_2d :: Shape2D { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for LineShape2D { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: shape_2d :: Shape2D { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: shape_2d :: Shape2D > for LineShape2D { } unsafe impl SubClass < crate :: generated :: resource :: Resource > for LineShape2D { } unsafe impl SubClass < crate :: generated :: reference :: Reference > for LineShape2D { } unsafe impl SubClass < crate :: generated :: object :: Object > for LineShape2D { } impl Instanciable for LineShape2D { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { LineShape2D :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct LineShape2DMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_d : * mut sys :: godot_method_bind , pub get_normal : * mut sys :: godot_method_bind , pub set_d : * mut sys :: godot_method_bind , pub set_normal : * mut sys :: godot_method_bind } impl LineShape2DMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : LineShape2DMethodTable = LineShape2DMethodTable { class_constructor : None , get_d : 0 as * mut sys :: godot_method_bind , get_normal : 0 as * mut sys :: godot_method_bind , set_d : 0 as * mut sys :: godot_method_bind , set_normal : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { LineShape2DMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "LineShape2D\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_d = (gd_api . godot_method_bind_get_method) (class_name , "get_d\0" . as_ptr () as * const c_char) ; table . get_normal = (gd_api . godot_method_bind_get_method) (class_name , "get_normal\0" . as_ptr () as * const c_char) ; table . set_d = (gd_api . godot_method_bind_get_method) (class_name , "set_d\0" . as_ptr () as * const c_char) ; table . set_normal = (gd_api . godot_method_bind_get_method) (class_name , "set_normal\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:88:7780 [INFO] [stdout] | [INFO] [stdout] 88 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 88 | # [doc = "`core class VisualShaderNodeTextureUniform` inherits `VisualShaderNodeUniform` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_visualshadernodetextureuniform.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nVisualShaderNodeTextureUniform inherits methods from:\n - [VisualShaderNodeUniform](struct.VisualShaderNodeUniform.html)\n - [VisualShaderNode](struct.VisualShaderNode.html)\n - [Resource](struct.Resource.html)\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct VisualShaderNodeTextureUniform { this : RawObject < Self > , } # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct ColorDefault (pub i64) ; impl ColorDefault { pub const WHITE : ColorDefault = ColorDefault (0i64) ; pub const BLACK : ColorDefault = ColorDefault (1i64) ; } impl From < i64 > for ColorDefault { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < ColorDefault > for i64 { # [inline] fn from (v : ColorDefault) -> Self { v . 0 } } # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct TextureType (pub i64) ; impl TextureType { pub const DATA : TextureType = TextureType (0i64) ; pub const COLOR : TextureType = TextureType (1i64) ; pub const NORMALMAP : TextureType = TextureType (2i64) ; pub const ANISO : TextureType = TextureType (3i64) ; } impl From < i64 > for TextureType { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < TextureType > for i64 { # [inline] fn from (v : TextureType) -> Self { v . 0 } } # [doc = "Constants"] # [allow (non_upper_case_globals)] impl VisualShaderNodeTextureUniform { pub const COLOR_DEFAULT_BLACK : i64 = 1i64 ; pub const COLOR_DEFAULT_WHITE : i64 = 0i64 ; pub const TYPE_ANISO : i64 = 3i64 ; pub const TYPE_COLOR : i64 = 1i64 ; pub const TYPE_DATA : i64 = 0i64 ; pub const TYPE_NORMALMAP : i64 = 2i64 ; } impl VisualShaderNodeTextureUniform { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = VisualShaderNodeTextureUniformMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "Sets the default color if no texture is assigned to the uniform."] # [doc = ""] # [inline] pub fn color_default (& self) -> crate :: generated :: visual_shader_node_texture_uniform :: ColorDefault { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualShaderNodeTextureUniformMethodTable :: get (get_api ()) . get_color_default ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; crate :: generated :: visual_shader_node_texture_uniform :: ColorDefault (ret) } } # [doc = "Defines the type of data provided by the source texture. See [enum TextureType] for options."] # [doc = ""] # [inline] pub fn texture_type (& self) -> crate :: generated :: visual_shader_node_texture_uniform :: TextureType { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualShaderNodeTextureUniformMethodTable :: get (get_api ()) . get_texture_type ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; crate :: generated :: visual_shader_node_texture_uniform :: TextureType (ret) } } # [doc = "Sets the default color if no texture is assigned to the uniform."] # [doc = ""] # [inline] pub fn set_color_default (& self , _type : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualShaderNodeTextureUniformMethodTable :: get (get_api ()) . set_color_default ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , _type) ; } } # [doc = "Defines the type of data provided by the source texture. See [enum TextureType] for options."] # [doc = ""] # [inline] pub fn set_texture_type (& self , _type : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualShaderNodeTextureUniformMethodTable :: get (get_api ()) . set_texture_type ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , _type) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for VisualShaderNodeTextureUniform { } unsafe impl GodotObject for VisualShaderNodeTextureUniform { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "VisualShaderNodeTextureUniform" } } impl std :: ops :: Deref for VisualShaderNodeTextureUniform { type Target = crate :: generated :: visual_shader_node_uniform :: VisualShaderNodeUniform ; # [inline] fn deref (& self) -> & crate :: generated :: visual_shader_node_uniform :: VisualShaderNodeUniform { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for VisualShaderNodeTextureUniform { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: visual_shader_node_uniform :: VisualShaderNodeUniform { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: visual_shader_node_uniform :: VisualShaderNodeUniform > for VisualShaderNodeTextureUniform { } unsafe impl SubClass < crate :: generated :: visual_shader_node :: VisualShaderNode > for VisualShaderNodeTextureUniform { } unsafe impl SubClass < crate :: generated :: resource :: Resource > for VisualShaderNodeTextureUniform { } unsafe impl SubClass < crate :: generated :: reference :: Reference > for VisualShaderNodeTextureUniform { } unsafe impl SubClass < crate :: generated :: object :: Object > for VisualShaderNodeTextureUniform { } impl Instanciable for VisualShaderNodeTextureUniform { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { VisualShaderNodeTextureUniform :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct VisualShaderNodeTextureUniformMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_color_default : * mut sys :: godot_method_bind , pub get_texture_type : * mut sys :: godot_method_bind , pub set_color_default : * mut sys :: godot_method_bind , pub set_texture_type : * mut sys :: godot_method_bind } impl VisualShaderNodeTextureUniformMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : VisualShaderNodeTextureUniformMethodTable = VisualShaderNodeTextureUniformMethodTable { class_constructor : None , get_color_default : 0 as * mut sys :: godot_method_bind , get_texture_type : 0 as * mut sys :: godot_method_bind , set_color_default : 0 as * mut sys :: godot_method_bind , set_texture_type : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { VisualShaderNodeTextureUniformMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "VisualShaderNodeTextureUniform\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_color_default = (gd_api . godot_method_bind_get_method) (class_name , "get_color_default\0" . as_ptr () as * const c_char) ; table . get_texture_type = (gd_api . godot_method_bind_get_method) (class_name , "get_texture_type\0" . as_ptr () as * const c_char) ; table . set_color_default = (gd_api . godot_method_bind_get_method) (class_name , "set_color_default\0" . as_ptr () as * const c_char) ; table . set_texture_type = (gd_api . godot_method_bind_get_method) (class_name , "set_texture_type\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:94:6131 [INFO] [stdout] | [INFO] [stdout] 94 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 94 | # [doc = "`core class VisualShaderNodeVectorOp` inherits `VisualShaderNode` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_visualshadernodevectorop.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nVisualShaderNodeVectorOp inherits methods from:\n - [VisualShaderNode](struct.VisualShaderNode.html)\n - [Resource](struct.Resource.html)\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct VisualShaderNodeVectorOp { this : RawObject < Self > , } # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct Operator (pub i64) ; impl Operator { pub const ADD : Operator = Operator (0i64) ; pub const SUB : Operator = Operator (1i64) ; pub const MUL : Operator = Operator (2i64) ; pub const DIV : Operator = Operator (3i64) ; pub const MOD : Operator = Operator (4i64) ; pub const POW : Operator = Operator (5i64) ; pub const MAX : Operator = Operator (6i64) ; pub const MIN : Operator = Operator (7i64) ; pub const CROSS : Operator = Operator (8i64) ; pub const ATAN2 : Operator = Operator (9i64) ; pub const REFLECT : Operator = Operator (10i64) ; pub const STEP : Operator = Operator (11i64) ; } impl From < i64 > for Operator { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < Operator > for i64 { # [inline] fn from (v : Operator) -> Self { v . 0 } } # [doc = "Constants"] # [allow (non_upper_case_globals)] impl VisualShaderNodeVectorOp { pub const OP_ADD : i64 = 0i64 ; pub const OP_ATAN2 : i64 = 9i64 ; pub const OP_CROSS : i64 = 8i64 ; pub const OP_DIV : i64 = 3i64 ; pub const OP_MAX : i64 = 6i64 ; pub const OP_MIN : i64 = 7i64 ; pub const OP_MOD : i64 = 4i64 ; pub const OP_MUL : i64 = 2i64 ; pub const OP_POW : i64 = 5i64 ; pub const OP_REFLECT : i64 = 10i64 ; pub const OP_STEP : i64 = 11i64 ; pub const OP_SUB : i64 = 1i64 ; } impl VisualShaderNodeVectorOp { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = VisualShaderNodeVectorOpMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "The operator to be used. See [enum Operator] for options."] # [doc = ""] # [inline] pub fn operator (& self) -> crate :: generated :: visual_shader_node_vector_op :: Operator { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualShaderNodeVectorOpMethodTable :: get (get_api ()) . get_operator ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; crate :: generated :: visual_shader_node_vector_op :: Operator (ret) } } # [doc = "The operator to be used. See [enum Operator] for options."] # [doc = ""] # [inline] pub fn set_operator (& self , op : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualShaderNodeVectorOpMethodTable :: get (get_api ()) . set_operator ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , op) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for VisualShaderNodeVectorOp { } unsafe impl GodotObject for VisualShaderNodeVectorOp { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "VisualShaderNodeVectorOp" } } impl std :: ops :: Deref for VisualShaderNodeVectorOp { type Target = crate :: generated :: visual_shader_node :: VisualShaderNode ; # [inline] fn deref (& self) -> & crate :: generated :: visual_shader_node :: VisualShaderNode { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for VisualShaderNodeVectorOp { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: visual_shader_node :: VisualShaderNode { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: visual_shader_node :: VisualShaderNode > for VisualShaderNodeVectorOp { } unsafe impl SubClass < crate :: generated :: resource :: Resource > for VisualShaderNodeVectorOp { } unsafe impl SubClass < crate :: generated :: reference :: Reference > for VisualShaderNodeVectorOp { } unsafe impl SubClass < crate :: generated :: object :: Object > for VisualShaderNodeVectorOp { } impl Instanciable for VisualShaderNodeVectorOp { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { VisualShaderNodeVectorOp :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct VisualShaderNodeVectorOpMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_operator : * mut sys :: godot_method_bind , pub set_operator : * mut sys :: godot_method_bind } impl VisualShaderNodeVectorOpMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : VisualShaderNodeVectorOpMethodTable = VisualShaderNodeVectorOpMethodTable { class_constructor : None , get_operator : 0 as * mut sys :: godot_method_bind , set_operator : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { VisualShaderNodeVectorOpMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "VisualShaderNodeVectorOp\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_operator = (gd_api . godot_method_bind_get_method) (class_name , "get_operator\0" . as_ptr () as * const c_char) ; table . set_operator = (gd_api . godot_method_bind_get_method) (class_name , "set_operator\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:484:11972 [INFO] [stdout] | [INFO] [stdout] 484 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 484 | # [doc = "`core class AnimationNode` inherits `Resource` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_animationnode.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nAnimationNode inherits methods from:\n - [Resource](struct.Resource.html)\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct AnimationNode { this : RawObject < Self > , } # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct FilterAction (pub i64) ; impl FilterAction { pub const IGNORE : FilterAction = FilterAction (0i64) ; pub const PASS : FilterAction = FilterAction (1i64) ; pub const STOP : FilterAction = FilterAction (2i64) ; pub const BLEND : FilterAction = FilterAction (3i64) ; } impl From < i64 > for FilterAction { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < FilterAction > for i64 { # [inline] fn from (v : FilterAction) -> Self { v . 0 } } # [doc = "Constants"] # [allow (non_upper_case_globals)] impl AnimationNode { pub const FILTER_BLEND : i64 = 3i64 ; pub const FILTER_IGNORE : i64 = 0i64 ; pub const FILTER_PASS : i64 = 1i64 ; pub const FILTER_STOP : i64 = 2i64 ; } impl AnimationNode { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AnimationNodeMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "Adds an input to the node. This is only useful for nodes created for use in an [AnimationNodeBlendTree]."] # [doc = ""] # [inline] pub fn add_input (& self , name : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeMethodTable :: get (get_api ()) . add_input ; let ret = crate :: icalls :: icallptr_void_str (method_bind , self . this . sys () . as_ptr () , name . into ()) ; } } # [doc = "Blend an animation by `blend` amount (name must be valid in the linked [AnimationPlayer]). A `time` and `delta` may be passed, as well as whether `seek` happened."] # [doc = ""] # [inline] pub fn blend_animation (& self , animation : impl Into < GodotString > , time : f64 , delta : f64 , seeked : bool , blend : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeMethodTable :: get (get_api ()) . blend_animation ; let ret = crate :: icalls :: icallptr_void_str_f64_f64_bool_f64 (method_bind , self . this . sys () . as_ptr () , animation . into () , time , delta , seeked , blend) ; } } # [doc = "Blend an input. This is only useful for nodes created for an [AnimationNodeBlendTree]. The `time` parameter is a relative delta, unless `seek` is `true`, in which case it is absolute. A filter mode may be optionally passed (see [enum FilterAction] for options).\n# Default Arguments\n* `filter` - `0`\n* `optimize` - `true`"] # [doc = ""] # [inline] pub fn blend_input (& self , input_index : i64 , time : f64 , seek : bool , blend : f64 , filter : i64 , optimize : bool) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeMethodTable :: get (get_api ()) . blend_input ; let ret = crate :: icalls :: icallptr_f64_i64_f64_bool_f64_i64_bool (method_bind , self . this . sys () . as_ptr () , input_index , time , seek , blend , filter , optimize) ; ret as _ } } # [doc = "Blend another animation node (in case this node contains children animation nodes). This function is only useful if you inherit from [AnimationRootNode] instead, else editors will not display your node for addition.\n# Default Arguments\n* `filter` - `0`\n* `optimize` - `true`"] # [doc = ""] # [inline] pub fn blend_node (& self , name : impl Into < GodotString > , node : impl AsArg < crate :: generated :: animation_node :: AnimationNode > , time : f64 , seek : bool , blend : f64 , filter : i64 , optimize : bool) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeMethodTable :: get (get_api ()) . blend_node ; let ret = crate :: icalls :: icallptr_f64_str_obj_f64_bool_f64_i64_bool (method_bind , self . this . sys () . as_ptr () , name . into () , node . as_arg_ptr () , time , seek , blend , filter , optimize) ; ret as _ } } # [doc = "Amount of inputs in this node, only useful for nodes that go into [AnimationNodeBlendTree]."] # [doc = ""] # [inline] pub fn get_input_count (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeMethodTable :: get (get_api ()) . get_input_count ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Gets the name of an input by index."] # [doc = ""] # [inline] pub fn get_input_name (& self , input : i64) -> GodotString { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeMethodTable :: get (get_api ()) . get_input_name ; let ret = crate :: icalls :: icallptr_str_i64 (method_bind , self . this . sys () . as_ptr () , input) ; GodotString :: from_sys (ret) } } # [doc = "Gets the value of a parameter. Parameters are custom local memory used for your nodes, given a resource can be reused in multiple trees."] # [doc = ""] # [inline] pub fn get_parameter (& self , name : impl Into < GodotString >) -> Variant { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeMethodTable :: get (get_api ()) . get_parameter ; let ret = crate :: icalls :: icallptr_var_str (method_bind , self . this . sys () . as_ptr () , name . into ()) ; Variant :: from_sys (ret) } } # [doc = "If `true`, filtering is enabled."] # [doc = ""] # [inline] pub fn is_filter_enabled (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeMethodTable :: get (get_api ()) . is_filter_enabled ; let ret = crate :: icalls :: icallptr_bool (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Returns `true` whether a given path is filtered."] # [doc = ""] # [inline] pub fn is_path_filtered (& self , path : impl Into < NodePath >) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeMethodTable :: get (get_api ()) . is_path_filtered ; let ret = crate :: icalls :: icallptr_bool_nodepath (method_bind , self . this . sys () . as_ptr () , path . into ()) ; ret as _ } } # [doc = "Removes an input, call this only when inactive."] # [doc = ""] # [inline] pub fn remove_input (& self , index : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeMethodTable :: get (get_api ()) . remove_input ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , index) ; } } # [doc = "If `true`, filtering is enabled."] # [doc = ""] # [inline] pub fn set_filter_enabled (& self , enable : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeMethodTable :: get (get_api ()) . set_filter_enabled ; let ret = crate :: icalls :: icallptr_void_bool (method_bind , self . this . sys () . as_ptr () , enable) ; } } # [doc = "Adds or removes a path for the filter."] # [doc = ""] # [inline] pub fn set_filter_path (& self , path : impl Into < NodePath > , enable : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeMethodTable :: get (get_api ()) . set_filter_path ; let ret = crate :: icalls :: icallptr_void_nodepath_bool (method_bind , self . this . sys () . as_ptr () , path . into () , enable) ; } } # [doc = "Sets a custom parameter. These are used as local storage, because resources can be reused across the tree or scenes."] # [doc = ""] # [inline] pub fn set_parameter (& self , name : impl Into < GodotString > , value : impl OwnedToVariant) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeMethodTable :: get (get_api ()) . set_parameter ; let ret = crate :: icalls :: icallptr_void_str_var (method_bind , self . this . sys () . as_ptr () , name . into () , value . owned_to_variant ()) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for AnimationNode { } unsafe impl GodotObject for AnimationNode { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AnimationNode" } } impl std :: ops :: Deref for AnimationNode { type Target = crate :: generated :: resource :: Resource ; # [inline] fn deref (& self) -> & crate :: generated :: resource :: Resource { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AnimationNode { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: resource :: Resource { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: resource :: Resource > for AnimationNode { } unsafe impl SubClass < crate :: generated :: reference :: Reference > for AnimationNode { } unsafe impl SubClass < crate :: generated :: object :: Object > for AnimationNode { } impl Instanciable for AnimationNode { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { AnimationNode :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AnimationNodeMethodTable { pub class_constructor : sys :: godot_class_constructor , pub add_input : * mut sys :: godot_method_bind , pub blend_animation : * mut sys :: godot_method_bind , pub blend_input : * mut sys :: godot_method_bind , pub blend_node : * mut sys :: godot_method_bind , pub get_input_count : * mut sys :: godot_method_bind , pub get_input_name : * mut sys :: godot_method_bind , pub get_parameter : * mut sys :: godot_method_bind , pub is_filter_enabled : * mut sys :: godot_method_bind , pub is_path_filtered : * mut sys :: godot_method_bind , pub remove_input : * mut sys :: godot_method_bind , pub set_filter_enabled : * mut sys :: godot_method_bind , pub set_filter_path : * mut sys :: godot_method_bind , pub set_parameter : * mut sys :: godot_method_bind } impl AnimationNodeMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AnimationNodeMethodTable = AnimationNodeMethodTable { class_constructor : None , add_input : 0 as * mut sys :: godot_method_bind , blend_animation : 0 as * mut sys :: godot_method_bind , blend_input : 0 as * mut sys :: godot_method_bind , blend_node : 0 as * mut sys :: godot_method_bind , get_input_count : 0 as * mut sys :: godot_method_bind , get_input_name : 0 as * mut sys :: godot_method_bind , get_parameter : 0 as * mut sys :: godot_method_bind , is_filter_enabled : 0 as * mut sys :: godot_method_bind , is_path_filtered : 0 as * mut sys :: godot_method_bind , remove_input : 0 as * mut sys :: godot_method_bind , set_filter_enabled : 0 as * mut sys :: godot_method_bind , set_filter_path : 0 as * mut sys :: godot_method_bind , set_parameter : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { AnimationNodeMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AnimationNode\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . add_input = (gd_api . godot_method_bind_get_method) (class_name , "add_input\0" . as_ptr () as * const c_char) ; table . blend_animation = (gd_api . godot_method_bind_get_method) (class_name , "blend_animation\0" . as_ptr () as * const c_char) ; table . blend_input = (gd_api . godot_method_bind_get_method) (class_name , "blend_input\0" . as_ptr () as * const c_char) ; table . blend_node = (gd_api . godot_method_bind_get_method) (class_name , "blend_node\0" . as_ptr () as * const c_char) ; table . get_input_count = (gd_api . godot_method_bind_get_method) (class_name , "get_input_count\0" . as_ptr () as * const c_char) ; table . get_input_name = (gd_api . godot_method_bind_get_method) (class_name , "get_input_name\0" . as_ptr () as * const c_char) ; table . get_parameter = (gd_api . godot_method_bind_get_method) (class_name , "get_parameter\0" . as_ptr () as * const c_char) ; table . is_filter_enabled = (gd_api . godot_method_bind_get_method) (class_name , "is_filter_enabled\0" . as_ptr () as * const c_char) ; table . is_path_filtered = (gd_api . godot_method_bind_get_method) (class_name , "is_path_filtered\0" . as_ptr () as * const c_char) ; table . remove_input = (gd_api . godot_method_bind_get_method) (class_name , "remove_input\0" . as_ptr () as * const c_char) ; table . set_filter_enabled = (gd_api . godot_method_bind_get_method) (class_name , "set_filter_enabled\0" . as_ptr () as * const c_char) ; table . set_filter_path = (gd_api . godot_method_bind_get_method) (class_name , "set_filter_path\0" . as_ptr () as * const c_char) ; table . set_parameter = (gd_api . godot_method_bind_get_method) (class_name , "set_parameter\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:100:4015 [INFO] [stdout] | [INFO] [stdout] 100 | ...thodTable { class_constructor : None , } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 100 | # [doc = "`core class VisualShaderNodeVectorScalarSmoothStep` inherits `VisualShaderNode` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_visualshadernodevectorscalarsmoothstep.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nVisualShaderNodeVectorScalarSmoothStep inherits methods from:\n - [VisualShaderNode](struct.VisualShaderNode.html)\n - [Resource](struct.Resource.html)\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct VisualShaderNodeVectorScalarSmoothStep { this : RawObject < Self > , } impl VisualShaderNodeVectorScalarSmoothStep { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = VisualShaderNodeVectorScalarSmoothStepMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } } impl gdnative_core :: private :: godot_object :: Sealed for VisualShaderNodeVectorScalarSmoothStep { } unsafe impl GodotObject for VisualShaderNodeVectorScalarSmoothStep { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "VisualShaderNodeVectorScalarSmoothStep" } } impl std :: ops :: Deref for VisualShaderNodeVectorScalarSmoothStep { type Target = crate :: generated :: visual_shader_node :: VisualShaderNode ; # [inline] fn deref (& self) -> & crate :: generated :: visual_shader_node :: VisualShaderNode { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for VisualShaderNodeVectorScalarSmoothStep { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: visual_shader_node :: VisualShaderNode { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: visual_shader_node :: VisualShaderNode > for VisualShaderNodeVectorScalarSmoothStep { } unsafe impl SubClass < crate :: generated :: resource :: Resource > for VisualShaderNodeVectorScalarSmoothStep { } unsafe impl SubClass < crate :: generated :: reference :: Reference > for VisualShaderNodeVectorScalarSmoothStep { } unsafe impl SubClass < crate :: generated :: object :: Object > for VisualShaderNodeVectorScalarSmoothStep { } impl Instanciable for VisualShaderNodeVectorScalarSmoothStep { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { VisualShaderNodeVectorScalarSmoothStep :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct VisualShaderNodeVectorScalarSmoothStepMethodTable { pub class_constructor : sys :: godot_class_constructor , } impl VisualShaderNodeVectorScalarSmoothStepMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : VisualShaderNodeVectorScalarSmoothStepMethodTable = VisualShaderNodeVectorScalarSmoothStepMethodTable { class_constructor : None , } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { VisualShaderNodeVectorScalarSmoothStepMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "VisualShaderNodeVectorScalarSmoothStep\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:490:4841 [INFO] [stdout] | [INFO] [stdout] 490 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 490 | # [doc = "`core class VisualScriptFunctionState` inherits `Reference` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_visualscriptfunctionstate.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nVisualScriptFunctionState inherits methods from:\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct VisualScriptFunctionState { this : RawObject < Self > , } impl VisualScriptFunctionState { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = VisualScriptFunctionStateMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = ""] # [doc = ""] # [inline] pub fn connect_to_signal (& self , obj : impl AsArg < crate :: generated :: object :: Object > , signals : impl Into < GodotString > , args : VariantArray) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualScriptFunctionStateMethodTable :: get (get_api ()) . connect_to_signal ; let ret = crate :: icalls :: icallptr_void_obj_str_arr (method_bind , self . this . sys () . as_ptr () , obj . as_arg_ptr () , signals . into () , args) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn is_valid (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualScriptFunctionStateMethodTable :: get (get_api ()) . is_valid ; let ret = crate :: icalls :: icallptr_bool (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = ""] # [doc = ""] # [inline] pub fn resume (& self , args : VariantArray) -> Variant { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualScriptFunctionStateMethodTable :: get (get_api ()) . resume ; let ret = crate :: icalls :: icallptr_var_arr (method_bind , self . this . sys () . as_ptr () , args) ; Variant :: from_sys (ret) } } } impl gdnative_core :: private :: godot_object :: Sealed for VisualScriptFunctionState { } unsafe impl GodotObject for VisualScriptFunctionState { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "VisualScriptFunctionState" } } impl std :: ops :: Deref for VisualScriptFunctionState { type Target = crate :: generated :: reference :: Reference ; # [inline] fn deref (& self) -> & crate :: generated :: reference :: Reference { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for VisualScriptFunctionState { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: reference :: Reference { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: reference :: Reference > for VisualScriptFunctionState { } unsafe impl SubClass < crate :: generated :: object :: Object > for VisualScriptFunctionState { } impl Instanciable for VisualScriptFunctionState { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { VisualScriptFunctionState :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct VisualScriptFunctionStateMethodTable { pub class_constructor : sys :: godot_class_constructor , pub connect_to_signal : * mut sys :: godot_method_bind , pub is_valid : * mut sys :: godot_method_bind , pub resume : * mut sys :: godot_method_bind } impl VisualScriptFunctionStateMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : VisualScriptFunctionStateMethodTable = VisualScriptFunctionStateMethodTable { class_constructor : None , connect_to_signal : 0 as * mut sys :: godot_method_bind , is_valid : 0 as * mut sys :: godot_method_bind , resume : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { VisualScriptFunctionStateMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "VisualScriptFunctionState\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . connect_to_signal = (gd_api . godot_method_bind_get_method) (class_name , "connect_to_signal\0" . as_ptr () as * const c_char) ; table . is_valid = (gd_api . godot_method_bind_get_method) (class_name , "is_valid\0" . as_ptr () as * const c_char) ; table . resume = (gd_api . godot_method_bind_get_method) (class_name , "resume\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:106:3393 [INFO] [stdout] | [INFO] [stdout] 106 | ...thodTable { class_constructor : None , } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 106 | # [doc = "`core class PacketPeerGDNative` inherits `PacketPeer` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_packetpeergdnative.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nPacketPeerGDNative inherits methods from:\n - [PacketPeer](struct.PacketPeer.html)\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct PacketPeerGDNative { this : RawObject < Self > , } impl PacketPeerGDNative { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = PacketPeerGDNativeMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } } impl gdnative_core :: private :: godot_object :: Sealed for PacketPeerGDNative { } unsafe impl GodotObject for PacketPeerGDNative { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "PacketPeerGDNative" } } impl std :: ops :: Deref for PacketPeerGDNative { type Target = crate :: generated :: packet_peer :: PacketPeer ; # [inline] fn deref (& self) -> & crate :: generated :: packet_peer :: PacketPeer { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for PacketPeerGDNative { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: packet_peer :: PacketPeer { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: packet_peer :: PacketPeer > for PacketPeerGDNative { } unsafe impl SubClass < crate :: generated :: reference :: Reference > for PacketPeerGDNative { } unsafe impl SubClass < crate :: generated :: object :: Object > for PacketPeerGDNative { } impl Instanciable for PacketPeerGDNative { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { PacketPeerGDNative :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct PacketPeerGDNativeMethodTable { pub class_constructor : sys :: godot_class_constructor , } impl PacketPeerGDNativeMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : PacketPeerGDNativeMethodTable = PacketPeerGDNativeMethodTable { class_constructor : None , } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { PacketPeerGDNativeMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "PacketPeerGDNative\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:496:5821 [INFO] [stdout] | [INFO] [stdout] 496 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 496 | # [doc = "`core class AudioStreamRandomPitch` inherits `AudioStream` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_audiostreamrandompitch.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nAudioStreamRandomPitch inherits methods from:\n - [AudioStream](struct.AudioStream.html)\n - [Resource](struct.Resource.html)\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct AudioStreamRandomPitch { this : RawObject < Self > , } impl AudioStreamRandomPitch { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AudioStreamRandomPitchMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "The current [AudioStream]."] # [doc = ""] # [inline] pub fn audio_stream (& self) -> Option < Ref < crate :: generated :: audio_stream :: AudioStream , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamRandomPitchMethodTable :: get (get_api ()) . get_audio_stream ; let ret = crate :: icalls :: icallptr_obj (method_bind , self . this . sys () . as_ptr ()) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: audio_stream :: AudioStream , thread_access :: Shared >> :: move_from_sys (sys)) } } # [doc = "The intensity of random pitch variation."] # [doc = ""] # [inline] pub fn random_pitch (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamRandomPitchMethodTable :: get (get_api ()) . get_random_pitch ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "The current [AudioStream]."] # [doc = ""] # [inline] pub fn set_audio_stream (& self , stream : impl AsArg < crate :: generated :: audio_stream :: AudioStream >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamRandomPitchMethodTable :: get (get_api ()) . set_audio_stream ; let ret = crate :: icalls :: icallptr_void_obj (method_bind , self . this . sys () . as_ptr () , stream . as_arg_ptr ()) ; } } # [doc = "The intensity of random pitch variation."] # [doc = ""] # [inline] pub fn set_random_pitch (& self , scale : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamRandomPitchMethodTable :: get (get_api ()) . set_random_pitch ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , scale) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for AudioStreamRandomPitch { } unsafe impl GodotObject for AudioStreamRandomPitch { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AudioStreamRandomPitch" } } impl std :: ops :: Deref for AudioStreamRandomPitch { type Target = crate :: generated :: audio_stream :: AudioStream ; # [inline] fn deref (& self) -> & crate :: generated :: audio_stream :: AudioStream { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AudioStreamRandomPitch { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: audio_stream :: AudioStream { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: audio_stream :: AudioStream > for AudioStreamRandomPitch { } unsafe impl SubClass < crate :: generated :: resource :: Resource > for AudioStreamRandomPitch { } unsafe impl SubClass < crate :: generated :: reference :: Reference > for AudioStreamRandomPitch { } unsafe impl SubClass < crate :: generated :: object :: Object > for AudioStreamRandomPitch { } impl Instanciable for AudioStreamRandomPitch { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { AudioStreamRandomPitch :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AudioStreamRandomPitchMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_audio_stream : * mut sys :: godot_method_bind , pub get_random_pitch : * mut sys :: godot_method_bind , pub set_audio_stream : * mut sys :: godot_method_bind , pub set_random_pitch : * mut sys :: godot_method_bind } impl AudioStreamRandomPitchMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AudioStreamRandomPitchMethodTable = AudioStreamRandomPitchMethodTable { class_constructor : None , get_audio_stream : 0 as * mut sys :: godot_method_bind , get_random_pitch : 0 as * mut sys :: godot_method_bind , set_audio_stream : 0 as * mut sys :: godot_method_bind , set_random_pitch : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { AudioStreamRandomPitchMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AudioStreamRandomPitch\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_audio_stream = (gd_api . godot_method_bind_get_method) (class_name , "get_audio_stream\0" . as_ptr () as * const c_char) ; table . get_random_pitch = (gd_api . godot_method_bind_get_method) (class_name , "get_random_pitch\0" . as_ptr () as * const c_char) ; table . set_audio_stream = (gd_api . godot_method_bind_get_method) (class_name , "set_audio_stream\0" . as_ptr () as * const c_char) ; table . set_random_pitch = (gd_api . godot_method_bind_get_method) (class_name , "set_random_pitch\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:112:11175 [INFO] [stdout] | [INFO] [stdout] 112 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 112 | # [doc = "`core class StaticBody2D` inherits `PhysicsBody2D` (unsafe)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_staticbody2d.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nNon reference counted objects such as the ones of this type are usually owned by the engine.\n\n`StaticBody2D` is a reference-only type. Persistent references can\nonly exist in the unsafe `Ref` form.\n\nIn the cases where Rust code owns an object of this type, for example if the object was just\ncreated on the Rust side and not passed to the engine yet, ownership should be either given\nto the engine or the object must be manually destroyed using `Ref::free`, or `Ref::queue_free`\nif it is a `Node`."] # [doc = "\n## Class hierarchy\n\nStaticBody2D inherits methods from:\n - [PhysicsBody2D](struct.PhysicsBody2D.html)\n - [CollisionObject2D](struct.CollisionObject2D.html)\n - [Node2D](struct.Node2D.html)\n - [CanvasItem](struct.CanvasItem.html)\n - [Node](struct.Node.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct StaticBody2D { this : RawObject < Self > , } impl StaticBody2D { # [doc = "Creates a new instance of this object.\n\nBecause this type is not reference counted, the lifetime of the returned object\nis *not* automatically managed.\n\nImmediately after creation, the object is owned by the caller, and can be\npassed to the engine (in which case the engine will be responsible for\ndestroying the object) or destroyed manually using `Ref::free`, or preferably\n`Ref::queue_free` if it is a `Node`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = StaticBody2DMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "The body's bounciness. Values range from `0` (no bounce) to `1` (full bounciness).\nDeprecated, use [member PhysicsMaterial.bounce] instead via [member physics_material_override]."] # [doc = ""] # [inline] pub fn bounce (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = StaticBody2DMethodTable :: get (get_api ()) . get_bounce ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "The body's constant angular velocity. This does not rotate the body, but affects colliding bodies, as if it were rotating."] # [doc = ""] # [inline] pub fn constant_angular_velocity (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = StaticBody2DMethodTable :: get (get_api ()) . get_constant_angular_velocity ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "The body's constant linear velocity. This does not move the body, but affects colliding bodies, as if it were moving."] # [doc = ""] # [inline] pub fn constant_linear_velocity (& self) -> Vector2 { unsafe { let method_bind : * mut sys :: godot_method_bind = StaticBody2DMethodTable :: get (get_api ()) . get_constant_linear_velocity ; let ret = crate :: icalls :: icallptr_vec2 (method_bind , self . this . sys () . as_ptr ()) ; mem :: transmute (ret) } } # [doc = "The body's friction. Values range from `0` (no friction) to `1` (full friction).\nDeprecated, use [member PhysicsMaterial.friction] instead via [member physics_material_override]."] # [doc = ""] # [inline] pub fn friction (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = StaticBody2DMethodTable :: get (get_api ()) . get_friction ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "The physics material override for the body.\nIf a material is assigned to this property, it will be used instead of any other physics material, such as an inherited one."] # [doc = ""] # [inline] pub fn physics_material_override (& self) -> Option < Ref < crate :: generated :: physics_material :: PhysicsMaterial , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = StaticBody2DMethodTable :: get (get_api ()) . get_physics_material_override ; let ret = crate :: icalls :: icallptr_obj (method_bind , self . this . sys () . as_ptr ()) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: physics_material :: PhysicsMaterial , thread_access :: Shared >> :: move_from_sys (sys)) } } # [doc = "The body's bounciness. Values range from `0` (no bounce) to `1` (full bounciness).\nDeprecated, use [member PhysicsMaterial.bounce] instead via [member physics_material_override]."] # [doc = ""] # [inline] pub fn set_bounce (& self , bounce : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = StaticBody2DMethodTable :: get (get_api ()) . set_bounce ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , bounce) ; } } # [doc = "The body's constant angular velocity. This does not rotate the body, but affects colliding bodies, as if it were rotating."] # [doc = ""] # [inline] pub fn set_constant_angular_velocity (& self , vel : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = StaticBody2DMethodTable :: get (get_api ()) . set_constant_angular_velocity ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , vel) ; } } # [doc = "The body's constant linear velocity. This does not move the body, but affects colliding bodies, as if it were moving."] # [doc = ""] # [inline] pub fn set_constant_linear_velocity (& self , vel : Vector2) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = StaticBody2DMethodTable :: get (get_api ()) . set_constant_linear_velocity ; let ret = crate :: icalls :: icallptr_void_vec2 (method_bind , self . this . sys () . as_ptr () , vel) ; } } # [doc = "The body's friction. Values range from `0` (no friction) to `1` (full friction).\nDeprecated, use [member PhysicsMaterial.friction] instead via [member physics_material_override]."] # [doc = ""] # [inline] pub fn set_friction (& self , friction : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = StaticBody2DMethodTable :: get (get_api ()) . set_friction ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , friction) ; } } # [doc = "The physics material override for the body.\nIf a material is assigned to this property, it will be used instead of any other physics material, such as an inherited one."] # [doc = ""] # [inline] pub fn set_physics_material_override (& self , physics_material_override : impl AsArg < crate :: generated :: physics_material :: PhysicsMaterial >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = StaticBody2DMethodTable :: get (get_api ()) . set_physics_material_override ; let ret = crate :: icalls :: icallptr_void_obj (method_bind , self . this . sys () . as_ptr () , physics_material_override . as_arg_ptr ()) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for StaticBody2D { } unsafe impl GodotObject for StaticBody2D { type RefKind = ref_kind :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "StaticBody2D" } } impl QueueFree for StaticBody2D { # [inline] unsafe fn godot_queue_free (obj : * mut sys :: godot_object) { let method_bind : * mut sys :: godot_method_bind = crate :: generated :: node :: NodeMethodTable :: get (get_api ()) . queue_free ; crate :: icalls :: icallptr_void (method_bind , obj) } } impl std :: ops :: Deref for StaticBody2D { type Target = crate :: generated :: physics_body_2d :: PhysicsBody2D ; # [inline] fn deref (& self) -> & crate :: generated :: physics_body_2d :: PhysicsBody2D { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for StaticBody2D { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: physics_body_2d :: PhysicsBody2D { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: physics_body_2d :: PhysicsBody2D > for StaticBody2D { } unsafe impl SubClass < crate :: generated :: collision_object_2d :: CollisionObject2D > for StaticBody2D { } unsafe impl SubClass < crate :: generated :: node_2d :: Node2D > for StaticBody2D { } unsafe impl SubClass < crate :: generated :: canvas_item :: CanvasItem > for StaticBody2D { } unsafe impl SubClass < crate :: generated :: node :: Node > for StaticBody2D { } unsafe impl SubClass < crate :: generated :: object :: Object > for StaticBody2D { } impl Instanciable for StaticBody2D { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { StaticBody2D :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct StaticBody2DMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_bounce : * mut sys :: godot_method_bind , pub get_constant_angular_velocity : * mut sys :: godot_method_bind , pub get_constant_linear_velocity : * mut sys :: godot_method_bind , pub get_friction : * mut sys :: godot_method_bind , pub get_physics_material_override : * mut sys :: godot_method_bind , pub set_bounce : * mut sys :: godot_method_bind , pub set_constant_angular_velocity : * mut sys :: godot_method_bind , pub set_constant_linear_velocity : * mut sys :: godot_method_bind , pub set_friction : * mut sys :: godot_method_bind , pub set_physics_material_override : * mut sys :: godot_method_bind } impl StaticBody2DMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : StaticBody2DMethodTable = StaticBody2DMethodTable { class_constructor : None , get_bounce : 0 as * mut sys :: godot_method_bind , get_constant_angular_velocity : 0 as * mut sys :: godot_method_bind , get_constant_linear_velocity : 0 as * mut sys :: godot_method_bind , get_friction : 0 as * mut sys :: godot_method_bind , get_physics_material_override : 0 as * mut sys :: godot_method_bind , set_bounce : 0 as * mut sys :: godot_method_bind , set_constant_angular_velocity : 0 as * mut sys :: godot_method_bind , set_constant_linear_velocity : 0 as * mut sys :: godot_method_bind , set_friction : 0 as * mut sys :: godot_method_bind , set_physics_material_override : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { StaticBody2DMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "StaticBody2D\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_bounce = (gd_api . godot_method_bind_get_method) (class_name , "get_bounce\0" . as_ptr () as * const c_char) ; table . get_constant_angular_velocity = (gd_api . godot_method_bind_get_method) (class_name , "get_constant_angular_velocity\0" . as_ptr () as * const c_char) ; table . get_constant_linear_velocity = (gd_api . godot_method_bind_get_method) (class_name , "get_constant_linear_velocity\0" . as_ptr () as * const c_char) ; table . get_friction = (gd_api . godot_method_bind_get_method) (class_name , "get_friction\0" . as_ptr () as * const c_char) ; table . get_physics_material_override = (gd_api . godot_method_bind_get_method) (class_name , "get_physics_material_override\0" . as_ptr () as * const c_char) ; table . set_bounce = (gd_api . godot_method_bind_get_method) (class_name , "set_bounce\0" . as_ptr () as * const c_char) ; table . set_constant_angular_velocity = (gd_api . godot_method_bind_get_method) (class_name , "set_constant_angular_velocity\0" . as_ptr () as * const c_char) ; table . set_constant_linear_velocity = (gd_api . godot_method_bind_get_method) (class_name , "set_constant_linear_velocity\0" . as_ptr () as * const c_char) ; table . set_friction = (gd_api . godot_method_bind_get_method) (class_name , "set_friction\0" . as_ptr () as * const c_char) ; table . set_physics_material_override = (gd_api . godot_method_bind_get_method) (class_name , "set_physics_material_override\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:502:7245 [INFO] [stdout] | [INFO] [stdout] 502 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 502 | # [doc = "`core class InputEventScreenDrag` inherits `InputEvent` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_inputeventscreendrag.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nInputEventScreenDrag inherits methods from:\n - [InputEvent](struct.InputEvent.html)\n - [Resource](struct.Resource.html)\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct InputEventScreenDrag { this : RawObject < Self > , } impl InputEventScreenDrag { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = InputEventScreenDragMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "The drag event index in the case of a multi-drag event."] # [doc = ""] # [inline] pub fn index (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = InputEventScreenDragMethodTable :: get (get_api ()) . get_index ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "The drag position."] # [doc = ""] # [inline] pub fn position (& self) -> Vector2 { unsafe { let method_bind : * mut sys :: godot_method_bind = InputEventScreenDragMethodTable :: get (get_api ()) . get_position ; let ret = crate :: icalls :: icallptr_vec2 (method_bind , self . this . sys () . as_ptr ()) ; mem :: transmute (ret) } } # [doc = "The drag position relative to its start position."] # [doc = ""] # [inline] pub fn relative (& self) -> Vector2 { unsafe { let method_bind : * mut sys :: godot_method_bind = InputEventScreenDragMethodTable :: get (get_api ()) . get_relative ; let ret = crate :: icalls :: icallptr_vec2 (method_bind , self . this . sys () . as_ptr ()) ; mem :: transmute (ret) } } # [doc = "The drag speed."] # [doc = ""] # [inline] pub fn speed (& self) -> Vector2 { unsafe { let method_bind : * mut sys :: godot_method_bind = InputEventScreenDragMethodTable :: get (get_api ()) . get_speed ; let ret = crate :: icalls :: icallptr_vec2 (method_bind , self . this . sys () . as_ptr ()) ; mem :: transmute (ret) } } # [doc = "The drag event index in the case of a multi-drag event."] # [doc = ""] # [inline] pub fn set_index (& self , index : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = InputEventScreenDragMethodTable :: get (get_api ()) . set_index ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , index) ; } } # [doc = "The drag position."] # [doc = ""] # [inline] pub fn set_position (& self , position : Vector2) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = InputEventScreenDragMethodTable :: get (get_api ()) . set_position ; let ret = crate :: icalls :: icallptr_void_vec2 (method_bind , self . this . sys () . as_ptr () , position) ; } } # [doc = "The drag position relative to its start position."] # [doc = ""] # [inline] pub fn set_relative (& self , relative : Vector2) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = InputEventScreenDragMethodTable :: get (get_api ()) . set_relative ; let ret = crate :: icalls :: icallptr_void_vec2 (method_bind , self . this . sys () . as_ptr () , relative) ; } } # [doc = "The drag speed."] # [doc = ""] # [inline] pub fn set_speed (& self , speed : Vector2) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = InputEventScreenDragMethodTable :: get (get_api ()) . set_speed ; let ret = crate :: icalls :: icallptr_void_vec2 (method_bind , self . this . sys () . as_ptr () , speed) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for InputEventScreenDrag { } unsafe impl GodotObject for InputEventScreenDrag { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "InputEventScreenDrag" } } impl std :: ops :: Deref for InputEventScreenDrag { type Target = crate :: generated :: input_event :: InputEvent ; # [inline] fn deref (& self) -> & crate :: generated :: input_event :: InputEvent { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for InputEventScreenDrag { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: input_event :: InputEvent { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: input_event :: InputEvent > for InputEventScreenDrag { } unsafe impl SubClass < crate :: generated :: resource :: Resource > for InputEventScreenDrag { } unsafe impl SubClass < crate :: generated :: reference :: Reference > for InputEventScreenDrag { } unsafe impl SubClass < crate :: generated :: object :: Object > for InputEventScreenDrag { } impl Instanciable for InputEventScreenDrag { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { InputEventScreenDrag :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct InputEventScreenDragMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_index : * mut sys :: godot_method_bind , pub get_position : * mut sys :: godot_method_bind , pub get_relative : * mut sys :: godot_method_bind , pub get_speed : * mut sys :: godot_method_bind , pub set_index : * mut sys :: godot_method_bind , pub set_position : * mut sys :: godot_method_bind , pub set_relative : * mut sys :: godot_method_bind , pub set_speed : * mut sys :: godot_method_bind } impl InputEventScreenDragMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : InputEventScreenDragMethodTable = InputEventScreenDragMethodTable { class_constructor : None , get_index : 0 as * mut sys :: godot_method_bind , get_position : 0 as * mut sys :: godot_method_bind , get_relative : 0 as * mut sys :: godot_method_bind , get_speed : 0 as * mut sys :: godot_method_bind , set_index : 0 as * mut sys :: godot_method_bind , set_position : 0 as * mut sys :: godot_method_bind , set_relative : 0 as * mut sys :: godot_method_bind , set_speed : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { InputEventScreenDragMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "InputEventScreenDrag\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_index = (gd_api . godot_method_bind_get_method) (class_name , "get_index\0" . as_ptr () as * const c_char) ; table . get_position = (gd_api . godot_method_bind_get_method) (class_name , "get_position\0" . as_ptr () as * const c_char) ; table . get_relative = (gd_api . godot_method_bind_get_method) (class_name , "get_relative\0" . as_ptr () as * const c_char) ; table . get_speed = (gd_api . godot_method_bind_get_method) (class_name , "get_speed\0" . as_ptr () as * const c_char) ; table . set_index = (gd_api . godot_method_bind_get_method) (class_name , "set_index\0" . as_ptr () as * const c_char) ; table . set_position = (gd_api . godot_method_bind_get_method) (class_name , "set_position\0" . as_ptr () as * const c_char) ; table . set_relative = (gd_api . godot_method_bind_get_method) (class_name , "set_relative\0" . as_ptr () as * const c_char) ; table . set_speed = (gd_api . godot_method_bind_get_method) (class_name , "set_speed\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:118:3889 [INFO] [stdout] | [INFO] [stdout] 118 | ...thodTable { class_constructor : None , } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 118 | # [doc = "`core class VisualShaderNodeVectorScalarStep` inherits `VisualShaderNode` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_visualshadernodevectorscalarstep.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nVisualShaderNodeVectorScalarStep inherits methods from:\n - [VisualShaderNode](struct.VisualShaderNode.html)\n - [Resource](struct.Resource.html)\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct VisualShaderNodeVectorScalarStep { this : RawObject < Self > , } impl VisualShaderNodeVectorScalarStep { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = VisualShaderNodeVectorScalarStepMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } } impl gdnative_core :: private :: godot_object :: Sealed for VisualShaderNodeVectorScalarStep { } unsafe impl GodotObject for VisualShaderNodeVectorScalarStep { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "VisualShaderNodeVectorScalarStep" } } impl std :: ops :: Deref for VisualShaderNodeVectorScalarStep { type Target = crate :: generated :: visual_shader_node :: VisualShaderNode ; # [inline] fn deref (& self) -> & crate :: generated :: visual_shader_node :: VisualShaderNode { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for VisualShaderNodeVectorScalarStep { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: visual_shader_node :: VisualShaderNode { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: visual_shader_node :: VisualShaderNode > for VisualShaderNodeVectorScalarStep { } unsafe impl SubClass < crate :: generated :: resource :: Resource > for VisualShaderNodeVectorScalarStep { } unsafe impl SubClass < crate :: generated :: reference :: Reference > for VisualShaderNodeVectorScalarStep { } unsafe impl SubClass < crate :: generated :: object :: Object > for VisualShaderNodeVectorScalarStep { } impl Instanciable for VisualShaderNodeVectorScalarStep { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { VisualShaderNodeVectorScalarStep :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct VisualShaderNodeVectorScalarStepMethodTable { pub class_constructor : sys :: godot_class_constructor , } impl VisualShaderNodeVectorScalarStepMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : VisualShaderNodeVectorScalarStepMethodTable = VisualShaderNodeVectorScalarStepMethodTable { class_constructor : None , } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { VisualShaderNodeVectorScalarStepMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "VisualShaderNodeVectorScalarStep\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:124:11831 [INFO] [stdout] | [INFO] [stdout] 124 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 124 | # [doc = "`core class AudioEffectReverb` inherits `AudioEffect` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_audioeffectreverb.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nAudioEffectReverb inherits methods from:\n - [AudioEffect](struct.AudioEffect.html)\n - [Resource](struct.Resource.html)\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct AudioEffectReverb { this : RawObject < Self > , } impl AudioEffectReverb { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AudioEffectReverbMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "Defines how reflective the imaginary room's walls are. Value can range from 0 to 1."] # [doc = ""] # [inline] pub fn damping (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectReverbMethodTable :: get (get_api ()) . get_damping ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Output percent of original sound. At 0, only modified sound is outputted. Value can range from 0 to 1."] # [doc = ""] # [inline] pub fn dry (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectReverbMethodTable :: get (get_api ()) . get_dry ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "High-pass filter passes signals with a frequency higher than a certain cutoff frequency and attenuates signals with frequencies lower than the cutoff frequency. Value can range from 0 to 1."] # [doc = ""] # [inline] pub fn hpf (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectReverbMethodTable :: get (get_api ()) . get_hpf ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Output percent of predelay. Value can range from 0 to 1."] # [doc = ""] # [inline] pub fn predelay_feedback (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectReverbMethodTable :: get (get_api ()) . get_predelay_feedback ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Time between the original signal and the early reflections of the reverb signal, in milliseconds."] # [doc = ""] # [inline] pub fn predelay_msec (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectReverbMethodTable :: get (get_api ()) . get_predelay_msec ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Dimensions of simulated room. Bigger means more echoes. Value can range from 0 to 1."] # [doc = ""] # [inline] pub fn room_size (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectReverbMethodTable :: get (get_api ()) . get_room_size ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Widens or narrows the stereo image of the reverb tail. 1 means fully widens. Value can range from 0 to 1."] # [doc = ""] # [inline] pub fn spread (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectReverbMethodTable :: get (get_api ()) . get_spread ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Output percent of modified sound. At 0, only original sound is outputted. Value can range from 0 to 1."] # [doc = ""] # [inline] pub fn wet (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectReverbMethodTable :: get (get_api ()) . get_wet ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Defines how reflective the imaginary room's walls are. Value can range from 0 to 1."] # [doc = ""] # [inline] pub fn set_damping (& self , amount : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectReverbMethodTable :: get (get_api ()) . set_damping ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , amount) ; } } # [doc = "Output percent of original sound. At 0, only modified sound is outputted. Value can range from 0 to 1."] # [doc = ""] # [inline] pub fn set_dry (& self , amount : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectReverbMethodTable :: get (get_api ()) . set_dry ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , amount) ; } } # [doc = "High-pass filter passes signals with a frequency higher than a certain cutoff frequency and attenuates signals with frequencies lower than the cutoff frequency. Value can range from 0 to 1."] # [doc = ""] # [inline] pub fn set_hpf (& self , amount : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectReverbMethodTable :: get (get_api ()) . set_hpf ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , amount) ; } } # [doc = "Output percent of predelay. Value can range from 0 to 1."] # [doc = ""] # [inline] pub fn set_predelay_feedback (& self , feedback : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectReverbMethodTable :: get (get_api ()) . set_predelay_feedback ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , feedback) ; } } # [doc = "Time between the original signal and the early reflections of the reverb signal, in milliseconds."] # [doc = ""] # [inline] pub fn set_predelay_msec (& self , msec : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectReverbMethodTable :: get (get_api ()) . set_predelay_msec ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , msec) ; } } # [doc = "Dimensions of simulated room. Bigger means more echoes. Value can range from 0 to 1."] # [doc = ""] # [inline] pub fn set_room_size (& self , size : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectReverbMethodTable :: get (get_api ()) . set_room_size ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , size) ; } } # [doc = "Widens or narrows the stereo image of the reverb tail. 1 means fully widens. Value can range from 0 to 1."] # [doc = ""] # [inline] pub fn set_spread (& self , amount : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectReverbMethodTable :: get (get_api ()) . set_spread ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , amount) ; } } # [doc = "Output percent of modified sound. At 0, only original sound is outputted. Value can range from 0 to 1."] # [doc = ""] # [inline] pub fn set_wet (& self , amount : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectReverbMethodTable :: get (get_api ()) . set_wet ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , amount) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for AudioEffectReverb { } unsafe impl GodotObject for AudioEffectReverb { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AudioEffectReverb" } } impl std :: ops :: Deref for AudioEffectReverb { type Target = crate :: generated :: audio_effect :: AudioEffect ; # [inline] fn deref (& self) -> & crate :: generated :: audio_effect :: AudioEffect { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AudioEffectReverb { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: audio_effect :: AudioEffect { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: audio_effect :: AudioEffect > for AudioEffectReverb { } unsafe impl SubClass < crate :: generated :: resource :: Resource > for AudioEffectReverb { } unsafe impl SubClass < crate :: generated :: reference :: Reference > for AudioEffectReverb { } unsafe impl SubClass < crate :: generated :: object :: Object > for AudioEffectReverb { } impl Instanciable for AudioEffectReverb { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { AudioEffectReverb :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AudioEffectReverbMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_damping : * mut sys :: godot_method_bind , pub get_dry : * mut sys :: godot_method_bind , pub get_hpf : * mut sys :: godot_method_bind , pub get_predelay_feedback : * mut sys :: godot_method_bind , pub get_predelay_msec : * mut sys :: godot_method_bind , pub get_room_size : * mut sys :: godot_method_bind , pub get_spread : * mut sys :: godot_method_bind , pub get_wet : * mut sys :: godot_method_bind , pub set_damping : * mut sys :: godot_method_bind , pub set_dry : * mut sys :: godot_method_bind , pub set_hpf : * mut sys :: godot_method_bind , pub set_predelay_feedback : * mut sys :: godot_method_bind , pub set_predelay_msec : * mut sys :: godot_method_bind , pub set_room_size : * mut sys :: godot_method_bind , pub set_spread : * mut sys :: godot_method_bind , pub set_wet : * mut sys :: godot_method_bind } impl AudioEffectReverbMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AudioEffectReverbMethodTable = AudioEffectReverbMethodTable { class_constructor : None , get_damping : 0 as * mut sys :: godot_method_bind , get_dry : 0 as * mut sys :: godot_method_bind , get_hpf : 0 as * mut sys :: godot_method_bind , get_predelay_feedback : 0 as * mut sys :: godot_method_bind , get_predelay_msec : 0 as * mut sys :: godot_method_bind , get_room_size : 0 as * mut sys :: godot_method_bind , get_spread : 0 as * mut sys :: godot_method_bind , get_wet : 0 as * mut sys :: godot_method_bind , set_damping : 0 as * mut sys :: godot_method_bind , set_dry : 0 as * mut sys :: godot_method_bind , set_hpf : 0 as * mut sys :: godot_method_bind , set_predelay_feedback : 0 as * mut sys :: godot_method_bind , set_predelay_msec : 0 as * mut sys :: godot_method_bind , set_room_size : 0 as * mut sys :: godot_method_bind , set_spread : 0 as * mut sys :: godot_method_bind , set_wet : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { AudioEffectReverbMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AudioEffectReverb\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_damping = (gd_api . godot_method_bind_get_method) (class_name , "get_damping\0" . as_ptr () as * const c_char) ; table . get_dry = (gd_api . godot_method_bind_get_method) (class_name , "get_dry\0" . as_ptr () as * const c_char) ; table . get_hpf = (gd_api . godot_method_bind_get_method) (class_name , "get_hpf\0" . as_ptr () as * const c_char) ; table . get_predelay_feedback = (gd_api . godot_method_bind_get_method) (class_name , "get_predelay_feedback\0" . as_ptr () as * const c_char) ; table . get_predelay_msec = (gd_api . godot_method_bind_get_method) (class_name , "get_predelay_msec\0" . as_ptr () as * const c_char) ; table . get_room_size = (gd_api . godot_method_bind_get_method) (class_name , "get_room_size\0" . as_ptr () as * const c_char) ; table . get_spread = (gd_api . godot_method_bind_get_method) (class_name , "get_spread\0" . as_ptr () as * const c_char) ; table . get_wet = (gd_api . godot_method_bind_get_method) (class_name , "get_wet\0" . as_ptr () as * const c_char) ; table . set_damping = (gd_api . godot_method_bind_get_method) (class_name , "set_damping\0" . as_ptr () as * const c_char) ; table . set_dry = (gd_api . godot_method_bind_get_method) (class_name , "set_dry\0" . as_ptr () as * const c_char) ; table . set_hpf = (gd_api . godot_method_bind_get_method) (class_name , "set_hpf\0" . as_ptr () as * const c_char) ; table . set_predelay_feedback = (gd_api . godot_method_bind_get_method) (class_name , "set_predelay_feedback\0" . as_ptr () as * const c_char) ; table . set_predelay_msec = (gd_api . godot_method_bind_get_method) (class_name , "set_predelay_msec\0" . as_ptr () as * const c_char) ; table . set_room_size = (gd_api . godot_method_bind_get_method) (class_name , "set_room_size\0" . as_ptr () as * const c_char) ; table . set_spread = (gd_api . godot_method_bind_get_method) (class_name , "set_spread\0" . as_ptr () as * const c_char) ; table . set_wet = (gd_api . godot_method_bind_get_method) (class_name , "set_wet\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:508:13304 [INFO] [stdout] | [INFO] [stdout] 508 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 508 | # [doc = "`core class VisualShader` inherits `Shader` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_visualshader.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nVisualShader inherits methods from:\n - [Shader](struct.Shader.html)\n - [Resource](struct.Resource.html)\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct VisualShader { this : RawObject < Self > , } # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct Type (pub i64) ; impl Type { pub const VERTEX : Type = Type (0i64) ; pub const FRAGMENT : Type = Type (1i64) ; pub const LIGHT : Type = Type (2i64) ; pub const MAX : Type = Type (3i64) ; } impl From < i64 > for Type { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < Type > for i64 { # [inline] fn from (v : Type) -> Self { v . 0 } } # [doc = "Constants"] # [allow (non_upper_case_globals)] impl VisualShader { pub const NODE_ID_INVALID : i64 = - 1i64 ; pub const NODE_ID_OUTPUT : i64 = 0i64 ; pub const TYPE_FRAGMENT : i64 = 1i64 ; pub const TYPE_LIGHT : i64 = 2i64 ; pub const TYPE_MAX : i64 = 3i64 ; pub const TYPE_VERTEX : i64 = 0i64 ; } impl VisualShader { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = VisualShaderMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "Adds the specified node to the shader."] # [doc = ""] # [inline] pub fn add_node (& self , _type : i64 , node : impl AsArg < crate :: generated :: visual_shader_node :: VisualShaderNode > , position : Vector2 , id : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualShaderMethodTable :: get (get_api ()) . add_node ; let ret = crate :: icalls :: icallptr_void_i64_obj_vec2_i64 (method_bind , self . this . sys () . as_ptr () , _type , node . as_arg_ptr () , position , id) ; } } # [doc = "Returns `true` if the specified nodes and ports can be connected together."] # [doc = ""] # [inline] pub fn can_connect_nodes (& self , _type : i64 , from_node : i64 , from_port : i64 , to_node : i64 , to_port : i64) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualShaderMethodTable :: get (get_api ()) . can_connect_nodes ; let ret = crate :: icalls :: icallptr_bool_i64_i64_i64_i64_i64 (method_bind , self . this . sys () . as_ptr () , _type , from_node , from_port , to_node , to_port) ; ret as _ } } # [doc = "Connects the specified nodes and ports."] # [doc = ""] # [inline] pub fn connect_nodes (& self , _type : i64 , from_node : i64 , from_port : i64 , to_node : i64 , to_port : i64) -> GodotResult { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualShaderMethodTable :: get (get_api ()) . connect_nodes ; let ret = crate :: icalls :: icallptr_i64_i64_i64_i64_i64_i64 (method_bind , self . this . sys () . as_ptr () , _type , from_node , from_port , to_node , to_port) ; GodotError :: result_from_sys (ret as _) } } # [doc = "Connects the specified nodes and ports, even if they can't be connected. Such connection is invalid and will not function properly."] # [doc = ""] # [inline] pub fn connect_nodes_forced (& self , _type : i64 , from_node : i64 , from_port : i64 , to_node : i64 , to_port : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualShaderMethodTable :: get (get_api ()) . connect_nodes_forced ; let ret = crate :: icalls :: icallptr_void_i64_i64_i64_i64_i64 (method_bind , self . this . sys () . as_ptr () , _type , from_node , from_port , to_node , to_port) ; } } # [doc = "Connects the specified nodes and ports."] # [doc = ""] # [inline] pub fn disconnect_nodes (& self , _type : i64 , from_node : i64 , from_port : i64 , to_node : i64 , to_port : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualShaderMethodTable :: get (get_api ()) . disconnect_nodes ; let ret = crate :: icalls :: icallptr_void_i64_i64_i64_i64_i64 (method_bind , self . this . sys () . as_ptr () , _type , from_node , from_port , to_node , to_port) ; } } # [doc = "The offset vector of the whole graph."] # [doc = ""] # [inline] pub fn graph_offset (& self) -> Vector2 { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualShaderMethodTable :: get (get_api ()) . get_graph_offset ; let ret = crate :: icalls :: icallptr_vec2 (method_bind , self . this . sys () . as_ptr ()) ; mem :: transmute (ret) } } # [doc = "Returns the shader node instance with specified `type` and `id`."] # [doc = ""] # [inline] pub fn get_node (& self , _type : i64 , id : i64) -> Option < Ref < crate :: generated :: visual_shader_node :: VisualShaderNode , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualShaderMethodTable :: get (get_api ()) . get_node ; let ret = crate :: icalls :: icallptr_obj_i64_i64 (method_bind , self . this . sys () . as_ptr () , _type , id) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: visual_shader_node :: VisualShaderNode , thread_access :: Shared >> :: move_from_sys (sys)) } } # [doc = "Returns the list of connected nodes with the specified type."] # [doc = ""] # [inline] pub fn get_node_connections (& self , _type : i64) -> VariantArray { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualShaderMethodTable :: get (get_api ()) . get_node_connections ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , _type) ; < VariantArray > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns the list of all nodes in the shader with the specified type."] # [doc = ""] # [inline] pub fn get_node_list (& self , _type : i64) -> Int32Array { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualShaderMethodTable :: get (get_api ()) . get_node_list ; let ret = crate :: icalls :: icallptr_i32arr_i64 (method_bind , self . this . sys () . as_ptr () , _type) ; Int32Array :: from_sys (ret) } } # [doc = "Returns the position of the specified node within the shader graph."] # [doc = ""] # [inline] pub fn get_node_position (& self , _type : i64 , id : i64) -> Vector2 { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualShaderMethodTable :: get (get_api ()) . get_node_position ; let ret = crate :: icalls :: icallptr_vec2_i64_i64 (method_bind , self . this . sys () . as_ptr () , _type , id) ; mem :: transmute (ret) } } # [doc = ""] # [doc = ""] # [inline] pub fn get_valid_node_id (& self , _type : i64) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualShaderMethodTable :: get (get_api ()) . get_valid_node_id ; let ret = crate :: icalls :: icallptr_i64_i64 (method_bind , self . this . sys () . as_ptr () , _type) ; ret as _ } } # [doc = "Returns `true` if the specified node and port connection exist."] # [doc = ""] # [inline] pub fn is_node_connection (& self , _type : i64 , from_node : i64 , from_port : i64 , to_node : i64 , to_port : i64) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualShaderMethodTable :: get (get_api ()) . is_node_connection ; let ret = crate :: icalls :: icallptr_bool_i64_i64_i64_i64_i64 (method_bind , self . this . sys () . as_ptr () , _type , from_node , from_port , to_node , to_port) ; ret as _ } } # [doc = "Removes the specified node from the shader."] # [doc = ""] # [inline] pub fn remove_node (& self , _type : i64 , id : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualShaderMethodTable :: get (get_api ()) . remove_node ; let ret = crate :: icalls :: icallptr_void_i64_i64 (method_bind , self . this . sys () . as_ptr () , _type , id) ; } } # [doc = "The offset vector of the whole graph."] # [doc = ""] # [inline] pub fn set_graph_offset (& self , offset : Vector2) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualShaderMethodTable :: get (get_api ()) . set_graph_offset ; let ret = crate :: icalls :: icallptr_void_vec2 (method_bind , self . this . sys () . as_ptr () , offset) ; } } # [doc = "Sets the mode of this shader."] # [doc = ""] # [inline] pub fn set_mode (& self , mode : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualShaderMethodTable :: get (get_api ()) . set_mode ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , mode) ; } } # [doc = "Sets the position of the specified node."] # [doc = ""] # [inline] pub fn set_node_position (& self , _type : i64 , id : i64 , position : Vector2) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualShaderMethodTable :: get (get_api ()) . set_node_position ; let ret = crate :: icalls :: icallptr_void_i64_i64_vec2 (method_bind , self . this . sys () . as_ptr () , _type , id , position) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for VisualShader { } unsafe impl GodotObject for VisualShader { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "VisualShader" } } impl std :: ops :: Deref for VisualShader { type Target = crate :: generated :: shader :: Shader ; # [inline] fn deref (& self) -> & crate :: generated :: shader :: Shader { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for VisualShader { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: shader :: Shader { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: shader :: Shader > for VisualShader { } unsafe impl SubClass < crate :: generated :: resource :: Resource > for VisualShader { } unsafe impl SubClass < crate :: generated :: reference :: Reference > for VisualShader { } unsafe impl SubClass < crate :: generated :: object :: Object > for VisualShader { } impl Instanciable for VisualShader { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { VisualShader :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct VisualShaderMethodTable { pub class_constructor : sys :: godot_class_constructor , pub add_node : * mut sys :: godot_method_bind , pub can_connect_nodes : * mut sys :: godot_method_bind , pub connect_nodes : * mut sys :: godot_method_bind , pub connect_nodes_forced : * mut sys :: godot_method_bind , pub disconnect_nodes : * mut sys :: godot_method_bind , pub get_graph_offset : * mut sys :: godot_method_bind , pub get_node : * mut sys :: godot_method_bind , pub get_node_connections : * mut sys :: godot_method_bind , pub get_node_list : * mut sys :: godot_method_bind , pub get_node_position : * mut sys :: godot_method_bind , pub get_valid_node_id : * mut sys :: godot_method_bind , pub is_node_connection : * mut sys :: godot_method_bind , pub remove_node : * mut sys :: godot_method_bind , pub set_graph_offset : * mut sys :: godot_method_bind , pub set_mode : * mut sys :: godot_method_bind , pub set_node_position : * mut sys :: godot_method_bind } impl VisualShaderMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : VisualShaderMethodTable = VisualShaderMethodTable { class_constructor : None , add_node : 0 as * mut sys :: godot_method_bind , can_connect_nodes : 0 as * mut sys :: godot_method_bind , connect_nodes : 0 as * mut sys :: godot_method_bind , connect_nodes_forced : 0 as * mut sys :: godot_method_bind , disconnect_nodes : 0 as * mut sys :: godot_method_bind , get_graph_offset : 0 as * mut sys :: godot_method_bind , get_node : 0 as * mut sys :: godot_method_bind , get_node_connections : 0 as * mut sys :: godot_method_bind , get_node_list : 0 as * mut sys :: godot_method_bind , get_node_position : 0 as * mut sys :: godot_method_bind , get_valid_node_id : 0 as * mut sys :: godot_method_bind , is_node_connection : 0 as * mut sys :: godot_method_bind , remove_node : 0 as * mut sys :: godot_method_bind , set_graph_offset : 0 as * mut sys :: godot_method_bind , set_mode : 0 as * mut sys :: godot_method_bind , set_node_position : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { VisualShaderMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "VisualShader\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . add_node = (gd_api . godot_method_bind_get_method) (class_name , "add_node\0" . as_ptr () as * const c_char) ; table . can_connect_nodes = (gd_api . godot_method_bind_get_method) (class_name , "can_connect_nodes\0" . as_ptr () as * const c_char) ; table . connect_nodes = (gd_api . godot_method_bind_get_method) (class_name , "connect_nodes\0" . as_ptr () as * const c_char) ; table . connect_nodes_forced = (gd_api . godot_method_bind_get_method) (class_name , "connect_nodes_forced\0" . as_ptr () as * const c_char) ; table . disconnect_nodes = (gd_api . godot_method_bind_get_method) (class_name , "disconnect_nodes\0" . as_ptr () as * const c_char) ; table . get_graph_offset = (gd_api . godot_method_bind_get_method) (class_name , "get_graph_offset\0" . as_ptr () as * const c_char) ; table . get_node = (gd_api . godot_method_bind_get_method) (class_name , "get_node\0" . as_ptr () as * const c_char) ; table . get_node_connections = (gd_api . godot_method_bind_get_method) (class_name , "get_node_connections\0" . as_ptr () as * const c_char) ; table . get_node_list = (gd_api . godot_method_bind_get_method) (class_name , "get_node_list\0" . as_ptr () as * const c_char) ; table . get_node_position = (gd_api . godot_method_bind_get_method) (class_name , "get_node_position\0" . as_ptr () as * const c_char) ; table . get_valid_node_id = (gd_api . godot_method_bind_get_method) (class_name , "get_valid_node_id\0" . as_ptr () as * const c_char) ; table . is_node_connection = (gd_api . godot_method_bind_get_method) (class_name , "is_node_connection\0" . as_ptr () as * const c_char) ; table . remove_node = (gd_api . godot_method_bind_get_method) (class_name , "remove_node\0" . as_ptr () as * const c_char) ; table . set_graph_offset = (gd_api . godot_method_bind_get_method) (class_name , "set_graph_offset\0" . as_ptr () as * const c_char) ; table . set_mode = (gd_api . godot_method_bind_get_method) (class_name , "set_mode\0" . as_ptr () as * const c_char) ; table . set_node_position = (gd_api . godot_method_bind_get_method) (class_name , "set_node_position\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:130:3688 [INFO] [stdout] | [INFO] [stdout] 130 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 130 | # [doc = "`tools class EditorNavigationMeshGenerator` inherits `Object` (unsafe)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_editornavigationmeshgenerator.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = ""] # [doc = "\n## Class hierarchy\n\nEditorNavigationMeshGenerator inherits methods from:\n - [Object](struct.Object.html)\n"] # [doc = "\n## Tool\n\nThis class is used to interact with Godot's editor."] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct EditorNavigationMeshGenerator { this : RawObject < Self > , } impl EditorNavigationMeshGenerator { # [doc = ""] # [doc = ""] # [inline] pub fn bake (& self , nav_mesh : impl AsArg < crate :: generated :: navigation_mesh :: NavigationMesh > , root_node : impl AsArg < crate :: generated :: node :: Node >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorNavigationMeshGeneratorMethodTable :: get (get_api ()) . bake ; let ret = crate :: icalls :: icallptr_void_obj_obj (method_bind , self . this . sys () . as_ptr () , nav_mesh . as_arg_ptr () , root_node . as_arg_ptr ()) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn clear (& self , nav_mesh : impl AsArg < crate :: generated :: navigation_mesh :: NavigationMesh >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = EditorNavigationMeshGeneratorMethodTable :: get (get_api ()) . clear ; let ret = crate :: icalls :: icallptr_void_obj (method_bind , self . this . sys () . as_ptr () , nav_mesh . as_arg_ptr ()) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for EditorNavigationMeshGenerator { } unsafe impl GodotObject for EditorNavigationMeshGenerator { type RefKind = ref_kind :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "EditorNavigationMeshGenerator" } } impl std :: ops :: Deref for EditorNavigationMeshGenerator { type Target = crate :: generated :: object :: Object ; # [inline] fn deref (& self) -> & crate :: generated :: object :: Object { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for EditorNavigationMeshGenerator { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: object :: Object { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: object :: Object > for EditorNavigationMeshGenerator { } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct EditorNavigationMeshGeneratorMethodTable { pub class_constructor : sys :: godot_class_constructor , pub bake : * mut sys :: godot_method_bind , pub clear : * mut sys :: godot_method_bind } impl EditorNavigationMeshGeneratorMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : EditorNavigationMeshGeneratorMethodTable = EditorNavigationMeshGeneratorMethodTable { class_constructor : None , bake : 0 as * mut sys :: godot_method_bind , clear : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { EditorNavigationMeshGeneratorMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "EditorNavigationMeshGenerator\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . bake = (gd_api . godot_method_bind_get_method) (class_name , "bake\0" . as_ptr () as * const c_char) ; table . clear = (gd_api . godot_method_bind_get_method) (class_name , "clear\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:136:4781 [INFO] [stdout] | [INFO] [stdout] 136 | ...thodTable { class_constructor : None , } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 136 | # [doc = "`core class VSplitContainer` inherits `SplitContainer` (unsafe)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_vsplitcontainer.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nNon reference counted objects such as the ones of this type are usually owned by the engine.\n\n`VSplitContainer` is a reference-only type. Persistent references can\nonly exist in the unsafe `Ref` form.\n\nIn the cases where Rust code owns an object of this type, for example if the object was just\ncreated on the Rust side and not passed to the engine yet, ownership should be either given\nto the engine or the object must be manually destroyed using `Ref::free`, or `Ref::queue_free`\nif it is a `Node`."] # [doc = "\n## Class hierarchy\n\nVSplitContainer inherits methods from:\n - [SplitContainer](struct.SplitContainer.html)\n - [Container](struct.Container.html)\n - [Control](struct.Control.html)\n - [CanvasItem](struct.CanvasItem.html)\n - [Node](struct.Node.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct VSplitContainer { this : RawObject < Self > , } impl VSplitContainer { # [doc = "Creates a new instance of this object.\n\nBecause this type is not reference counted, the lifetime of the returned object\nis *not* automatically managed.\n\nImmediately after creation, the object is owned by the caller, and can be\npassed to the engine (in which case the engine will be responsible for\ndestroying the object) or destroyed manually using `Ref::free`, or preferably\n`Ref::queue_free` if it is a `Node`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = VSplitContainerMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } } impl gdnative_core :: private :: godot_object :: Sealed for VSplitContainer { } unsafe impl GodotObject for VSplitContainer { type RefKind = ref_kind :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "VSplitContainer" } } impl QueueFree for VSplitContainer { # [inline] unsafe fn godot_queue_free (obj : * mut sys :: godot_object) { let method_bind : * mut sys :: godot_method_bind = crate :: generated :: node :: NodeMethodTable :: get (get_api ()) . queue_free ; crate :: icalls :: icallptr_void (method_bind , obj) } } impl std :: ops :: Deref for VSplitContainer { type Target = crate :: generated :: split_container :: SplitContainer ; # [inline] fn deref (& self) -> & crate :: generated :: split_container :: SplitContainer { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for VSplitContainer { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: split_container :: SplitContainer { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: split_container :: SplitContainer > for VSplitContainer { } unsafe impl SubClass < crate :: generated :: container :: Container > for VSplitContainer { } unsafe impl SubClass < crate :: generated :: control :: Control > for VSplitContainer { } unsafe impl SubClass < crate :: generated :: canvas_item :: CanvasItem > for VSplitContainer { } unsafe impl SubClass < crate :: generated :: node :: Node > for VSplitContainer { } unsafe impl SubClass < crate :: generated :: object :: Object > for VSplitContainer { } impl Instanciable for VSplitContainer { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { VSplitContainer :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct VSplitContainerMethodTable { pub class_constructor : sys :: godot_class_constructor , } impl VSplitContainerMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : VSplitContainerMethodTable = VSplitContainerMethodTable { class_constructor : None , } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { VSplitContainerMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "VSplitContainer\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:514:6252 [INFO] [stdout] | [INFO] [stdout] 514 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 514 | # [doc = "`core class InputEventJoypadButton` inherits `InputEvent` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_inputeventjoypadbutton.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nInputEventJoypadButton inherits methods from:\n - [InputEvent](struct.InputEvent.html)\n - [Resource](struct.Resource.html)\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct InputEventJoypadButton { this : RawObject < Self > , } impl InputEventJoypadButton { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = InputEventJoypadButtonMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "Button identifier. One of the [enum JoystickList] button constants."] # [doc = ""] # [inline] pub fn button_index (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = InputEventJoypadButtonMethodTable :: get (get_api ()) . get_button_index ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Represents the pressure the user puts on the button with his finger, if the controller supports it. Ranges from `0` to `1`."] # [doc = ""] # [inline] pub fn pressure (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = InputEventJoypadButtonMethodTable :: get (get_api ()) . get_pressure ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Button identifier. One of the [enum JoystickList] button constants."] # [doc = ""] # [inline] pub fn set_button_index (& self , button_index : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = InputEventJoypadButtonMethodTable :: get (get_api ()) . set_button_index ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , button_index) ; } } # [doc = "If `true`, the button's state is pressed. If `false`, the button's state is released."] # [doc = ""] # [inline] pub fn set_pressed (& self , pressed : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = InputEventJoypadButtonMethodTable :: get (get_api ()) . set_pressed ; let ret = crate :: icalls :: icallptr_void_bool (method_bind , self . this . sys () . as_ptr () , pressed) ; } } # [doc = "Represents the pressure the user puts on the button with his finger, if the controller supports it. Ranges from `0` to `1`."] # [doc = ""] # [inline] pub fn set_pressure (& self , pressure : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = InputEventJoypadButtonMethodTable :: get (get_api ()) . set_pressure ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , pressure) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for InputEventJoypadButton { } unsafe impl GodotObject for InputEventJoypadButton { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "InputEventJoypadButton" } } impl std :: ops :: Deref for InputEventJoypadButton { type Target = crate :: generated :: input_event :: InputEvent ; # [inline] fn deref (& self) -> & crate :: generated :: input_event :: InputEvent { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for InputEventJoypadButton { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: input_event :: InputEvent { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: input_event :: InputEvent > for InputEventJoypadButton { } unsafe impl SubClass < crate :: generated :: resource :: Resource > for InputEventJoypadButton { } unsafe impl SubClass < crate :: generated :: reference :: Reference > for InputEventJoypadButton { } unsafe impl SubClass < crate :: generated :: object :: Object > for InputEventJoypadButton { } impl Instanciable for InputEventJoypadButton { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { InputEventJoypadButton :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct InputEventJoypadButtonMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_button_index : * mut sys :: godot_method_bind , pub get_pressure : * mut sys :: godot_method_bind , pub set_button_index : * mut sys :: godot_method_bind , pub set_pressed : * mut sys :: godot_method_bind , pub set_pressure : * mut sys :: godot_method_bind } impl InputEventJoypadButtonMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : InputEventJoypadButtonMethodTable = InputEventJoypadButtonMethodTable { class_constructor : None , get_button_index : 0 as * mut sys :: godot_method_bind , get_pressure : 0 as * mut sys :: godot_method_bind , set_button_index : 0 as * mut sys :: godot_method_bind , set_pressed : 0 as * mut sys :: godot_method_bind , set_pressure : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { InputEventJoypadButtonMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "InputEventJoypadButton\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_button_index = (gd_api . godot_method_bind_get_method) (class_name , "get_button_index\0" . as_ptr () as * const c_char) ; table . get_pressure = (gd_api . godot_method_bind_get_method) (class_name , "get_pressure\0" . as_ptr () as * const c_char) ; table . set_button_index = (gd_api . godot_method_bind_get_method) (class_name , "set_button_index\0" . as_ptr () as * const c_char) ; table . set_pressed = (gd_api . godot_method_bind_get_method) (class_name , "set_pressed\0" . as_ptr () as * const c_char) ; table . set_pressure = (gd_api . godot_method_bind_get_method) (class_name , "set_pressure\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:520:5213 [INFO] [stdout] | [INFO] [stdout] 520 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 520 | # [doc = "`core class DTLSServer` inherits `Reference` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_dtlsserver.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nDTLSServer inherits methods from:\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct DTLSServer { this : RawObject < Self > , } impl DTLSServer { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = DTLSServerMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "Setup the DTLS server to use the given `private_key` and provide the given `certificate` to clients. You can pass the optional `chain` parameter to provide additional CA chain information along with the certificate.\n# Default Arguments\n* `chain` - `null`"] # [doc = ""] # [inline] pub fn setup (& self , key : impl AsArg < crate :: generated :: crypto_key :: CryptoKey > , certificate : impl AsArg < crate :: generated :: x509_certificate :: X509Certificate > , chain : impl AsArg < crate :: generated :: x509_certificate :: X509Certificate >) -> GodotResult { unsafe { let method_bind : * mut sys :: godot_method_bind = DTLSServerMethodTable :: get (get_api ()) . setup ; let ret = crate :: icalls :: icallptr_i64_obj_obj_obj (method_bind , self . this . sys () . as_ptr () , key . as_arg_ptr () , certificate . as_arg_ptr () , chain . as_arg_ptr ()) ; GodotError :: result_from_sys (ret as _) } } # [doc = "Try to initiate the DTLS handshake with the given `udp_peer` which must be already connected (see [method PacketPeerUDP.connect_to_host]).\n**Note**: You must check that the state of the return PacketPeerUDP is [constant PacketPeerDTLS.STATUS_HANDSHAKING], as it is normal that 50% of the new connections will be invalid due to cookie exchange."] # [doc = ""] # [inline] pub fn take_connection (& self , udp_peer : impl AsArg < crate :: generated :: packet_peer_udp :: PacketPeerUDP >) -> Option < Ref < crate :: generated :: packet_peer_dtls :: PacketPeerDTLS , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = DTLSServerMethodTable :: get (get_api ()) . take_connection ; let ret = crate :: icalls :: icallptr_obj_obj (method_bind , self . this . sys () . as_ptr () , udp_peer . as_arg_ptr ()) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: packet_peer_dtls :: PacketPeerDTLS , thread_access :: Shared >> :: move_from_sys (sys)) } } } impl gdnative_core :: private :: godot_object :: Sealed for DTLSServer { } unsafe impl GodotObject for DTLSServer { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "DTLSServer" } } impl std :: ops :: Deref for DTLSServer { type Target = crate :: generated :: reference :: Reference ; # [inline] fn deref (& self) -> & crate :: generated :: reference :: Reference { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for DTLSServer { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: reference :: Reference { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: reference :: Reference > for DTLSServer { } unsafe impl SubClass < crate :: generated :: object :: Object > for DTLSServer { } impl Instanciable for DTLSServer { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { DTLSServer :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct DTLSServerMethodTable { pub class_constructor : sys :: godot_class_constructor , pub setup : * mut sys :: godot_method_bind , pub take_connection : * mut sys :: godot_method_bind } impl DTLSServerMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : DTLSServerMethodTable = DTLSServerMethodTable { class_constructor : None , setup : 0 as * mut sys :: godot_method_bind , take_connection : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { DTLSServerMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "DTLSServer\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . setup = (gd_api . godot_method_bind_get_method) (class_name , "setup\0" . as_ptr () as * const c_char) ; table . take_connection = (gd_api . godot_method_bind_get_method) (class_name , "take_connection\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:142:15700 [INFO] [stdout] | [INFO] [stdout] 142 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 142 | # [doc = "`core class MultiplayerAPI` inherits `Reference` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_multiplayerapi.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nMultiplayerAPI inherits methods from:\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct MultiplayerAPI { this : RawObject < Self > , } # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct RpcMode (pub i64) ; impl RpcMode { pub const DISABLED : RpcMode = RpcMode (0i64) ; pub const REMOTE : RpcMode = RpcMode (1i64) ; pub const MASTER : RpcMode = RpcMode (2i64) ; pub const SLAVE : RpcMode = RpcMode (3i64) ; pub const PUPPET : RpcMode = RpcMode (3i64) ; pub const SYNC : RpcMode = RpcMode (4i64) ; pub const REMOTESYNC : RpcMode = RpcMode (4i64) ; pub const MASTERSYNC : RpcMode = RpcMode (5i64) ; pub const PUPPETSYNC : RpcMode = RpcMode (6i64) ; } impl From < i64 > for RpcMode { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < RpcMode > for i64 { # [inline] fn from (v : RpcMode) -> Self { v . 0 } } # [doc = "Constants"] # [allow (non_upper_case_globals)] impl MultiplayerAPI { pub const RPC_MODE_DISABLED : i64 = 0i64 ; pub const RPC_MODE_MASTER : i64 = 2i64 ; pub const RPC_MODE_MASTERSYNC : i64 = 5i64 ; pub const RPC_MODE_PUPPET : i64 = 3i64 ; pub const RPC_MODE_PUPPETSYNC : i64 = 6i64 ; pub const RPC_MODE_REMOTE : i64 = 1i64 ; pub const RPC_MODE_REMOTESYNC : i64 = 4i64 ; pub const RPC_MODE_SLAVE : i64 = 3i64 ; pub const RPC_MODE_SYNC : i64 = 4i64 ; } impl MultiplayerAPI { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = MultiplayerAPIMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "Clears the current MultiplayerAPI network state (you shouldn't call this unless you know what you are doing)."] # [doc = ""] # [inline] pub fn clear (& self) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = MultiplayerAPIMethodTable :: get (get_api ()) . clear ; let ret = crate :: icalls :: icallptr_void (method_bind , self . this . sys () . as_ptr ()) ; } } # [doc = "Returns the peer IDs of all connected peers of this MultiplayerAPI's [member network_peer]."] # [doc = ""] # [inline] pub fn get_network_connected_peers (& self) -> Int32Array { unsafe { let method_bind : * mut sys :: godot_method_bind = MultiplayerAPIMethodTable :: get (get_api ()) . get_network_connected_peers ; let ret = crate :: icalls :: icallptr_i32arr (method_bind , self . this . sys () . as_ptr ()) ; Int32Array :: from_sys (ret) } } # [doc = "The peer object to handle the RPC system (effectively enabling networking when set). Depending on the peer itself, the MultiplayerAPI will become a network server (check with [method is_network_server]) and will set root node's network mode to master, or it will become a regular peer with root node set to puppet. All child nodes are set to inherit the network mode by default. Handling of networking-related events (connection, disconnection, new clients) is done by connecting to MultiplayerAPI's signals."] # [doc = ""] # [inline] pub fn network_peer (& self) -> Option < Ref < crate :: generated :: networked_multiplayer_peer :: NetworkedMultiplayerPeer , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = MultiplayerAPIMethodTable :: get (get_api ()) . get_network_peer ; let ret = crate :: icalls :: icallptr_obj (method_bind , self . this . sys () . as_ptr ()) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: networked_multiplayer_peer :: NetworkedMultiplayerPeer , thread_access :: Shared >> :: move_from_sys (sys)) } } # [doc = "Returns the unique peer ID of this MultiplayerAPI's [member network_peer]."] # [doc = ""] # [inline] pub fn get_network_unique_id (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = MultiplayerAPIMethodTable :: get (get_api ()) . get_network_unique_id ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = ""] # [doc = ""] # [inline] pub fn root_node (& self) -> Option < Ref < crate :: generated :: node :: Node , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = MultiplayerAPIMethodTable :: get (get_api ()) . get_root_node ; let ret = crate :: icalls :: icallptr_obj (method_bind , self . this . sys () . as_ptr ()) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: node :: Node , thread_access :: Shared >> :: move_from_sys (sys)) } } # [doc = "Returns the sender's peer ID for the RPC currently being executed.\n**Note:** If not inside an RPC this method will return 0."] # [doc = ""] # [inline] pub fn get_rpc_sender_id (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = MultiplayerAPIMethodTable :: get (get_api ()) . get_rpc_sender_id ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Returns `true` if there is a [member network_peer] set."] # [doc = ""] # [inline] pub fn has_network_peer (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = MultiplayerAPIMethodTable :: get (get_api ()) . has_network_peer ; let ret = crate :: icalls :: icallptr_bool (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Returns `true` if this MultiplayerAPI's [member network_peer] is in server mode (listening for connections)."] # [doc = ""] # [inline] pub fn is_network_server (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = MultiplayerAPIMethodTable :: get (get_api ()) . is_network_server ; let ret = crate :: icalls :: icallptr_bool (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "If `true` (or if the [member network_peer] has [member PacketPeer.allow_object_decoding] set to `true`), the MultiplayerAPI will allow encoding and decoding of object during RPCs/RSETs.\n**Warning:** Deserialized objects can contain code which gets executed. Do not use this option if the serialized object comes from untrusted sources to avoid potential security threats such as remote code execution."] # [doc = ""] # [inline] pub fn is_object_decoding_allowed (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = MultiplayerAPIMethodTable :: get (get_api ()) . is_object_decoding_allowed ; let ret = crate :: icalls :: icallptr_bool (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "If `true`, the MultiplayerAPI's [member network_peer] refuses new incoming connections."] # [doc = ""] # [inline] pub fn is_refusing_new_network_connections (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = MultiplayerAPIMethodTable :: get (get_api ()) . is_refusing_new_network_connections ; let ret = crate :: icalls :: icallptr_bool (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Method used for polling the MultiplayerAPI. You only need to worry about this if you are using [member Node.custom_multiplayer] override or you set [member SceneTree.multiplayer_poll] to `false`. By default, [SceneTree] will poll its MultiplayerAPI for you.\n**Note:** This method results in RPCs and RSETs being called, so they will be executed in the same context of this function (e.g. `_process`, `physics`, [Thread])."] # [doc = ""] # [inline] pub fn poll (& self) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = MultiplayerAPIMethodTable :: get (get_api ()) . poll ; let ret = crate :: icalls :: icallptr_void (method_bind , self . this . sys () . as_ptr ()) ; } } # [doc = "Sends the given raw `bytes` to a specific peer identified by `id` (see [method NetworkedMultiplayerPeer.set_target_peer]). Default ID is `0`, i.e. broadcast to all peers.\n# Default Arguments\n* `id` - `0`\n* `mode` - `2`"] # [doc = ""] # [inline] pub fn send_bytes (& self , bytes : ByteArray , id : i64 , mode : i64) -> GodotResult { unsafe { let method_bind : * mut sys :: godot_method_bind = MultiplayerAPIMethodTable :: get (get_api ()) . send_bytes ; let ret = crate :: icalls :: icallptr_i64_bytearr_i64_i64 (method_bind , self . this . sys () . as_ptr () , bytes , id , mode) ; GodotError :: result_from_sys (ret as _) } } # [doc = "If `true` (or if the [member network_peer] has [member PacketPeer.allow_object_decoding] set to `true`), the MultiplayerAPI will allow encoding and decoding of object during RPCs/RSETs.\n**Warning:** Deserialized objects can contain code which gets executed. Do not use this option if the serialized object comes from untrusted sources to avoid potential security threats such as remote code execution."] # [doc = ""] # [inline] pub fn set_allow_object_decoding (& self , enable : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = MultiplayerAPIMethodTable :: get (get_api ()) . set_allow_object_decoding ; let ret = crate :: icalls :: icallptr_void_bool (method_bind , self . this . sys () . as_ptr () , enable) ; } } # [doc = "The peer object to handle the RPC system (effectively enabling networking when set). Depending on the peer itself, the MultiplayerAPI will become a network server (check with [method is_network_server]) and will set root node's network mode to master, or it will become a regular peer with root node set to puppet. All child nodes are set to inherit the network mode by default. Handling of networking-related events (connection, disconnection, new clients) is done by connecting to MultiplayerAPI's signals."] # [doc = ""] # [inline] pub fn set_network_peer (& self , peer : impl AsArg < crate :: generated :: networked_multiplayer_peer :: NetworkedMultiplayerPeer >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = MultiplayerAPIMethodTable :: get (get_api ()) . set_network_peer ; let ret = crate :: icalls :: icallptr_void_obj (method_bind , self . this . sys () . as_ptr () , peer . as_arg_ptr ()) ; } } # [doc = "If `true`, the MultiplayerAPI's [member network_peer] refuses new incoming connections."] # [doc = ""] # [inline] pub fn set_refuse_new_network_connections (& self , refuse : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = MultiplayerAPIMethodTable :: get (get_api ()) . set_refuse_new_network_connections ; let ret = crate :: icalls :: icallptr_void_bool (method_bind , self . this . sys () . as_ptr () , refuse) ; } } # [doc = "Sets the base root node to use for RPCs. Instead of an absolute path, a relative path will be used to find the node upon which the RPC should be executed.\nThis effectively allows to have different branches of the scene tree to be managed by different MultiplayerAPI, allowing for example to run both client and server in the same scene."] # [doc = ""] # [inline] pub fn set_root_node (& self , node : impl AsArg < crate :: generated :: node :: Node >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = MultiplayerAPIMethodTable :: get (get_api ()) . set_root_node ; let ret = crate :: icalls :: icallptr_void_obj (method_bind , self . this . sys () . as_ptr () , node . as_arg_ptr ()) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for MultiplayerAPI { } unsafe impl GodotObject for MultiplayerAPI { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "MultiplayerAPI" } } impl std :: ops :: Deref for MultiplayerAPI { type Target = crate :: generated :: reference :: Reference ; # [inline] fn deref (& self) -> & crate :: generated :: reference :: Reference { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for MultiplayerAPI { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: reference :: Reference { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: reference :: Reference > for MultiplayerAPI { } unsafe impl SubClass < crate :: generated :: object :: Object > for MultiplayerAPI { } impl Instanciable for MultiplayerAPI { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { MultiplayerAPI :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct MultiplayerAPIMethodTable { pub class_constructor : sys :: godot_class_constructor , pub clear : * mut sys :: godot_method_bind , pub get_network_connected_peers : * mut sys :: godot_method_bind , pub get_network_peer : * mut sys :: godot_method_bind , pub get_network_unique_id : * mut sys :: godot_method_bind , pub get_root_node : * mut sys :: godot_method_bind , pub get_rpc_sender_id : * mut sys :: godot_method_bind , pub has_network_peer : * mut sys :: godot_method_bind , pub is_network_server : * mut sys :: godot_method_bind , pub is_object_decoding_allowed : * mut sys :: godot_method_bind , pub is_refusing_new_network_connections : * mut sys :: godot_method_bind , pub poll : * mut sys :: godot_method_bind , pub send_bytes : * mut sys :: godot_method_bind , pub set_allow_object_decoding : * mut sys :: godot_method_bind , pub set_network_peer : * mut sys :: godot_method_bind , pub set_refuse_new_network_connections : * mut sys :: godot_method_bind , pub set_root_node : * mut sys :: godot_method_bind } impl MultiplayerAPIMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : MultiplayerAPIMethodTable = MultiplayerAPIMethodTable { class_constructor : None , clear : 0 as * mut sys :: godot_method_bind , get_network_connected_peers : 0 as * mut sys :: godot_method_bind , get_network_peer : 0 as * mut sys :: godot_method_bind , get_network_unique_id : 0 as * mut sys :: godot_method_bind , get_root_node : 0 as * mut sys :: godot_method_bind , get_rpc_sender_id : 0 as * mut sys :: godot_method_bind , has_network_peer : 0 as * mut sys :: godot_method_bind , is_network_server : 0 as * mut sys :: godot_method_bind , is_object_decoding_allowed : 0 as * mut sys :: godot_method_bind , is_refusing_new_network_connections : 0 as * mut sys :: godot_method_bind , poll : 0 as * mut sys :: godot_method_bind , send_bytes : 0 as * mut sys :: godot_method_bind , set_allow_object_decoding : 0 as * mut sys :: godot_method_bind , set_network_peer : 0 as * mut sys :: godot_method_bind , set_refuse_new_network_connections : 0 as * mut sys :: godot_method_bind , set_root_node : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { MultiplayerAPIMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "MultiplayerAPI\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . clear = (gd_api . godot_method_bind_get_method) (class_name , "clear\0" . as_ptr () as * const c_char) ; table . get_network_connected_peers = (gd_api . godot_method_bind_get_method) (class_name , "get_network_connected_peers\0" . as_ptr () as * const c_char) ; table . get_network_peer = (gd_api . godot_method_bind_get_method) (class_name , "get_network_peer\0" . as_ptr () as * const c_char) ; table . get_network_unique_id = (gd_api . godot_method_bind_get_method) (class_name , "get_network_unique_id\0" . as_ptr () as * const c_char) ; table . get_root_node = (gd_api . godot_method_bind_get_method) (class_name , "get_root_node\0" . as_ptr () as * const c_char) ; table . get_rpc_sender_id = (gd_api . godot_method_bind_get_method) (class_name , "get_rpc_sender_id\0" . as_ptr () as * const c_char) ; table . has_network_peer = (gd_api . godot_method_bind_get_method) (class_name , "has_network_peer\0" . as_ptr () as * const c_char) ; table . is_network_server = (gd_api . godot_method_bind_get_method) (class_name , "is_network_server\0" . as_ptr () as * const c_char) ; table . is_object_decoding_allowed = (gd_api . godot_method_bind_get_method) (class_name , "is_object_decoding_allowed\0" . as_ptr () as * const c_char) ; table . is_refusing_new_network_connections = (gd_api . godot_method_bind_get_method) (class_name , "is_refusing_new_network_connections\0" . as_ptr () as * const c_char) ; table . poll = (gd_api . godot_method_bind_get_method) (class_name , "poll\0" . as_ptr () as * const c_char) ; table . send_bytes = (gd_api . godot_method_bind_get_method) (class_name , "send_bytes\0" . as_ptr () as * const c_char) ; table . set_allow_object_decoding = (gd_api . godot_method_bind_get_method) (class_name , "set_allow_object_decoding\0" . as_ptr () as * const c_char) ; table . set_network_peer = (gd_api . godot_method_bind_get_method) (class_name , "set_network_peer\0" . as_ptr () as * const c_char) ; table . set_refuse_new_network_connections = (gd_api . godot_method_bind_get_method) (class_name , "set_refuse_new_network_connections\0" . as_ptr () as * const c_char) ; table . set_root_node = (gd_api . godot_method_bind_get_method) (class_name , "set_root_node\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:526:7531 [INFO] [stdout] | [INFO] [stdout] 526 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 526 | # [doc = "`core class MainLoop` inherits `Object` (unsafe)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_mainloop.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nNon reference counted objects such as the ones of this type are usually owned by the engine.\n\n`MainLoop` is a reference-only type. Persistent references can\nonly exist in the unsafe `Ref` form.\n\nIn the cases where Rust code owns an object of this type, for example if the object was just\ncreated on the Rust side and not passed to the engine yet, ownership should be either given\nto the engine or the object must be manually destroyed using `Ref::free`, or `Ref::queue_free`\nif it is a `Node`."] # [doc = "\n## Class hierarchy\n\nMainLoop inherits methods from:\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct MainLoop { this : RawObject < Self > , } # [doc = "Constants"] # [allow (non_upper_case_globals)] impl MainLoop { pub const NOTIFICATION_APP_PAUSED : i64 = 1015i64 ; pub const NOTIFICATION_APP_RESUMED : i64 = 1014i64 ; pub const NOTIFICATION_CRASH : i64 = 1012i64 ; pub const NOTIFICATION_OS_IME_UPDATE : i64 = 1013i64 ; pub const NOTIFICATION_OS_MEMORY_WARNING : i64 = 1009i64 ; pub const NOTIFICATION_TRANSLATION_CHANGED : i64 = 1010i64 ; pub const NOTIFICATION_WM_ABOUT : i64 = 1011i64 ; pub const NOTIFICATION_WM_FOCUS_IN : i64 = 1004i64 ; pub const NOTIFICATION_WM_FOCUS_OUT : i64 = 1005i64 ; pub const NOTIFICATION_WM_GO_BACK_REQUEST : i64 = 1007i64 ; pub const NOTIFICATION_WM_MOUSE_ENTER : i64 = 1002i64 ; pub const NOTIFICATION_WM_MOUSE_EXIT : i64 = 1003i64 ; pub const NOTIFICATION_WM_QUIT_REQUEST : i64 = 1006i64 ; pub const NOTIFICATION_WM_UNFOCUS_REQUEST : i64 = 1008i64 ; } impl MainLoop { # [doc = "Creates a new instance of this object.\n\nBecause this type is not reference counted, the lifetime of the returned object\nis *not* automatically managed.\n\nImmediately after creation, the object is owned by the caller, and can be\npassed to the engine (in which case the engine will be responsible for\ndestroying the object) or destroyed manually using `Ref::free`, or preferably\n`Ref::queue_free` if it is a `Node`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = MainLoopMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "Should not be called manually, override [method _finalize] instead. Will be removed in Godot 4.0."] # [doc = ""] # [inline] pub fn finish (& self) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = MainLoopMethodTable :: get (get_api ()) . finish ; let ret = crate :: icalls :: icallptr_void (method_bind , self . this . sys () . as_ptr ()) ; } } # [doc = "Should not be called manually, override [method _idle] instead. Will be removed in Godot 4.0."] # [doc = ""] # [inline] pub fn idle (& self , delta : f64) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = MainLoopMethodTable :: get (get_api ()) . idle ; let ret = crate :: icalls :: icallptr_bool_f64 (method_bind , self . this . sys () . as_ptr () , delta) ; ret as _ } } # [doc = "Should not be called manually, override [method _initialize] instead. Will be removed in Godot 4.0."] # [doc = ""] # [inline] pub fn init (& self) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = MainLoopMethodTable :: get (get_api ()) . init ; let ret = crate :: icalls :: icallptr_void (method_bind , self . this . sys () . as_ptr ()) ; } } # [doc = "Should not be called manually, override [method _input_event] instead. Will be removed in Godot 4.0."] # [doc = ""] # [inline] pub fn input_event (& self , event : impl AsArg < crate :: generated :: input_event :: InputEvent >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = MainLoopMethodTable :: get (get_api ()) . input_event ; let ret = crate :: icalls :: icallptr_void_obj (method_bind , self . this . sys () . as_ptr () , event . as_arg_ptr ()) ; } } # [doc = "Should not be called manually, override [method _input_text] instead. Will be removed in Godot 4.0."] # [doc = ""] # [inline] pub fn input_text (& self , text : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = MainLoopMethodTable :: get (get_api ()) . input_text ; let ret = crate :: icalls :: icallptr_void_str (method_bind , self . this . sys () . as_ptr () , text . into ()) ; } } # [doc = "Should not be called manually, override [method _iteration] instead. Will be removed in Godot 4.0."] # [doc = ""] # [inline] pub fn iteration (& self , delta : f64) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = MainLoopMethodTable :: get (get_api ()) . iteration ; let ret = crate :: icalls :: icallptr_bool_f64 (method_bind , self . this . sys () . as_ptr () , delta) ; ret as _ } } } impl gdnative_core :: private :: godot_object :: Sealed for MainLoop { } unsafe impl GodotObject for MainLoop { type RefKind = ref_kind :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "MainLoop" } } impl std :: ops :: Deref for MainLoop { type Target = crate :: generated :: object :: Object ; # [inline] fn deref (& self) -> & crate :: generated :: object :: Object { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for MainLoop { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: object :: Object { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: object :: Object > for MainLoop { } impl Instanciable for MainLoop { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { MainLoop :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct MainLoopMethodTable { pub class_constructor : sys :: godot_class_constructor , pub finish : * mut sys :: godot_method_bind , pub idle : * mut sys :: godot_method_bind , pub init : * mut sys :: godot_method_bind , pub input_event : * mut sys :: godot_method_bind , pub input_text : * mut sys :: godot_method_bind , pub iteration : * mut sys :: godot_method_bind } impl MainLoopMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : MainLoopMethodTable = MainLoopMethodTable { class_constructor : None , finish : 0 as * mut sys :: godot_method_bind , idle : 0 as * mut sys :: godot_method_bind , init : 0 as * mut sys :: godot_method_bind , input_event : 0 as * mut sys :: godot_method_bind , input_text : 0 as * mut sys :: godot_method_bind , iteration : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { MainLoopMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "MainLoop\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . finish = (gd_api . godot_method_bind_get_method) (class_name , "finish\0" . as_ptr () as * const c_char) ; table . idle = (gd_api . godot_method_bind_get_method) (class_name , "idle\0" . as_ptr () as * const c_char) ; table . init = (gd_api . godot_method_bind_get_method) (class_name , "init\0" . as_ptr () as * const c_char) ; table . input_event = (gd_api . godot_method_bind_get_method) (class_name , "input_event\0" . as_ptr () as * const c_char) ; table . input_text = (gd_api . godot_method_bind_get_method) (class_name , "input_text\0" . as_ptr () as * const c_char) ; table . iteration = (gd_api . godot_method_bind_get_method) (class_name , "iteration\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:148:9418 [INFO] [stdout] | [INFO] [stdout] 148 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 148 | # [doc = "`core class DampedSpringJoint2D` inherits `Joint2D` (unsafe)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_dampedspringjoint2d.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nNon reference counted objects such as the ones of this type are usually owned by the engine.\n\n`DampedSpringJoint2D` is a reference-only type. Persistent references can\nonly exist in the unsafe `Ref` form.\n\nIn the cases where Rust code owns an object of this type, for example if the object was just\ncreated on the Rust side and not passed to the engine yet, ownership should be either given\nto the engine or the object must be manually destroyed using `Ref::free`, or `Ref::queue_free`\nif it is a `Node`."] # [doc = "\n## Class hierarchy\n\nDampedSpringJoint2D inherits methods from:\n - [Joint2D](struct.Joint2D.html)\n - [Node2D](struct.Node2D.html)\n - [CanvasItem](struct.CanvasItem.html)\n - [Node](struct.Node.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct DampedSpringJoint2D { this : RawObject < Self > , } impl DampedSpringJoint2D { # [doc = "Creates a new instance of this object.\n\nBecause this type is not reference counted, the lifetime of the returned object\nis *not* automatically managed.\n\nImmediately after creation, the object is owned by the caller, and can be\npassed to the engine (in which case the engine will be responsible for\ndestroying the object) or destroyed manually using `Ref::free`, or preferably\n`Ref::queue_free` if it is a `Node`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = DampedSpringJoint2DMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "The spring joint's damping ratio. A value between `0` and `1`. When the two bodies move into different directions the system tries to align them to the spring axis again. A high `damping` value forces the attached bodies to align faster."] # [doc = ""] # [inline] pub fn damping (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = DampedSpringJoint2DMethodTable :: get (get_api ()) . get_damping ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "The spring joint's maximum length. The two attached bodies cannot stretch it past this value."] # [doc = ""] # [inline] pub fn length (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = DampedSpringJoint2DMethodTable :: get (get_api ()) . get_length ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "When the bodies attached to the spring joint move they stretch or squash it. The joint always tries to resize towards this length."] # [doc = ""] # [inline] pub fn rest_length (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = DampedSpringJoint2DMethodTable :: get (get_api ()) . get_rest_length ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "The higher the value, the less the bodies attached to the joint will deform it. The joint applies an opposing force to the bodies, the product of the stiffness multiplied by the size difference from its resting length."] # [doc = ""] # [inline] pub fn stiffness (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = DampedSpringJoint2DMethodTable :: get (get_api ()) . get_stiffness ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "The spring joint's damping ratio. A value between `0` and `1`. When the two bodies move into different directions the system tries to align them to the spring axis again. A high `damping` value forces the attached bodies to align faster."] # [doc = ""] # [inline] pub fn set_damping (& self , damping : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = DampedSpringJoint2DMethodTable :: get (get_api ()) . set_damping ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , damping) ; } } # [doc = "The spring joint's maximum length. The two attached bodies cannot stretch it past this value."] # [doc = ""] # [inline] pub fn set_length (& self , length : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = DampedSpringJoint2DMethodTable :: get (get_api ()) . set_length ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , length) ; } } # [doc = "When the bodies attached to the spring joint move they stretch or squash it. The joint always tries to resize towards this length."] # [doc = ""] # [inline] pub fn set_rest_length (& self , rest_length : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = DampedSpringJoint2DMethodTable :: get (get_api ()) . set_rest_length ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , rest_length) ; } } # [doc = "The higher the value, the less the bodies attached to the joint will deform it. The joint applies an opposing force to the bodies, the product of the stiffness multiplied by the size difference from its resting length."] # [doc = ""] # [inline] pub fn set_stiffness (& self , stiffness : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = DampedSpringJoint2DMethodTable :: get (get_api ()) . set_stiffness ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , stiffness) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for DampedSpringJoint2D { } unsafe impl GodotObject for DampedSpringJoint2D { type RefKind = ref_kind :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "DampedSpringJoint2D" } } impl QueueFree for DampedSpringJoint2D { # [inline] unsafe fn godot_queue_free (obj : * mut sys :: godot_object) { let method_bind : * mut sys :: godot_method_bind = crate :: generated :: node :: NodeMethodTable :: get (get_api ()) . queue_free ; crate :: icalls :: icallptr_void (method_bind , obj) } } impl std :: ops :: Deref for DampedSpringJoint2D { type Target = crate :: generated :: joint_2d :: Joint2D ; # [inline] fn deref (& self) -> & crate :: generated :: joint_2d :: Joint2D { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for DampedSpringJoint2D { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: joint_2d :: Joint2D { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: joint_2d :: Joint2D > for DampedSpringJoint2D { } unsafe impl SubClass < crate :: generated :: node_2d :: Node2D > for DampedSpringJoint2D { } unsafe impl SubClass < crate :: generated :: canvas_item :: CanvasItem > for DampedSpringJoint2D { } unsafe impl SubClass < crate :: generated :: node :: Node > for DampedSpringJoint2D { } unsafe impl SubClass < crate :: generated :: object :: Object > for DampedSpringJoint2D { } impl Instanciable for DampedSpringJoint2D { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { DampedSpringJoint2D :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct DampedSpringJoint2DMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_damping : * mut sys :: godot_method_bind , pub get_length : * mut sys :: godot_method_bind , pub get_rest_length : * mut sys :: godot_method_bind , pub get_stiffness : * mut sys :: godot_method_bind , pub set_damping : * mut sys :: godot_method_bind , pub set_length : * mut sys :: godot_method_bind , pub set_rest_length : * mut sys :: godot_method_bind , pub set_stiffness : * mut sys :: godot_method_bind } impl DampedSpringJoint2DMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : DampedSpringJoint2DMethodTable = DampedSpringJoint2DMethodTable { class_constructor : None , get_damping : 0 as * mut sys :: godot_method_bind , get_length : 0 as * mut sys :: godot_method_bind , get_rest_length : 0 as * mut sys :: godot_method_bind , get_stiffness : 0 as * mut sys :: godot_method_bind , set_damping : 0 as * mut sys :: godot_method_bind , set_length : 0 as * mut sys :: godot_method_bind , set_rest_length : 0 as * mut sys :: godot_method_bind , set_stiffness : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { DampedSpringJoint2DMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "DampedSpringJoint2D\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_damping = (gd_api . godot_method_bind_get_method) (class_name , "get_damping\0" . as_ptr () as * const c_char) ; table . get_length = (gd_api . godot_method_bind_get_method) (class_name , "get_length\0" . as_ptr () as * const c_char) ; table . get_rest_length = (gd_api . godot_method_bind_get_method) (class_name , "get_rest_length\0" . as_ptr () as * const c_char) ; table . get_stiffness = (gd_api . godot_method_bind_get_method) (class_name , "get_stiffness\0" . as_ptr () as * const c_char) ; table . set_damping = (gd_api . godot_method_bind_get_method) (class_name , "set_damping\0" . as_ptr () as * const c_char) ; table . set_length = (gd_api . godot_method_bind_get_method) (class_name , "set_length\0" . as_ptr () as * const c_char) ; table . set_rest_length = (gd_api . godot_method_bind_get_method) (class_name , "set_rest_length\0" . as_ptr () as * const c_char) ; table . set_stiffness = (gd_api . godot_method_bind_get_method) (class_name , "set_stiffness\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:532:4202 [INFO] [stdout] | [INFO] [stdout] 532 | ...thodTable { class_constructor : None , } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 532 | # [doc = "`core class Panel` inherits `Control` (unsafe)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_panel.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nNon reference counted objects such as the ones of this type are usually owned by the engine.\n\n`Panel` is a reference-only type. Persistent references can\nonly exist in the unsafe `Ref` form.\n\nIn the cases where Rust code owns an object of this type, for example if the object was just\ncreated on the Rust side and not passed to the engine yet, ownership should be either given\nto the engine or the object must be manually destroyed using `Ref::free`, or `Ref::queue_free`\nif it is a `Node`."] # [doc = "\n## Class hierarchy\n\nPanel inherits methods from:\n - [Control](struct.Control.html)\n - [CanvasItem](struct.CanvasItem.html)\n - [Node](struct.Node.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct Panel { this : RawObject < Self > , } impl Panel { # [doc = "Creates a new instance of this object.\n\nBecause this type is not reference counted, the lifetime of the returned object\nis *not* automatically managed.\n\nImmediately after creation, the object is owned by the caller, and can be\npassed to the engine (in which case the engine will be responsible for\ndestroying the object) or destroyed manually using `Ref::free`, or preferably\n`Ref::queue_free` if it is a `Node`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = PanelMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } } impl gdnative_core :: private :: godot_object :: Sealed for Panel { } unsafe impl GodotObject for Panel { type RefKind = ref_kind :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "Panel" } } impl QueueFree for Panel { # [inline] unsafe fn godot_queue_free (obj : * mut sys :: godot_object) { let method_bind : * mut sys :: godot_method_bind = crate :: generated :: node :: NodeMethodTable :: get (get_api ()) . queue_free ; crate :: icalls :: icallptr_void (method_bind , obj) } } impl std :: ops :: Deref for Panel { type Target = crate :: generated :: control :: Control ; # [inline] fn deref (& self) -> & crate :: generated :: control :: Control { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for Panel { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: control :: Control { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: control :: Control > for Panel { } unsafe impl SubClass < crate :: generated :: canvas_item :: CanvasItem > for Panel { } unsafe impl SubClass < crate :: generated :: node :: Node > for Panel { } unsafe impl SubClass < crate :: generated :: object :: Object > for Panel { } impl Instanciable for Panel { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { Panel :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct PanelMethodTable { pub class_constructor : sys :: godot_class_constructor , } impl PanelMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : PanelMethodTable = PanelMethodTable { class_constructor : None , } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { PanelMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "Panel\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:154:3071 [INFO] [stdout] | [INFO] [stdout] 154 | ...thodTable { class_constructor : None , } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 154 | # [doc = "`core class JavaClass` inherits `Reference` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_javaclass.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nJavaClass inherits methods from:\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct JavaClass { this : RawObject < Self > , } impl JavaClass { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = JavaClassMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } } impl gdnative_core :: private :: godot_object :: Sealed for JavaClass { } unsafe impl GodotObject for JavaClass { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "JavaClass" } } impl std :: ops :: Deref for JavaClass { type Target = crate :: generated :: reference :: Reference ; # [inline] fn deref (& self) -> & crate :: generated :: reference :: Reference { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for JavaClass { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: reference :: Reference { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: reference :: Reference > for JavaClass { } unsafe impl SubClass < crate :: generated :: object :: Object > for JavaClass { } impl Instanciable for JavaClass { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { JavaClass :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct JavaClassMethodTable { pub class_constructor : sys :: godot_class_constructor , } impl JavaClassMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : JavaClassMethodTable = JavaClassMethodTable { class_constructor : None , } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { JavaClassMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "JavaClass\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:160:3498 [INFO] [stdout] | [INFO] [stdout] 160 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 160 | # [doc = "`core singleton class JavaClassWrapper` inherits `Object` (unsafe)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_javaclasswrapper.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = ""] # [doc = "\n## Class hierarchy\n\nJavaClassWrapper inherits methods from:\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct JavaClassWrapper { this : RawObject < Self > , } impl JavaClassWrapper { # [doc = "Returns a reference to the singleton instance."] # [inline] pub fn godot_singleton () -> & 'static Self { unsafe { let this = (get_api () . godot_global_get_singleton) ("JavaClassWrapper\0" . as_ptr () as * mut _) ; let this = ptr :: NonNull :: new (this) . expect ("singleton should not be null") ; let this = RawObject :: from_sys_ref_unchecked :: < 'static > (this) ; Self :: cast_ref (this) } } # [doc = ""] # [doc = ""] # [inline] pub fn wrap (& self , name : impl Into < GodotString >) -> Option < Ref < crate :: generated :: java_class :: JavaClass , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = JavaClassWrapperMethodTable :: get (get_api ()) . wrap ; let ret = crate :: icalls :: icallptr_obj_str (method_bind , self . this . sys () . as_ptr () , name . into ()) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: java_class :: JavaClass , thread_access :: Shared >> :: move_from_sys (sys)) } } } impl gdnative_core :: private :: godot_object :: Sealed for JavaClassWrapper { } unsafe impl GodotObject for JavaClassWrapper { type RefKind = ref_kind :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "JavaClassWrapper" } } impl std :: ops :: Deref for JavaClassWrapper { type Target = crate :: generated :: object :: Object ; # [inline] fn deref (& self) -> & crate :: generated :: object :: Object { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for JavaClassWrapper { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: object :: Object { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: object :: Object > for JavaClassWrapper { } unsafe impl Send for JavaClassWrapper { } unsafe impl Sync for JavaClassWrapper { } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct JavaClassWrapperMethodTable { pub class_constructor : sys :: godot_class_constructor , pub wrap : * mut sys :: godot_method_bind } impl JavaClassWrapperMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : JavaClassWrapperMethodTable = JavaClassWrapperMethodTable { class_constructor : None , wrap : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { JavaClassWrapperMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "JavaClassWrapper\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . wrap = (gd_api . godot_method_bind_get_method) (class_name , "wrap\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:538:6878 [INFO] [stdout] | [INFO] [stdout] 538 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 538 | # [doc = "`core class StreamPeerBuffer` inherits `StreamPeer` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_streampeerbuffer.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nStreamPeerBuffer inherits methods from:\n - [StreamPeer](struct.StreamPeer.html)\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct StreamPeerBuffer { this : RawObject < Self > , } impl StreamPeerBuffer { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = StreamPeerBufferMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = ""] # [doc = ""] # [inline] pub fn clear (& self) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = StreamPeerBufferMethodTable :: get (get_api ()) . clear ; let ret = crate :: icalls :: icallptr_void (method_bind , self . this . sys () . as_ptr ()) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn duplicate (& self) -> Option < Ref < crate :: generated :: stream_peer_buffer :: StreamPeerBuffer , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = StreamPeerBufferMethodTable :: get (get_api ()) . duplicate ; let ret = crate :: icalls :: icallptr_obj (method_bind , self . this . sys () . as_ptr ()) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: stream_peer_buffer :: StreamPeerBuffer , thread_access :: Shared >> :: move_from_sys (sys)) } } # [doc = ""] # [doc = ""] # [inline] pub fn data_array (& self) -> ByteArray { unsafe { let method_bind : * mut sys :: godot_method_bind = StreamPeerBufferMethodTable :: get (get_api ()) . get_data_array ; let ret = crate :: icalls :: icallptr_bytearr (method_bind , self . this . sys () . as_ptr ()) ; ByteArray :: from_sys (ret) } } # [doc = ""] # [doc = ""] # [inline] pub fn get_position (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = StreamPeerBufferMethodTable :: get (get_api ()) . get_position ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = ""] # [doc = ""] # [inline] pub fn get_size (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = StreamPeerBufferMethodTable :: get (get_api ()) . get_size ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = ""] # [doc = ""] # [inline] pub fn resize (& self , size : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = StreamPeerBufferMethodTable :: get (get_api ()) . resize ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , size) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn seek (& self , position : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = StreamPeerBufferMethodTable :: get (get_api ()) . seek ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , position) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn set_data_array (& self , data : ByteArray) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = StreamPeerBufferMethodTable :: get (get_api ()) . set_data_array ; let ret = crate :: icalls :: icallptr_void_bytearr (method_bind , self . this . sys () . as_ptr () , data) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for StreamPeerBuffer { } unsafe impl GodotObject for StreamPeerBuffer { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "StreamPeerBuffer" } } impl std :: ops :: Deref for StreamPeerBuffer { type Target = crate :: generated :: stream_peer :: StreamPeer ; # [inline] fn deref (& self) -> & crate :: generated :: stream_peer :: StreamPeer { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for StreamPeerBuffer { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: stream_peer :: StreamPeer { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: stream_peer :: StreamPeer > for StreamPeerBuffer { } unsafe impl SubClass < crate :: generated :: reference :: Reference > for StreamPeerBuffer { } unsafe impl SubClass < crate :: generated :: object :: Object > for StreamPeerBuffer { } impl Instanciable for StreamPeerBuffer { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { StreamPeerBuffer :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct StreamPeerBufferMethodTable { pub class_constructor : sys :: godot_class_constructor , pub clear : * mut sys :: godot_method_bind , pub duplicate : * mut sys :: godot_method_bind , pub get_data_array : * mut sys :: godot_method_bind , pub get_position : * mut sys :: godot_method_bind , pub get_size : * mut sys :: godot_method_bind , pub resize : * mut sys :: godot_method_bind , pub seek : * mut sys :: godot_method_bind , pub set_data_array : * mut sys :: godot_method_bind } impl StreamPeerBufferMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : StreamPeerBufferMethodTable = StreamPeerBufferMethodTable { class_constructor : None , clear : 0 as * mut sys :: godot_method_bind , duplicate : 0 as * mut sys :: godot_method_bind , get_data_array : 0 as * mut sys :: godot_method_bind , get_position : 0 as * mut sys :: godot_method_bind , get_size : 0 as * mut sys :: godot_method_bind , resize : 0 as * mut sys :: godot_method_bind , seek : 0 as * mut sys :: godot_method_bind , set_data_array : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { StreamPeerBufferMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "StreamPeerBuffer\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . clear = (gd_api . godot_method_bind_get_method) (class_name , "clear\0" . as_ptr () as * const c_char) ; table . duplicate = (gd_api . godot_method_bind_get_method) (class_name , "duplicate\0" . as_ptr () as * const c_char) ; table . get_data_array = (gd_api . godot_method_bind_get_method) (class_name , "get_data_array\0" . as_ptr () as * const c_char) ; table . get_position = (gd_api . godot_method_bind_get_method) (class_name , "get_position\0" . as_ptr () as * const c_char) ; table . get_size = (gd_api . godot_method_bind_get_method) (class_name , "get_size\0" . as_ptr () as * const c_char) ; table . resize = (gd_api . godot_method_bind_get_method) (class_name , "resize\0" . as_ptr () as * const c_char) ; table . seek = (gd_api . godot_method_bind_get_method) (class_name , "seek\0" . as_ptr () as * const c_char) ; table . set_data_array = (gd_api . godot_method_bind_get_method) (class_name , "set_data_array\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:166:5986 [INFO] [stdout] | [INFO] [stdout] 166 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 166 | # [doc = "`core class InputEventScreenTouch` inherits `InputEvent` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_inputeventscreentouch.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nInputEventScreenTouch inherits methods from:\n - [InputEvent](struct.InputEvent.html)\n - [Resource](struct.Resource.html)\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct InputEventScreenTouch { this : RawObject < Self > , } impl InputEventScreenTouch { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = InputEventScreenTouchMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "The touch index in the case of a multi-touch event. One index = one finger."] # [doc = ""] # [inline] pub fn index (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = InputEventScreenTouchMethodTable :: get (get_api ()) . get_index ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "The touch position."] # [doc = ""] # [inline] pub fn position (& self) -> Vector2 { unsafe { let method_bind : * mut sys :: godot_method_bind = InputEventScreenTouchMethodTable :: get (get_api ()) . get_position ; let ret = crate :: icalls :: icallptr_vec2 (method_bind , self . this . sys () . as_ptr ()) ; mem :: transmute (ret) } } # [doc = "The touch index in the case of a multi-touch event. One index = one finger."] # [doc = ""] # [inline] pub fn set_index (& self , index : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = InputEventScreenTouchMethodTable :: get (get_api ()) . set_index ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , index) ; } } # [doc = "The touch position."] # [doc = ""] # [inline] pub fn set_position (& self , position : Vector2) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = InputEventScreenTouchMethodTable :: get (get_api ()) . set_position ; let ret = crate :: icalls :: icallptr_void_vec2 (method_bind , self . this . sys () . as_ptr () , position) ; } } # [doc = "If `true`, the touch's state is pressed. If `false`, the touch's state is released."] # [doc = ""] # [inline] pub fn set_pressed (& self , pressed : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = InputEventScreenTouchMethodTable :: get (get_api ()) . set_pressed ; let ret = crate :: icalls :: icallptr_void_bool (method_bind , self . this . sys () . as_ptr () , pressed) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for InputEventScreenTouch { } unsafe impl GodotObject for InputEventScreenTouch { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "InputEventScreenTouch" } } impl std :: ops :: Deref for InputEventScreenTouch { type Target = crate :: generated :: input_event :: InputEvent ; # [inline] fn deref (& self) -> & crate :: generated :: input_event :: InputEvent { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for InputEventScreenTouch { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: input_event :: InputEvent { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: input_event :: InputEvent > for InputEventScreenTouch { } unsafe impl SubClass < crate :: generated :: resource :: Resource > for InputEventScreenTouch { } unsafe impl SubClass < crate :: generated :: reference :: Reference > for InputEventScreenTouch { } unsafe impl SubClass < crate :: generated :: object :: Object > for InputEventScreenTouch { } impl Instanciable for InputEventScreenTouch { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { InputEventScreenTouch :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct InputEventScreenTouchMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_index : * mut sys :: godot_method_bind , pub get_position : * mut sys :: godot_method_bind , pub set_index : * mut sys :: godot_method_bind , pub set_position : * mut sys :: godot_method_bind , pub set_pressed : * mut sys :: godot_method_bind } impl InputEventScreenTouchMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : InputEventScreenTouchMethodTable = InputEventScreenTouchMethodTable { class_constructor : None , get_index : 0 as * mut sys :: godot_method_bind , get_position : 0 as * mut sys :: godot_method_bind , set_index : 0 as * mut sys :: godot_method_bind , set_position : 0 as * mut sys :: godot_method_bind , set_pressed : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { InputEventScreenTouchMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "InputEventScreenTouch\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_index = (gd_api . godot_method_bind_get_method) (class_name , "get_index\0" . as_ptr () as * const c_char) ; table . get_position = (gd_api . godot_method_bind_get_method) (class_name , "get_position\0" . as_ptr () as * const c_char) ; table . set_index = (gd_api . godot_method_bind_get_method) (class_name , "set_index\0" . as_ptr () as * const c_char) ; table . set_position = (gd_api . godot_method_bind_get_method) (class_name , "set_position\0" . as_ptr () as * const c_char) ; table . set_pressed = (gd_api . godot_method_bind_get_method) (class_name , "set_pressed\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:544:3598 [INFO] [stdout] | [INFO] [stdout] 544 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 544 | # [doc = "`core class GDScriptFunctionState` inherits `Reference` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_gdscriptfunctionstate.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nGDScriptFunctionState inherits methods from:\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct GDScriptFunctionState { this : RawObject < Self > , } impl GDScriptFunctionState { # [doc = ""] # [doc = ""] # [inline] pub fn is_valid (& self , extended_check : bool) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = GDScriptFunctionStateMethodTable :: get (get_api ()) . is_valid ; let ret = crate :: icalls :: icallptr_bool_bool (method_bind , self . this . sys () . as_ptr () , extended_check) ; ret as _ } } # [doc = ""] # [doc = ""] # [inline] pub fn resume (& self , arg : impl OwnedToVariant) -> Variant { unsafe { let method_bind : * mut sys :: godot_method_bind = GDScriptFunctionStateMethodTable :: get (get_api ()) . resume ; let ret = crate :: icalls :: icallptr_var_var (method_bind , self . this . sys () . as_ptr () , arg . owned_to_variant ()) ; Variant :: from_sys (ret) } } } impl gdnative_core :: private :: godot_object :: Sealed for GDScriptFunctionState { } unsafe impl GodotObject for GDScriptFunctionState { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "GDScriptFunctionState" } } impl std :: ops :: Deref for GDScriptFunctionState { type Target = crate :: generated :: reference :: Reference ; # [inline] fn deref (& self) -> & crate :: generated :: reference :: Reference { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for GDScriptFunctionState { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: reference :: Reference { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: reference :: Reference > for GDScriptFunctionState { } unsafe impl SubClass < crate :: generated :: object :: Object > for GDScriptFunctionState { } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct GDScriptFunctionStateMethodTable { pub class_constructor : sys :: godot_class_constructor , pub is_valid : * mut sys :: godot_method_bind , pub resume : * mut sys :: godot_method_bind } impl GDScriptFunctionStateMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : GDScriptFunctionStateMethodTable = GDScriptFunctionStateMethodTable { class_constructor : None , is_valid : 0 as * mut sys :: godot_method_bind , resume : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { GDScriptFunctionStateMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "GDScriptFunctionState\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . is_valid = (gd_api . godot_method_bind_get_method) (class_name , "is_valid\0" . as_ptr () as * const c_char) ; table . resume = (gd_api . godot_method_bind_get_method) (class_name , "resume\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:550:29477 [INFO] [stdout] | [INFO] [stdout] 550 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 550 | # [doc = "`core class Camera2D` inherits `Node2D` (unsafe)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_camera2d.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nNon reference counted objects such as the ones of this type are usually owned by the engine.\n\n`Camera2D` is a reference-only type. Persistent references can\nonly exist in the unsafe `Ref` form.\n\nIn the cases where Rust code owns an object of this type, for example if the object was just\ncreated on the Rust side and not passed to the engine yet, ownership should be either given\nto the engine or the object must be manually destroyed using `Ref::free`, or `Ref::queue_free`\nif it is a `Node`."] # [doc = "\n## Class hierarchy\n\nCamera2D inherits methods from:\n - [Node2D](struct.Node2D.html)\n - [CanvasItem](struct.CanvasItem.html)\n - [Node](struct.Node.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct Camera2D { this : RawObject < Self > , } # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct AnchorMode (pub i64) ; impl AnchorMode { pub const FIXED_TOP_LEFT : AnchorMode = AnchorMode (0i64) ; pub const DRAG_CENTER : AnchorMode = AnchorMode (1i64) ; } impl From < i64 > for AnchorMode { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < AnchorMode > for i64 { # [inline] fn from (v : AnchorMode) -> Self { v . 0 } } # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct Camera2DProcessMode (pub i64) ; impl Camera2DProcessMode { pub const PHYSICS : Camera2DProcessMode = Camera2DProcessMode (0i64) ; pub const IDLE : Camera2DProcessMode = Camera2DProcessMode (1i64) ; } impl From < i64 > for Camera2DProcessMode { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < Camera2DProcessMode > for i64 { # [inline] fn from (v : Camera2DProcessMode) -> Self { v . 0 } } # [doc = "Constants"] # [allow (non_upper_case_globals)] impl Camera2D { pub const ANCHOR_MODE_DRAG_CENTER : i64 = 1i64 ; pub const ANCHOR_MODE_FIXED_TOP_LEFT : i64 = 0i64 ; pub const CAMERA2D_PROCESS_IDLE : i64 = 1i64 ; pub const CAMERA2D_PROCESS_PHYSICS : i64 = 0i64 ; } impl Camera2D { # [doc = "Creates a new instance of this object.\n\nBecause this type is not reference counted, the lifetime of the returned object\nis *not* automatically managed.\n\nImmediately after creation, the object is owned by the caller, and can be\npassed to the engine (in which case the engine will be responsible for\ndestroying the object) or destroyed manually using `Ref::free`, or preferably\n`Ref::queue_free` if it is a `Node`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = Camera2DMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "Aligns the camera to the tracked node."] # [doc = ""] # [inline] pub fn align (& self) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = Camera2DMethodTable :: get (get_api ()) . align ; let ret = crate :: icalls :: icallptr_void (method_bind , self . this . sys () . as_ptr ()) ; } } # [doc = "Removes any [Camera2D] from the ancestor [Viewport]'s internal currently-assigned camera."] # [doc = ""] # [inline] pub fn clear_current (& self) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = Camera2DMethodTable :: get (get_api ()) . clear_current ; let ret = crate :: icalls :: icallptr_void (method_bind , self . this . sys () . as_ptr ()) ; } } # [doc = "Forces the camera to update scroll immediately."] # [doc = ""] # [inline] pub fn force_update_scroll (& self) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = Camera2DMethodTable :: get (get_api ()) . force_update_scroll ; let ret = crate :: icalls :: icallptr_void (method_bind , self . this . sys () . as_ptr ()) ; } } # [doc = "The Camera2D's anchor point. See [enum AnchorMode] constants."] # [doc = ""] # [inline] pub fn anchor_mode (& self) -> crate :: generated :: camera_2d :: AnchorMode { unsafe { let method_bind : * mut sys :: godot_method_bind = Camera2DMethodTable :: get (get_api ()) . get_anchor_mode ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; crate :: generated :: camera_2d :: AnchorMode (ret) } } # [doc = "Returns the camera position."] # [doc = ""] # [inline] pub fn get_camera_position (& self) -> Vector2 { unsafe { let method_bind : * mut sys :: godot_method_bind = Camera2DMethodTable :: get (get_api ()) . get_camera_position ; let ret = crate :: icalls :: icallptr_vec2 (method_bind , self . this . sys () . as_ptr ()) ; mem :: transmute (ret) } } # [doc = "Returns the location of the [Camera2D]'s screen-center, relative to the origin."] # [doc = ""] # [inline] pub fn get_camera_screen_center (& self) -> Vector2 { unsafe { let method_bind : * mut sys :: godot_method_bind = Camera2DMethodTable :: get (get_api ()) . get_camera_screen_center ; let ret = crate :: icalls :: icallptr_vec2 (method_bind , self . this . sys () . as_ptr ()) ; mem :: transmute (ret) } } # [doc = "The custom [Viewport] node attached to the [Camera2D]. If `null` or not a [Viewport], uses the default viewport instead."] # [doc = ""] # [inline] pub fn custom_viewport (& self) -> Option < Ref < crate :: generated :: node :: Node , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = Camera2DMethodTable :: get (get_api ()) . get_custom_viewport ; let ret = crate :: icalls :: icallptr_obj (method_bind , self . this . sys () . as_ptr ()) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: node :: Node , thread_access :: Shared >> :: move_from_sys (sys)) } } # [doc = "Top margin needed to drag the camera. A value of `1` makes the camera move only when reaching the edge of the screen."] # [doc = ""] # [inline] pub fn drag_margin (& self , margin : i64) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = Camera2DMethodTable :: get (get_api ()) . get_drag_margin ; let ret = crate :: icalls :: icallptr_f64_i64 (method_bind , self . this . sys () . as_ptr () , margin) ; ret as _ } } # [doc = "Speed in pixels per second of the camera's smoothing effect when [member smoothing_enabled] is `true`."] # [doc = ""] # [inline] pub fn follow_smoothing (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = Camera2DMethodTable :: get (get_api ()) . get_follow_smoothing ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "The horizontal offset of the camera, relative to the drag margins.\n**Note:** Offset H is used only to force offset relative to margins. It's not updated in any way if drag margins are enabled and can be used to set initial offset."] # [doc = ""] # [inline] pub fn h_offset (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = Camera2DMethodTable :: get (get_api ()) . get_h_offset ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Top scroll limit in pixels. The camera stops moving when reaching this value."] # [doc = ""] # [inline] pub fn limit (& self , margin : i64) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = Camera2DMethodTable :: get (get_api ()) . get_limit ; let ret = crate :: icalls :: icallptr_i64_i64 (method_bind , self . this . sys () . as_ptr () , margin) ; ret as _ } } # [doc = "The camera's offset, useful for looking around or camera shake animations."] # [doc = ""] # [inline] pub fn offset (& self) -> Vector2 { unsafe { let method_bind : * mut sys :: godot_method_bind = Camera2DMethodTable :: get (get_api ()) . get_offset ; let ret = crate :: icalls :: icallptr_vec2 (method_bind , self . this . sys () . as_ptr ()) ; mem :: transmute (ret) } } # [doc = "The camera's process callback. See [enum Camera2DProcessMode]."] # [doc = ""] # [inline] pub fn process_mode (& self) -> crate :: generated :: camera_2d :: Camera2DProcessMode { unsafe { let method_bind : * mut sys :: godot_method_bind = Camera2DMethodTable :: get (get_api ()) . get_process_mode ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; crate :: generated :: camera_2d :: Camera2DProcessMode (ret) } } # [doc = "The vertical offset of the camera, relative to the drag margins.\n**Note:** Used the same as [member offset_h]."] # [doc = ""] # [inline] pub fn v_offset (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = Camera2DMethodTable :: get (get_api ()) . get_v_offset ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "The camera's zoom relative to the viewport. Values larger than `Vector2(1, 1)` zoom out and smaller values zoom in. For an example, use `Vector2(0.5, 0.5)` for a 2× zoom-in, and `Vector2(4, 4)` for a 4× zoom-out."] # [doc = ""] # [inline] pub fn zoom (& self) -> Vector2 { unsafe { let method_bind : * mut sys :: godot_method_bind = Camera2DMethodTable :: get (get_api ()) . get_zoom ; let ret = crate :: icalls :: icallptr_vec2 (method_bind , self . this . sys () . as_ptr ()) ; mem :: transmute (ret) } } # [doc = "If `true`, the camera is the active camera for the current scene. Only one camera can be current, so setting a different camera `current` will disable this one."] # [doc = ""] # [inline] pub fn is_current (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = Camera2DMethodTable :: get (get_api ()) . is_current ; let ret = crate :: icalls :: icallptr_bool (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "If `true`, the camera smoothly moves towards the target at [member smoothing_speed]."] # [doc = ""] # [inline] pub fn is_follow_smoothing_enabled (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = Camera2DMethodTable :: get (get_api ()) . is_follow_smoothing_enabled ; let ret = crate :: icalls :: icallptr_bool (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "If `true`, the camera only moves when reaching the horizontal drag margins. If `false`, the camera moves horizontally regardless of margins."] # [doc = ""] # [inline] pub fn is_h_drag_enabled (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = Camera2DMethodTable :: get (get_api ()) . is_h_drag_enabled ; let ret = crate :: icalls :: icallptr_bool (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "If `true`, draws the camera's limits rectangle in the editor."] # [doc = ""] # [inline] pub fn is_limit_drawing_enabled (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = Camera2DMethodTable :: get (get_api ()) . is_limit_drawing_enabled ; let ret = crate :: icalls :: icallptr_bool (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "If `true`, the camera smoothly stops when reaches its limits."] # [doc = ""] # [inline] pub fn is_limit_smoothing_enabled (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = Camera2DMethodTable :: get (get_api ()) . is_limit_smoothing_enabled ; let ret = crate :: icalls :: icallptr_bool (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "If `true`, draws the camera's drag margin rectangle in the editor."] # [doc = ""] # [inline] pub fn is_margin_drawing_enabled (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = Camera2DMethodTable :: get (get_api ()) . is_margin_drawing_enabled ; let ret = crate :: icalls :: icallptr_bool (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "If `true`, the camera rotates with the target."] # [doc = ""] # [inline] pub fn is_rotating (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = Camera2DMethodTable :: get (get_api ()) . is_rotating ; let ret = crate :: icalls :: icallptr_bool (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "If `true`, draws the camera's screen rectangle in the editor."] # [doc = ""] # [inline] pub fn is_screen_drawing_enabled (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = Camera2DMethodTable :: get (get_api ()) . is_screen_drawing_enabled ; let ret = crate :: icalls :: icallptr_bool (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "If `true`, the camera only moves when reaching the vertical drag margins. If `false`, the camera moves vertically regardless of margins."] # [doc = ""] # [inline] pub fn is_v_drag_enabled (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = Camera2DMethodTable :: get (get_api ()) . is_v_drag_enabled ; let ret = crate :: icalls :: icallptr_bool (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Make this the current 2D camera for the scene (viewport and layer), in case there are many cameras in the scene."] # [doc = ""] # [inline] pub fn make_current (& self) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = Camera2DMethodTable :: get (get_api ()) . make_current ; let ret = crate :: icalls :: icallptr_void (method_bind , self . this . sys () . as_ptr ()) ; } } # [doc = "Sets the camera's position immediately to its current smoothing destination.\nThis has no effect if smoothing is disabled."] # [doc = ""] # [inline] pub fn reset_smoothing (& self) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = Camera2DMethodTable :: get (get_api ()) . reset_smoothing ; let ret = crate :: icalls :: icallptr_void (method_bind , self . this . sys () . as_ptr ()) ; } } # [doc = "The Camera2D's anchor point. See [enum AnchorMode] constants."] # [doc = ""] # [inline] pub fn set_anchor_mode (& self , anchor_mode : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = Camera2DMethodTable :: get (get_api ()) . set_anchor_mode ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , anchor_mode) ; } } # [doc = "The custom [Viewport] node attached to the [Camera2D]. If `null` or not a [Viewport], uses the default viewport instead."] # [doc = ""] # [inline] pub fn set_custom_viewport (& self , viewport : impl AsArg < crate :: generated :: node :: Node >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = Camera2DMethodTable :: get (get_api ()) . set_custom_viewport ; let ret = crate :: icalls :: icallptr_void_obj (method_bind , self . this . sys () . as_ptr () , viewport . as_arg_ptr ()) ; } } # [doc = "Top margin needed to drag the camera. A value of `1` makes the camera move only when reaching the edge of the screen."] # [doc = ""] # [inline] pub fn set_drag_margin (& self , margin : i64 , drag_margin : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = Camera2DMethodTable :: get (get_api ()) . set_drag_margin ; let ret = crate :: icalls :: icallptr_void_i64_f64 (method_bind , self . this . sys () . as_ptr () , margin , drag_margin) ; } } # [doc = "If `true`, the camera smoothly moves towards the target at [member smoothing_speed]."] # [doc = ""] # [inline] pub fn set_enable_follow_smoothing (& self , follow_smoothing : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = Camera2DMethodTable :: get (get_api ()) . set_enable_follow_smoothing ; let ret = crate :: icalls :: icallptr_void_bool (method_bind , self . this . sys () . as_ptr () , follow_smoothing) ; } } # [doc = "Speed in pixels per second of the camera's smoothing effect when [member smoothing_enabled] is `true`."] # [doc = ""] # [inline] pub fn set_follow_smoothing (& self , follow_smoothing : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = Camera2DMethodTable :: get (get_api ()) . set_follow_smoothing ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , follow_smoothing) ; } } # [doc = "If `true`, the camera only moves when reaching the horizontal drag margins. If `false`, the camera moves horizontally regardless of margins."] # [doc = ""] # [inline] pub fn set_h_drag_enabled (& self , enabled : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = Camera2DMethodTable :: get (get_api ()) . set_h_drag_enabled ; let ret = crate :: icalls :: icallptr_void_bool (method_bind , self . this . sys () . as_ptr () , enabled) ; } } # [doc = "The horizontal offset of the camera, relative to the drag margins.\n**Note:** Offset H is used only to force offset relative to margins. It's not updated in any way if drag margins are enabled and can be used to set initial offset."] # [doc = ""] # [inline] pub fn set_h_offset (& self , ofs : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = Camera2DMethodTable :: get (get_api ()) . set_h_offset ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , ofs) ; } } # [doc = "Top scroll limit in pixels. The camera stops moving when reaching this value."] # [doc = ""] # [inline] pub fn set_limit (& self , margin : i64 , limit : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = Camera2DMethodTable :: get (get_api ()) . set_limit ; let ret = crate :: icalls :: icallptr_void_i64_i64 (method_bind , self . this . sys () . as_ptr () , margin , limit) ; } } # [doc = "If `true`, draws the camera's limits rectangle in the editor."] # [doc = ""] # [inline] pub fn set_limit_drawing_enabled (& self , limit_drawing_enabled : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = Camera2DMethodTable :: get (get_api ()) . set_limit_drawing_enabled ; let ret = crate :: icalls :: icallptr_void_bool (method_bind , self . this . sys () . as_ptr () , limit_drawing_enabled) ; } } # [doc = "If `true`, the camera smoothly stops when reaches its limits."] # [doc = ""] # [inline] pub fn set_limit_smoothing_enabled (& self , limit_smoothing_enabled : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = Camera2DMethodTable :: get (get_api ()) . set_limit_smoothing_enabled ; let ret = crate :: icalls :: icallptr_void_bool (method_bind , self . this . sys () . as_ptr () , limit_smoothing_enabled) ; } } # [doc = "If `true`, draws the camera's drag margin rectangle in the editor."] # [doc = ""] # [inline] pub fn set_margin_drawing_enabled (& self , margin_drawing_enabled : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = Camera2DMethodTable :: get (get_api ()) . set_margin_drawing_enabled ; let ret = crate :: icalls :: icallptr_void_bool (method_bind , self . this . sys () . as_ptr () , margin_drawing_enabled) ; } } # [doc = "The camera's offset, useful for looking around or camera shake animations."] # [doc = ""] # [inline] pub fn set_offset (& self , offset : Vector2) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = Camera2DMethodTable :: get (get_api ()) . set_offset ; let ret = crate :: icalls :: icallptr_void_vec2 (method_bind , self . this . sys () . as_ptr () , offset) ; } } # [doc = "The camera's process callback. See [enum Camera2DProcessMode]."] # [doc = ""] # [inline] pub fn set_process_mode (& self , mode : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = Camera2DMethodTable :: get (get_api ()) . set_process_mode ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , mode) ; } } # [doc = "If `true`, the camera rotates with the target."] # [doc = ""] # [inline] pub fn set_rotating (& self , rotating : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = Camera2DMethodTable :: get (get_api ()) . set_rotating ; let ret = crate :: icalls :: icallptr_void_bool (method_bind , self . this . sys () . as_ptr () , rotating) ; } } # [doc = "If `true`, draws the camera's screen rectangle in the editor."] # [doc = ""] # [inline] pub fn set_screen_drawing_enabled (& self , screen_drawing_enabled : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = Camera2DMethodTable :: get (get_api ()) . set_screen_drawing_enabled ; let ret = crate :: icalls :: icallptr_void_bool (method_bind , self . this . sys () . as_ptr () , screen_drawing_enabled) ; } } # [doc = "If `true`, the camera only moves when reaching the vertical drag margins. If `false`, the camera moves vertically regardless of margins."] # [doc = ""] # [inline] pub fn set_v_drag_enabled (& self , enabled : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = Camera2DMethodTable :: get (get_api ()) . set_v_drag_enabled ; let ret = crate :: icalls :: icallptr_void_bool (method_bind , self . this . sys () . as_ptr () , enabled) ; } } # [doc = "The vertical offset of the camera, relative to the drag margins.\n**Note:** Used the same as [member offset_h]."] # [doc = ""] # [inline] pub fn set_v_offset (& self , ofs : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = Camera2DMethodTable :: get (get_api ()) . set_v_offset ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , ofs) ; } } # [doc = "The camera's zoom relative to the viewport. Values larger than `Vector2(1, 1)` zoom out and smaller values zoom in. For an example, use `Vector2(0.5, 0.5)` for a 2× zoom-in, and `Vector2(4, 4)` for a 4× zoom-out."] # [doc = ""] # [inline] pub fn set_zoom (& self , zoom : Vector2) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = Camera2DMethodTable :: get (get_api ()) . set_zoom ; let ret = crate :: icalls :: icallptr_void_vec2 (method_bind , self . this . sys () . as_ptr () , zoom) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for Camera2D { } unsafe impl GodotObject for Camera2D { type RefKind = ref_kind :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "Camera2D" } } impl QueueFree for Camera2D { # [inline] unsafe fn godot_queue_free (obj : * mut sys :: godot_object) { let method_bind : * mut sys :: godot_method_bind = crate :: generated :: node :: NodeMethodTable :: get (get_api ()) . queue_free ; crate :: icalls :: icallptr_void (method_bind , obj) } } impl std :: ops :: Deref for Camera2D { type Target = crate :: generated :: node_2d :: Node2D ; # [inline] fn deref (& self) -> & crate :: generated :: node_2d :: Node2D { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for Camera2D { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: node_2d :: Node2D { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: node_2d :: Node2D > for Camera2D { } unsafe impl SubClass < crate :: generated :: canvas_item :: CanvasItem > for Camera2D { } unsafe impl SubClass < crate :: generated :: node :: Node > for Camera2D { } unsafe impl SubClass < crate :: generated :: object :: Object > for Camera2D { } impl Instanciable for Camera2D { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { Camera2D :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct Camera2DMethodTable { pub class_constructor : sys :: godot_class_constructor , pub align : * mut sys :: godot_method_bind , pub clear_current : * mut sys :: godot_method_bind , pub force_update_scroll : * mut sys :: godot_method_bind , pub get_anchor_mode : * mut sys :: godot_method_bind , pub get_camera_position : * mut sys :: godot_method_bind , pub get_camera_screen_center : * mut sys :: godot_method_bind , pub get_custom_viewport : * mut sys :: godot_method_bind , pub get_drag_margin : * mut sys :: godot_method_bind , pub get_follow_smoothing : * mut sys :: godot_method_bind , pub get_h_offset : * mut sys :: godot_method_bind , pub get_limit : * mut sys :: godot_method_bind , pub get_offset : * mut sys :: godot_method_bind , pub get_process_mode : * mut sys :: godot_method_bind , pub get_v_offset : * mut sys :: godot_method_bind , pub get_zoom : * mut sys :: godot_method_bind , pub is_current : * mut sys :: godot_method_bind , pub is_follow_smoothing_enabled : * mut sys :: godot_method_bind , pub is_h_drag_enabled : * mut sys :: godot_method_bind , pub is_limit_drawing_enabled : * mut sys :: godot_method_bind , pub is_limit_smoothing_enabled : * mut sys :: godot_method_bind , pub is_margin_drawing_enabled : * mut sys :: godot_method_bind , pub is_rotating : * mut sys :: godot_method_bind , pub is_screen_drawing_enabled : * mut sys :: godot_method_bind , pub is_v_drag_enabled : * mut sys :: godot_method_bind , pub make_current : * mut sys :: godot_method_bind , pub reset_smoothing : * mut sys :: godot_method_bind , pub set_anchor_mode : * mut sys :: godot_method_bind , pub set_custom_viewport : * mut sys :: godot_method_bind , pub set_drag_margin : * mut sys :: godot_method_bind , pub set_enable_follow_smoothing : * mut sys :: godot_method_bind , pub set_follow_smoothing : * mut sys :: godot_method_bind , pub set_h_drag_enabled : * mut sys :: godot_method_bind , pub set_h_offset : * mut sys :: godot_method_bind , pub set_limit : * mut sys :: godot_method_bind , pub set_limit_drawing_enabled : * mut sys :: godot_method_bind , pub set_limit_smoothing_enabled : * mut sys :: godot_method_bind , pub set_margin_drawing_enabled : * mut sys :: godot_method_bind , pub set_offset : * mut sys :: godot_method_bind , pub set_process_mode : * mut sys :: godot_method_bind , pub set_rotating : * mut sys :: godot_method_bind , pub set_screen_drawing_enabled : * mut sys :: godot_method_bind , pub set_v_drag_enabled : * mut sys :: godot_method_bind , pub set_v_offset : * mut sys :: godot_method_bind , pub set_zoom : * mut sys :: godot_method_bind } impl Camera2DMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : Camera2DMethodTable = Camera2DMethodTable { class_constructor : None , align : 0 as * mut sys :: godot_method_bind , clear_current : 0 as * mut sys :: godot_method_bind , force_update_scroll : 0 as * mut sys :: godot_method_bind , get_anchor_mode : 0 as * mut sys :: godot_method_bind , get_camera_position : 0 as * mut sys :: godot_method_bind , get_camera_screen_center : 0 as * mut sys :: godot_method_bind , get_custom_viewport : 0 as * mut sys :: godot_method_bind , get_drag_margin : 0 as * mut sys :: godot_method_bind , get_follow_smoothing : 0 as * mut sys :: godot_method_bind , get_h_offset : 0 as * mut sys :: godot_method_bind , get_limit : 0 as * mut sys :: godot_method_bind , get_offset : 0 as * mut sys :: godot_method_bind , get_process_mode : 0 as * mut sys :: godot_method_bind , get_v_offset : 0 as * mut sys :: godot_method_bind , get_zoom : 0 as * mut sys :: godot_method_bind , is_current : 0 as * mut sys :: godot_method_bind , is_follow_smoothing_enabled : 0 as * mut sys :: godot_method_bind , is_h_drag_enabled : 0 as * mut sys :: godot_method_bind , is_limit_drawing_enabled : 0 as * mut sys :: godot_method_bind , is_limit_smoothing_enabled : 0 as * mut sys :: godot_method_bind , is_margin_drawing_enabled : 0 as * mut sys :: godot_method_bind , is_rotating : 0 as * mut sys :: godot_method_bind , is_screen_drawing_enabled : 0 as * mut sys :: godot_method_bind , is_v_drag_enabled : 0 as * mut sys :: godot_method_bind , make_current : 0 as * mut sys :: godot_method_bind , reset_smoothing : 0 as * mut sys :: godot_method_bind , set_anchor_mode : 0 as * mut sys :: godot_method_bind , set_custom_viewport : 0 as * mut sys :: godot_method_bind , set_drag_margin : 0 as * mut sys :: godot_method_bind , set_enable_follow_smoothing : 0 as * mut sys :: godot_method_bind , set_follow_smoothing : 0 as * mut sys :: godot_method_bind , set_h_drag_enabled : 0 as * mut sys :: godot_method_bind , set_h_offset : 0 as * mut sys :: godot_method_bind , set_limit : 0 as * mut sys :: godot_method_bind , set_limit_drawing_enabled : 0 as * mut sys :: godot_method_bind , set_limit_smoothing_enabled : 0 as * mut sys :: godot_method_bind , set_margin_drawing_enabled : 0 as * mut sys :: godot_method_bind , set_offset : 0 as * mut sys :: godot_method_bind , set_process_mode : 0 as * mut sys :: godot_method_bind , set_rotating : 0 as * mut sys :: godot_method_bind , set_screen_drawing_enabled : 0 as * mut sys :: godot_method_bind , set_v_drag_enabled : 0 as * mut sys :: godot_method_bind , set_v_offset : 0 as * mut sys :: godot_method_bind , set_zoom : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { Camera2DMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "Camera2D\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . align = (gd_api . godot_method_bind_get_method) (class_name , "align\0" . as_ptr () as * const c_char) ; table . clear_current = (gd_api . godot_method_bind_get_method) (class_name , "clear_current\0" . as_ptr () as * const c_char) ; table . force_update_scroll = (gd_api . godot_method_bind_get_method) (class_name , "force_update_scroll\0" . as_ptr () as * const c_char) ; table . get_anchor_mode = (gd_api . godot_method_bind_get_method) (class_name , "get_anchor_mode\0" . as_ptr () as * const c_char) ; table . get_camera_position = (gd_api . godot_method_bind_get_method) (class_name , "get_camera_position\0" . as_ptr () as * const c_char) ; table . get_camera_screen_center = (gd_api . godot_method_bind_get_method) (class_name , "get_camera_screen_center\0" . as_ptr () as * const c_char) ; table . get_custom_viewport = (gd_api . godot_method_bind_get_method) (class_name , "get_custom_viewport\0" . as_ptr () as * const c_char) ; table . get_drag_margin = (gd_api . godot_method_bind_get_method) (class_name , "get_drag_margin\0" . as_ptr () as * const c_char) ; table . get_follow_smoothing = (gd_api . godot_method_bind_get_method) (class_name , "get_follow_smoothing\0" . as_ptr () as * const c_char) ; table . get_h_offset = (gd_api . godot_method_bind_get_method) (class_name , "get_h_offset\0" . as_ptr () as * const c_char) ; table . get_limit = (gd_api . godot_method_bind_get_method) (class_name , "get_limit\0" . as_ptr () as * const c_char) ; table . get_offset = (gd_api . godot_method_bind_get_method) (class_name , "get_offset\0" . as_ptr () as * const c_char) ; table . get_process_mode = (gd_api . godot_method_bind_get_method) (class_name , "get_process_mode\0" . as_ptr () as * const c_char) ; table . get_v_offset = (gd_api . godot_method_bind_get_method) (class_name , "get_v_offset\0" . as_ptr () as * const c_char) ; table . get_zoom = (gd_api . godot_method_bind_get_method) (class_name , "get_zoom\0" . as_ptr () as * const c_char) ; table . is_current = (gd_api . godot_method_bind_get_method) (class_name , "is_current\0" . as_ptr () as * const c_char) ; table . is_follow_smoothing_enabled = (gd_api . godot_method_bind_get_method) (class_name , "is_follow_smoothing_enabled\0" . as_ptr () as * const c_char) ; table . is_h_drag_enabled = (gd_api . godot_method_bind_get_method) (class_name , "is_h_drag_enabled\0" . as_ptr () as * const c_char) ; table . is_limit_drawing_enabled = (gd_api . godot_method_bind_get_method) (class_name , "is_limit_drawing_enabled\0" . as_ptr () as * const c_char) ; table . is_limit_smoothing_enabled = (gd_api . godot_method_bind_get_method) (class_name , "is_limit_smoothing_enabled\0" . as_ptr () as * const c_char) ; table . is_margin_drawing_enabled = (gd_api . godot_method_bind_get_method) (class_name , "is_margin_drawing_enabled\0" . as_ptr () as * const c_char) ; table . is_rotating = (gd_api . godot_method_bind_get_method) (class_name , "is_rotating\0" . as_ptr () as * const c_char) ; table . is_screen_drawing_enabled = (gd_api . godot_method_bind_get_method) (class_name , "is_screen_drawing_enabled\0" . as_ptr () as * const c_char) ; table . is_v_drag_enabled = (gd_api . godot_method_bind_get_method) (class_name , "is_v_drag_enabled\0" . as_ptr () as * const c_char) ; table . make_current = (gd_api . godot_method_bind_get_method) (class_name , "make_current\0" . as_ptr () as * const c_char) ; table . reset_smoothing = (gd_api . godot_method_bind_get_method) (class_name , "reset_smoothing\0" . as_ptr () as * const c_char) ; table . set_anchor_mode = (gd_api . godot_method_bind_get_method) (class_name , "set_anchor_mode\0" . as_ptr () as * const c_char) ; table . set_custom_viewport = (gd_api . godot_method_bind_get_method) (class_name , "set_custom_viewport\0" . as_ptr () as * const c_char) ; table . set_drag_margin = (gd_api . godot_method_bind_get_method) (class_name , "set_drag_margin\0" . as_ptr () as * const c_char) ; table . set_enable_follow_smoothing = (gd_api . godot_method_bind_get_method) (class_name , "set_enable_follow_smoothing\0" . as_ptr () as * const c_char) ; table . set_follow_smoothing = (gd_api . godot_method_bind_get_method) (class_name , "set_follow_smoothing\0" . as_ptr () as * const c_char) ; table . set_h_drag_enabled = (gd_api . godot_method_bind_get_method) (class_name , "set_h_drag_enabled\0" . as_ptr () as * const c_char) ; table . set_h_offset = (gd_api . godot_method_bind_get_method) (class_name , "set_h_offset\0" . as_ptr () as * const c_char) ; table . set_limit = (gd_api . godot_method_bind_get_method) (class_name , "set_limit\0" . as_ptr () as * const c_char) ; table . set_limit_drawing_enabled = (gd_api . godot_method_bind_get_method) (class_name , "set_limit_drawing_enabled\0" . as_ptr () as * const c_char) ; table . set_limit_smoothing_enabled = (gd_api . godot_method_bind_get_method) (class_name , "set_limit_smoothing_enabled\0" . as_ptr () as * const c_char) ; table . set_margin_drawing_enabled = (gd_api . godot_method_bind_get_method) (class_name , "set_margin_drawing_enabled\0" . as_ptr () as * const c_char) ; table . set_offset = (gd_api . godot_method_bind_get_method) (class_name , "set_offset\0" . as_ptr () as * const c_char) ; table . set_process_mode = (gd_api . godot_method_bind_get_method) (class_name , "set_process_mode\0" . as_ptr () as * const c_char) ; table . set_rotating = (gd_api . godot_method_bind_get_method) (class_name , "set_rotating\0" . as_ptr () as * const c_char) ; table . set_screen_drawing_enabled = (gd_api . godot_method_bind_get_method) (class_name , "set_screen_drawing_enabled\0" . as_ptr () as * const c_char) ; table . set_v_drag_enabled = (gd_api . godot_method_bind_get_method) (class_name , "set_v_drag_enabled\0" . as_ptr () as * const c_char) ; table . set_v_offset = (gd_api . godot_method_bind_get_method) (class_name , "set_v_offset\0" . as_ptr () as * const c_char) ; table . set_zoom = (gd_api . godot_method_bind_get_method) (class_name , "set_zoom\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:172:42531 [INFO] [stdout] | [INFO] [stdout] 172 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 172 | # [doc = "`core class CPUParticles2D` inherits `Node2D` (unsafe)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_cpuparticles2d.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nNon reference counted objects such as the ones of this type are usually owned by the engine.\n\n`CPUParticles2D` is a reference-only type. Persistent references can\nonly exist in the unsafe `Ref` form.\n\nIn the cases where Rust code owns an object of this type, for example if the object was just\ncreated on the Rust side and not passed to the engine yet, ownership should be either given\nto the engine or the object must be manually destroyed using `Ref::free`, or `Ref::queue_free`\nif it is a `Node`."] # [doc = "\n## Class hierarchy\n\nCPUParticles2D inherits methods from:\n - [Node2D](struct.Node2D.html)\n - [CanvasItem](struct.CanvasItem.html)\n - [Node](struct.Node.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct CPUParticles2D { this : RawObject < Self > , } # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct DrawOrder (pub i64) ; impl DrawOrder { pub const INDEX : DrawOrder = DrawOrder (0i64) ; pub const LIFETIME : DrawOrder = DrawOrder (1i64) ; } impl From < i64 > for DrawOrder { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < DrawOrder > for i64 { # [inline] fn from (v : DrawOrder) -> Self { v . 0 } } # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct EmissionShape (pub i64) ; impl EmissionShape { pub const POINT : EmissionShape = EmissionShape (0i64) ; pub const SPHERE : EmissionShape = EmissionShape (1i64) ; pub const RECTANGLE : EmissionShape = EmissionShape (2i64) ; pub const POINTS : EmissionShape = EmissionShape (3i64) ; pub const DIRECTED_POINTS : EmissionShape = EmissionShape (4i64) ; pub const MAX : EmissionShape = EmissionShape (5i64) ; } impl From < i64 > for EmissionShape { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < EmissionShape > for i64 { # [inline] fn from (v : EmissionShape) -> Self { v . 0 } } # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct Flags (pub i64) ; impl Flags { pub const ALIGN_Y_TO_VELOCITY : Flags = Flags (0i64) ; pub const ROTATE_Y : Flags = Flags (1i64) ; pub const DISABLE_Z : Flags = Flags (2i64) ; pub const MAX : Flags = Flags (3i64) ; } impl From < i64 > for Flags { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < Flags > for i64 { # [inline] fn from (v : Flags) -> Self { v . 0 } } # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct Parameter (pub i64) ; impl Parameter { pub const INITIAL_LINEAR_VELOCITY : Parameter = Parameter (0i64) ; pub const ANGULAR_VELOCITY : Parameter = Parameter (1i64) ; pub const ORBIT_VELOCITY : Parameter = Parameter (2i64) ; pub const LINEAR_ACCEL : Parameter = Parameter (3i64) ; pub const RADIAL_ACCEL : Parameter = Parameter (4i64) ; pub const TANGENTIAL_ACCEL : Parameter = Parameter (5i64) ; pub const DAMPING : Parameter = Parameter (6i64) ; pub const ANGLE : Parameter = Parameter (7i64) ; pub const SCALE : Parameter = Parameter (8i64) ; pub const HUE_VARIATION : Parameter = Parameter (9i64) ; pub const ANIM_SPEED : Parameter = Parameter (10i64) ; pub const ANIM_OFFSET : Parameter = Parameter (11i64) ; pub const MAX : Parameter = Parameter (12i64) ; } impl From < i64 > for Parameter { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < Parameter > for i64 { # [inline] fn from (v : Parameter) -> Self { v . 0 } } # [doc = "Constants"] # [allow (non_upper_case_globals)] impl CPUParticles2D { pub const DRAW_ORDER_INDEX : i64 = 0i64 ; pub const DRAW_ORDER_LIFETIME : i64 = 1i64 ; pub const EMISSION_SHAPE_DIRECTED_POINTS : i64 = 4i64 ; pub const EMISSION_SHAPE_MAX : i64 = 5i64 ; pub const EMISSION_SHAPE_POINT : i64 = 0i64 ; pub const EMISSION_SHAPE_POINTS : i64 = 3i64 ; pub const EMISSION_SHAPE_RECTANGLE : i64 = 2i64 ; pub const EMISSION_SHAPE_SPHERE : i64 = 1i64 ; pub const FLAG_ALIGN_Y_TO_VELOCITY : i64 = 0i64 ; pub const FLAG_DISABLE_Z : i64 = 2i64 ; pub const FLAG_MAX : i64 = 3i64 ; pub const FLAG_ROTATE_Y : i64 = 1i64 ; pub const PARAM_ANGLE : i64 = 7i64 ; pub const PARAM_ANGULAR_VELOCITY : i64 = 1i64 ; pub const PARAM_ANIM_OFFSET : i64 = 11i64 ; pub const PARAM_ANIM_SPEED : i64 = 10i64 ; pub const PARAM_DAMPING : i64 = 6i64 ; pub const PARAM_HUE_VARIATION : i64 = 9i64 ; pub const PARAM_INITIAL_LINEAR_VELOCITY : i64 = 0i64 ; pub const PARAM_LINEAR_ACCEL : i64 = 3i64 ; pub const PARAM_MAX : i64 = 12i64 ; pub const PARAM_ORBIT_VELOCITY : i64 = 2i64 ; pub const PARAM_RADIAL_ACCEL : i64 = 4i64 ; pub const PARAM_SCALE : i64 = 8i64 ; pub const PARAM_TANGENTIAL_ACCEL : i64 = 5i64 ; } impl CPUParticles2D { # [doc = "Creates a new instance of this object.\n\nBecause this type is not reference counted, the lifetime of the returned object\nis *not* automatically managed.\n\nImmediately after creation, the object is owned by the caller, and can be\npassed to the engine (in which case the engine will be responsible for\ndestroying the object) or destroyed manually using `Ref::free`, or preferably\n`Ref::queue_free` if it is a `Node`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = CPUParticles2DMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "Sets this node's properties to match a given [Particles2D] node with an assigned [ParticlesMaterial]."] # [doc = ""] # [inline] pub fn convert_from_particles (& self , particles : impl AsArg < crate :: generated :: node :: Node >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . convert_from_particles ; let ret = crate :: icalls :: icallptr_void_obj (method_bind , self . this . sys () . as_ptr () , particles . as_arg_ptr ()) ; } } # [doc = "Number of particles emitted in one emission cycle."] # [doc = ""] # [inline] pub fn amount (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . get_amount ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Each particle's initial color. If [member texture] is defined, it will be multiplied by this color."] # [doc = ""] # [inline] pub fn color (& self) -> Color { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . get_color ; let ret = crate :: icalls :: icallptr_color (method_bind , self . this . sys () . as_ptr ()) ; mem :: transmute (ret) } } # [doc = "Each particle's color will vary along this [Gradient]."] # [doc = ""] # [inline] pub fn color_ramp (& self) -> Option < Ref < crate :: generated :: gradient :: Gradient , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . get_color_ramp ; let ret = crate :: icalls :: icallptr_obj (method_bind , self . this . sys () . as_ptr ()) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: gradient :: Gradient , thread_access :: Shared >> :: move_from_sys (sys)) } } # [doc = "Unit vector specifying the particles' emission direction."] # [doc = ""] # [inline] pub fn direction (& self) -> Vector2 { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . get_direction ; let ret = crate :: icalls :: icallptr_vec2 (method_bind , self . this . sys () . as_ptr ()) ; mem :: transmute (ret) } } # [doc = "Particle draw order. Uses [enum DrawOrder] values."] # [doc = ""] # [inline] pub fn draw_order (& self) -> crate :: generated :: cpu_particles_2d :: DrawOrder { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . get_draw_order ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; crate :: generated :: cpu_particles_2d :: DrawOrder (ret) } } # [doc = "Sets the [Color]s to modulate particles by when using [constant EMISSION_SHAPE_POINTS] or [constant EMISSION_SHAPE_DIRECTED_POINTS]."] # [doc = ""] # [inline] pub fn emission_colors (& self) -> ColorArray { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . get_emission_colors ; let ret = crate :: icalls :: icallptr_colorarr (method_bind , self . this . sys () . as_ptr ()) ; ColorArray :: from_sys (ret) } } # [doc = "Sets the direction the particles will be emitted in when using [constant EMISSION_SHAPE_DIRECTED_POINTS]."] # [doc = ""] # [inline] pub fn emission_normals (& self) -> Vector2Array { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . get_emission_normals ; let ret = crate :: icalls :: icallptr_vec2arr (method_bind , self . this . sys () . as_ptr ()) ; Vector2Array :: from_sys (ret) } } # [doc = "Sets the initial positions to spawn particles when using [constant EMISSION_SHAPE_POINTS] or [constant EMISSION_SHAPE_DIRECTED_POINTS]."] # [doc = ""] # [inline] pub fn emission_points (& self) -> Vector2Array { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . get_emission_points ; let ret = crate :: icalls :: icallptr_vec2arr (method_bind , self . this . sys () . as_ptr ()) ; Vector2Array :: from_sys (ret) } } # [doc = "The rectangle's extents if [member emission_shape] is set to [constant EMISSION_SHAPE_RECTANGLE]."] # [doc = ""] # [inline] pub fn emission_rect_extents (& self) -> Vector2 { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . get_emission_rect_extents ; let ret = crate :: icalls :: icallptr_vec2 (method_bind , self . this . sys () . as_ptr ()) ; mem :: transmute (ret) } } # [doc = "Particles will be emitted inside this region. See [enum EmissionShape] for possible values."] # [doc = ""] # [inline] pub fn emission_shape (& self) -> crate :: generated :: cpu_particles_2d :: EmissionShape { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . get_emission_shape ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; crate :: generated :: cpu_particles_2d :: EmissionShape (ret) } } # [doc = "The sphere's radius if [member emission_shape] is set to [constant EMISSION_SHAPE_SPHERE]."] # [doc = ""] # [inline] pub fn emission_sphere_radius (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . get_emission_sphere_radius ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "How rapidly particles in an emission cycle are emitted. If greater than `0`, there will be a gap in emissions before the next cycle begins."] # [doc = ""] # [inline] pub fn explosiveness_ratio (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . get_explosiveness_ratio ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "The particle system's frame rate is fixed to a value. For instance, changing the value to 2 will make the particles render at 2 frames per second. Note this does not slow down the simulation of the particle system itself."] # [doc = ""] # [inline] pub fn fixed_fps (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . get_fixed_fps ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "If `true`, results in fractional delta calculation which has a smoother particles display effect."] # [doc = ""] # [inline] pub fn fractional_delta (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . get_fractional_delta ; let ret = crate :: icalls :: icallptr_bool (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Gravity applied to every particle."] # [doc = ""] # [inline] pub fn gravity (& self) -> Vector2 { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . get_gravity ; let ret = crate :: icalls :: icallptr_vec2 (method_bind , self . this . sys () . as_ptr ()) ; mem :: transmute (ret) } } # [doc = "Amount of time each particle will exist."] # [doc = ""] # [inline] pub fn lifetime (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . get_lifetime ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Particle lifetime randomness ratio."] # [doc = ""] # [inline] pub fn lifetime_randomness (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . get_lifetime_randomness ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Normal map to be used for the [member texture] property.\n**Note:** Godot expects the normal map to use X+, Y-, and Z+ coordinates. See [url=http://wiki.polycount.com/wiki/Normal_Map_Technical_Details#Common_Swizzle_Coordinates]this page[/url] for a comparison of normal map coordinates expected by popular engines."] # [doc = ""] # [inline] pub fn normalmap (& self) -> Option < Ref < crate :: generated :: texture :: Texture , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . get_normalmap ; let ret = crate :: icalls :: icallptr_obj (method_bind , self . this . sys () . as_ptr ()) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: texture :: Texture , thread_access :: Shared >> :: move_from_sys (sys)) } } # [doc = "If `true`, only one emission cycle occurs. If set `true` during a cycle, emission will stop at the cycle's end."] # [doc = ""] # [inline] pub fn one_shot (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . get_one_shot ; let ret = crate :: icalls :: icallptr_bool (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Tangential acceleration applied to each particle. Tangential acceleration is perpendicular to the particle's velocity giving the particles a swirling motion."] # [doc = ""] # [inline] pub fn param (& self , param : i64) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . get_param ; let ret = crate :: icalls :: icallptr_f64_i64 (method_bind , self . this . sys () . as_ptr () , param) ; ret as _ } } # [doc = "Each particle's tangential acceleration will vary along this [Curve]."] # [doc = ""] # [inline] pub fn param_curve (& self , param : i64) -> Option < Ref < crate :: generated :: curve :: Curve , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . get_param_curve ; let ret = crate :: icalls :: icallptr_obj_i64 (method_bind , self . this . sys () . as_ptr () , param) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: curve :: Curve , thread_access :: Shared >> :: move_from_sys (sys)) } } # [doc = "Tangential acceleration randomness ratio."] # [doc = ""] # [inline] pub fn param_randomness (& self , param : i64) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . get_param_randomness ; let ret = crate :: icalls :: icallptr_f64_i64 (method_bind , self . this . sys () . as_ptr () , param) ; ret as _ } } # [doc = "Align Y axis of particle with the direction of its velocity."] # [doc = ""] # [inline] pub fn particle_flag (& self , flag : i64) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . get_particle_flag ; let ret = crate :: icalls :: icallptr_bool_i64 (method_bind , self . this . sys () . as_ptr () , flag) ; ret as _ } } # [doc = "Particle system starts as if it had already run for this many seconds."] # [doc = ""] # [inline] pub fn pre_process_time (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . get_pre_process_time ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Emission lifetime randomness ratio."] # [doc = ""] # [inline] pub fn randomness_ratio (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . get_randomness_ratio ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Particle system's running speed scaling ratio. A value of `0` can be used to pause the particles."] # [doc = ""] # [inline] pub fn speed_scale (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . get_speed_scale ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Each particle's initial direction range from `+spread` to `-spread` degrees."] # [doc = ""] # [inline] pub fn spread (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . get_spread ; let ret = crate :: icalls :: icallptr_f64 (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Particle texture. If `null`, particles will be squares."] # [doc = ""] # [inline] pub fn texture (& self) -> Option < Ref < crate :: generated :: texture :: Texture , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . get_texture ; let ret = crate :: icalls :: icallptr_obj (method_bind , self . this . sys () . as_ptr ()) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: texture :: Texture , thread_access :: Shared >> :: move_from_sys (sys)) } } # [doc = "If `true`, particles use the parent node's coordinate space. If `false`, they use global coordinates."] # [doc = ""] # [inline] pub fn use_local_coordinates (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . get_use_local_coordinates ; let ret = crate :: icalls :: icallptr_bool (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "If `true`, particles are being emitted."] # [doc = ""] # [inline] pub fn is_emitting (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . is_emitting ; let ret = crate :: icalls :: icallptr_bool (method_bind , self . this . sys () . as_ptr ()) ; ret as _ } } # [doc = "Restarts the particle emitter."] # [doc = ""] # [inline] pub fn restart (& self) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . restart ; let ret = crate :: icalls :: icallptr_void (method_bind , self . this . sys () . as_ptr ()) ; } } # [doc = "Number of particles emitted in one emission cycle."] # [doc = ""] # [inline] pub fn set_amount (& self , amount : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . set_amount ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , amount) ; } } # [doc = "Each particle's initial color. If [member texture] is defined, it will be multiplied by this color."] # [doc = ""] # [inline] pub fn set_color (& self , color : Color) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . set_color ; let ret = crate :: icalls :: icallptr_void_color (method_bind , self . this . sys () . as_ptr () , color) ; } } # [doc = "Each particle's color will vary along this [Gradient]."] # [doc = ""] # [inline] pub fn set_color_ramp (& self , ramp : impl AsArg < crate :: generated :: gradient :: Gradient >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . set_color_ramp ; let ret = crate :: icalls :: icallptr_void_obj (method_bind , self . this . sys () . as_ptr () , ramp . as_arg_ptr ()) ; } } # [doc = "Unit vector specifying the particles' emission direction."] # [doc = ""] # [inline] pub fn set_direction (& self , direction : Vector2) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . set_direction ; let ret = crate :: icalls :: icallptr_void_vec2 (method_bind , self . this . sys () . as_ptr () , direction) ; } } # [doc = "Particle draw order. Uses [enum DrawOrder] values."] # [doc = ""] # [inline] pub fn set_draw_order (& self , order : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . set_draw_order ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , order) ; } } # [doc = "Sets the [Color]s to modulate particles by when using [constant EMISSION_SHAPE_POINTS] or [constant EMISSION_SHAPE_DIRECTED_POINTS]."] # [doc = ""] # [inline] pub fn set_emission_colors (& self , array : ColorArray) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . set_emission_colors ; let ret = crate :: icalls :: icallptr_void_colorarr (method_bind , self . this . sys () . as_ptr () , array) ; } } # [doc = "Sets the direction the particles will be emitted in when using [constant EMISSION_SHAPE_DIRECTED_POINTS]."] # [doc = ""] # [inline] pub fn set_emission_normals (& self , array : Vector2Array) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . set_emission_normals ; let ret = crate :: icalls :: icallptr_void_vec2arr (method_bind , self . this . sys () . as_ptr () , array) ; } } # [doc = "Sets the initial positions to spawn particles when using [constant EMISSION_SHAPE_POINTS] or [constant EMISSION_SHAPE_DIRECTED_POINTS]."] # [doc = ""] # [inline] pub fn set_emission_points (& self , array : Vector2Array) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . set_emission_points ; let ret = crate :: icalls :: icallptr_void_vec2arr (method_bind , self . this . sys () . as_ptr () , array) ; } } # [doc = "The rectangle's extents if [member emission_shape] is set to [constant EMISSION_SHAPE_RECTANGLE]."] # [doc = ""] # [inline] pub fn set_emission_rect_extents (& self , extents : Vector2) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . set_emission_rect_extents ; let ret = crate :: icalls :: icallptr_void_vec2 (method_bind , self . this . sys () . as_ptr () , extents) ; } } # [doc = "Particles will be emitted inside this region. See [enum EmissionShape] for possible values."] # [doc = ""] # [inline] pub fn set_emission_shape (& self , shape : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . set_emission_shape ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , shape) ; } } # [doc = "The sphere's radius if [member emission_shape] is set to [constant EMISSION_SHAPE_SPHERE]."] # [doc = ""] # [inline] pub fn set_emission_sphere_radius (& self , radius : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . set_emission_sphere_radius ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , radius) ; } } # [doc = "If `true`, particles are being emitted."] # [doc = ""] # [inline] pub fn set_emitting (& self , emitting : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . set_emitting ; let ret = crate :: icalls :: icallptr_void_bool (method_bind , self . this . sys () . as_ptr () , emitting) ; } } # [doc = "How rapidly particles in an emission cycle are emitted. If greater than `0`, there will be a gap in emissions before the next cycle begins."] # [doc = ""] # [inline] pub fn set_explosiveness_ratio (& self , ratio : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . set_explosiveness_ratio ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , ratio) ; } } # [doc = "The particle system's frame rate is fixed to a value. For instance, changing the value to 2 will make the particles render at 2 frames per second. Note this does not slow down the simulation of the particle system itself."] # [doc = ""] # [inline] pub fn set_fixed_fps (& self , fps : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . set_fixed_fps ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , fps) ; } } # [doc = "If `true`, results in fractional delta calculation which has a smoother particles display effect."] # [doc = ""] # [inline] pub fn set_fractional_delta (& self , enable : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . set_fractional_delta ; let ret = crate :: icalls :: icallptr_void_bool (method_bind , self . this . sys () . as_ptr () , enable) ; } } # [doc = "Gravity applied to every particle."] # [doc = ""] # [inline] pub fn set_gravity (& self , accel_vec : Vector2) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . set_gravity ; let ret = crate :: icalls :: icallptr_void_vec2 (method_bind , self . this . sys () . as_ptr () , accel_vec) ; } } # [doc = "Amount of time each particle will exist."] # [doc = ""] # [inline] pub fn set_lifetime (& self , secs : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . set_lifetime ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , secs) ; } } # [doc = "Particle lifetime randomness ratio."] # [doc = ""] # [inline] pub fn set_lifetime_randomness (& self , random : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . set_lifetime_randomness ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , random) ; } } # [doc = "Normal map to be used for the [member texture] property.\n**Note:** Godot expects the normal map to use X+, Y-, and Z+ coordinates. See [url=http://wiki.polycount.com/wiki/Normal_Map_Technical_Details#Common_Swizzle_Coordinates]this page[/url] for a comparison of normal map coordinates expected by popular engines."] # [doc = ""] # [inline] pub fn set_normalmap (& self , normalmap : impl AsArg < crate :: generated :: texture :: Texture >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . set_normalmap ; let ret = crate :: icalls :: icallptr_void_obj (method_bind , self . this . sys () . as_ptr () , normalmap . as_arg_ptr ()) ; } } # [doc = "If `true`, only one emission cycle occurs. If set `true` during a cycle, emission will stop at the cycle's end."] # [doc = ""] # [inline] pub fn set_one_shot (& self , enable : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . set_one_shot ; let ret = crate :: icalls :: icallptr_void_bool (method_bind , self . this . sys () . as_ptr () , enable) ; } } # [doc = "Tangential acceleration applied to each particle. Tangential acceleration is perpendicular to the particle's velocity giving the particles a swirling motion."] # [doc = ""] # [inline] pub fn set_param (& self , param : i64 , value : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . set_param ; let ret = crate :: icalls :: icallptr_void_i64_f64 (method_bind , self . this . sys () . as_ptr () , param , value) ; } } # [doc = "Each particle's tangential acceleration will vary along this [Curve]."] # [doc = ""] # [inline] pub fn set_param_curve (& self , param : i64 , curve : impl AsArg < crate :: generated :: curve :: Curve >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . set_param_curve ; let ret = crate :: icalls :: icallptr_void_i64_obj (method_bind , self . this . sys () . as_ptr () , param , curve . as_arg_ptr ()) ; } } # [doc = "Tangential acceleration randomness ratio."] # [doc = ""] # [inline] pub fn set_param_randomness (& self , param : i64 , randomness : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . set_param_randomness ; let ret = crate :: icalls :: icallptr_void_i64_f64 (method_bind , self . this . sys () . as_ptr () , param , randomness) ; } } # [doc = "Align Y axis of particle with the direction of its velocity."] # [doc = ""] # [inline] pub fn set_particle_flag (& self , flag : i64 , enable : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . set_particle_flag ; let ret = crate :: icalls :: icallptr_void_i64_bool (method_bind , self . this . sys () . as_ptr () , flag , enable) ; } } # [doc = "Particle system starts as if it had already run for this many seconds."] # [doc = ""] # [inline] pub fn set_pre_process_time (& self , secs : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . set_pre_process_time ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , secs) ; } } # [doc = "Emission lifetime randomness ratio."] # [doc = ""] # [inline] pub fn set_randomness_ratio (& self , ratio : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . set_randomness_ratio ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , ratio) ; } } # [doc = "Particle system's running speed scaling ratio. A value of `0` can be used to pause the particles."] # [doc = ""] # [inline] pub fn set_speed_scale (& self , scale : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . set_speed_scale ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , scale) ; } } # [doc = "Each particle's initial direction range from `+spread` to `-spread` degrees."] # [doc = ""] # [inline] pub fn set_spread (& self , degrees : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . set_spread ; let ret = crate :: icalls :: icallptr_void_f64 (method_bind , self . this . sys () . as_ptr () , degrees) ; } } # [doc = "Particle texture. If `null`, particles will be squares."] # [doc = ""] # [inline] pub fn set_texture (& self , texture : impl AsArg < crate :: generated :: texture :: Texture >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . set_texture ; let ret = crate :: icalls :: icallptr_void_obj (method_bind , self . this . sys () . as_ptr () , texture . as_arg_ptr ()) ; } } # [doc = "If `true`, particles use the parent node's coordinate space. If `false`, they use global coordinates."] # [doc = ""] # [inline] pub fn set_use_local_coordinates (& self , enable : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = CPUParticles2DMethodTable :: get (get_api ()) . set_use_local_coordinates ; let ret = crate :: icalls :: icallptr_void_bool (method_bind , self . this . sys () . as_ptr () , enable) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for CPUParticles2D { } unsafe impl GodotObject for CPUParticles2D { type RefKind = ref_kind :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "CPUParticles2D" } } impl QueueFree for CPUParticles2D { # [inline] unsafe fn godot_queue_free (obj : * mut sys :: godot_object) { let method_bind : * mut sys :: godot_method_bind = crate :: generated :: node :: NodeMethodTable :: get (get_api ()) . queue_free ; crate :: icalls :: icallptr_void (method_bind , obj) } } impl std :: ops :: Deref for CPUParticles2D { type Target = crate :: generated :: node_2d :: Node2D ; # [inline] fn deref (& self) -> & crate :: generated :: node_2d :: Node2D { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for CPUParticles2D { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: node_2d :: Node2D { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: node_2d :: Node2D > for CPUParticles2D { } unsafe impl SubClass < crate :: generated :: canvas_item :: CanvasItem > for CPUParticles2D { } unsafe impl SubClass < crate :: generated :: node :: Node > for CPUParticles2D { } unsafe impl SubClass < crate :: generated :: object :: Object > for CPUParticles2D { } impl Instanciable for CPUParticles2D { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { CPUParticles2D :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct CPUParticles2DMethodTable { pub class_constructor : sys :: godot_class_constructor , pub convert_from_particles : * mut sys :: godot_method_bind , pub get_amount : * mut sys :: godot_method_bind , pub get_color : * mut sys :: godot_method_bind , pub get_color_ramp : * mut sys :: godot_method_bind , pub get_direction : * mut sys :: godot_method_bind , pub get_draw_order : * mut sys :: godot_method_bind , pub get_emission_colors : * mut sys :: godot_method_bind , pub get_emission_normals : * mut sys :: godot_method_bind , pub get_emission_points : * mut sys :: godot_method_bind , pub get_emission_rect_extents : * mut sys :: godot_method_bind , pub get_emission_shape : * mut sys :: godot_method_bind , pub get_emission_sphere_radius : * mut sys :: godot_method_bind , pub get_explosiveness_ratio : * mut sys :: godot_method_bind , pub get_fixed_fps : * mut sys :: godot_method_bind , pub get_fractional_delta : * mut sys :: godot_method_bind , pub get_gravity : * mut sys :: godot_method_bind , pub get_lifetime : * mut sys :: godot_method_bind , pub get_lifetime_randomness : * mut sys :: godot_method_bind , pub get_normalmap : * mut sys :: godot_method_bind , pub get_one_shot : * mut sys :: godot_method_bind , pub get_param : * mut sys :: godot_method_bind , pub get_param_curve : * mut sys :: godot_method_bind , pub get_param_randomness : * mut sys :: godot_method_bind , pub get_particle_flag : * mut sys :: godot_method_bind , pub get_pre_process_time : * mut sys :: godot_method_bind , pub get_randomness_ratio : * mut sys :: godot_method_bind , pub get_speed_scale : * mut sys :: godot_method_bind , pub get_spread : * mut sys :: godot_method_bind , pub get_texture : * mut sys :: godot_method_bind , pub get_use_local_coordinates : * mut sys :: godot_method_bind , pub is_emitting : * mut sys :: godot_method_bind , pub restart : * mut sys :: godot_method_bind , pub set_amount : * mut sys :: godot_method_bind , pub set_color : * mut sys :: godot_method_bind , pub set_color_ramp : * mut sys :: godot_method_bind , pub set_direction : * mut sys :: godot_method_bind , pub set_draw_order : * mut sys :: godot_method_bind , pub set_emission_colors : * mut sys :: godot_method_bind , pub set_emission_normals : * mut sys :: godot_method_bind , pub set_emission_points : * mut sys :: godot_method_bind , pub set_emission_rect_extents : * mut sys :: godot_method_bind , pub set_emission_shape : * mut sys :: godot_method_bind , pub set_emission_sphere_radius : * mut sys :: godot_method_bind , pub set_emitting : * mut sys :: godot_method_bind , pub set_explosiveness_ratio : * mut sys :: godot_method_bind , pub set_fixed_fps : * mut sys :: godot_method_bind , pub set_fractional_delta : * mut sys :: godot_method_bind , pub set_gravity : * mut sys :: godot_method_bind , pub set_lifetime : * mut sys :: godot_method_bind , pub set_lifetime_randomness : * mut sys :: godot_method_bind , pub set_normalmap : * mut sys :: godot_method_bind , pub set_one_shot : * mut sys :: godot_method_bind , pub set_param : * mut sys :: godot_method_bind , pub set_param_curve : * mut sys :: godot_method_bind , pub set_param_randomness : * mut sys :: godot_method_bind , pub set_particle_flag : * mut sys :: godot_method_bind , pub set_pre_process_time : * mut sys :: godot_method_bind , pub set_randomness_ratio : * mut sys :: godot_method_bind , pub set_speed_scale : * mut sys :: godot_method_bind , pub set_spread : * mut sys :: godot_method_bind , pub set_texture : * mut sys :: godot_method_bind , pub set_use_local_coordinates : * mut sys :: godot_method_bind } impl CPUParticles2DMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : CPUParticles2DMethodTable = CPUParticles2DMethodTable { class_constructor : None , convert_from_particles : 0 as * mut sys :: godot_method_bind , get_amount : 0 as * mut sys :: godot_method_bind , get_color : 0 as * mut sys :: godot_method_bind , get_color_ramp : 0 as * mut sys :: godot_method_bind , get_direction : 0 as * mut sys :: godot_method_bind , get_draw_order : 0 as * mut sys :: godot_method_bind , get_emission_colors : 0 as * mut sys :: godot_method_bind , get_emission_normals : 0 as * mut sys :: godot_method_bind , get_emission_points : 0 as * mut sys :: godot_method_bind , get_emission_rect_extents : 0 as * mut sys :: godot_method_bind , get_emission_shape : 0 as * mut sys :: godot_method_bind , get_emission_sphere_radius : 0 as * mut sys :: godot_method_bind , get_explosiveness_ratio : 0 as * mut sys :: godot_method_bind , get_fixed_fps : 0 as * mut sys :: godot_method_bind , get_fractional_delta : 0 as * mut sys :: godot_method_bind , get_gravity : 0 as * mut sys :: godot_method_bind , get_lifetime : 0 as * mut sys :: godot_method_bind , get_lifetime_randomness : 0 as * mut sys :: godot_method_bind , get_normalmap : 0 as * mut sys :: godot_method_bind , get_one_shot : 0 as * mut sys :: godot_method_bind , get_param : 0 as * mut sys :: godot_method_bind , get_param_curve : 0 as * mut sys :: godot_method_bind , get_param_randomness : 0 as * mut sys :: godot_method_bind , get_particle_flag : 0 as * mut sys :: godot_method_bind , get_pre_process_time : 0 as * mut sys :: godot_method_bind , get_randomness_ratio : 0 as * mut sys :: godot_method_bind , get_speed_scale : 0 as * mut sys :: godot_method_bind , get_spread : 0 as * mut sys :: godot_method_bind , get_texture : 0 as * mut sys :: godot_method_bind , get_use_local_coordinates : 0 as * mut sys :: godot_method_bind , is_emitting : 0 as * mut sys :: godot_method_bind , restart : 0 as * mut sys :: godot_method_bind , set_amount : 0 as * mut sys :: godot_method_bind , set_color : 0 as * mut sys :: godot_method_bind , set_color_ramp : 0 as * mut sys :: godot_method_bind , set_direction : 0 as * mut sys :: godot_method_bind , set_draw_order : 0 as * mut sys :: godot_method_bind , set_emission_colors : 0 as * mut sys :: godot_method_bind , set_emission_normals : 0 as * mut sys :: godot_method_bind , set_emission_points : 0 as * mut sys :: godot_method_bind , set_emission_rect_extents : 0 as * mut sys :: godot_method_bind , set_emission_shape : 0 as * mut sys :: godot_method_bind , set_emission_sphere_radius : 0 as * mut sys :: godot_method_bind , set_emitting : 0 as * mut sys :: godot_method_bind , set_explosiveness_ratio : 0 as * mut sys :: godot_method_bind , set_fixed_fps : 0 as * mut sys :: godot_method_bind , set_fractional_delta : 0 as * mut sys :: godot_method_bind , set_gravity : 0 as * mut sys :: godot_method_bind , set_lifetime : 0 as * mut sys :: godot_method_bind , set_lifetime_randomness : 0 as * mut sys :: godot_method_bind , set_normalmap : 0 as * mut sys :: godot_method_bind , set_one_shot : 0 as * mut sys :: godot_method_bind , set_param : 0 as * mut sys :: godot_method_bind , set_param_curve : 0 as * mut sys :: godot_method_bind , set_param_randomness : 0 as * mut sys :: godot_method_bind , set_particle_flag : 0 as * mut sys :: godot_method_bind , set_pre_process_time : 0 as * mut sys :: godot_method_bind , set_randomness_ratio : 0 as * mut sys :: godot_method_bind , set_speed_scale : 0 as * mut sys :: godot_method_bind , set_spread : 0 as * mut sys :: godot_method_bind , set_texture : 0 as * mut sys :: godot_method_bind , set_use_local_coordinates : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { CPUParticles2DMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "CPUParticles2D\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . convert_from_particles = (gd_api . godot_method_bind_get_method) (class_name , "convert_from_particles\0" . as_ptr () as * const c_char) ; table . get_amount = (gd_api . godot_method_bind_get_method) (class_name , "get_amount\0" . as_ptr () as * const c_char) ; table . get_color = (gd_api . godot_method_bind_get_method) (class_name , "get_color\0" . as_ptr () as * const c_char) ; table . get_color_ramp = (gd_api . godot_method_bind_get_method) (class_name , "get_color_ramp\0" . as_ptr () as * const c_char) ; table . get_direction = (gd_api . godot_method_bind_get_method) (class_name , "get_direction\0" . as_ptr () as * const c_char) ; table . get_draw_order = (gd_api . godot_method_bind_get_method) (class_name , "get_draw_order\0" . as_ptr () as * const c_char) ; table . get_emission_colors = (gd_api . godot_method_bind_get_method) (class_name , "get_emission_colors\0" . as_ptr () as * const c_char) ; table . get_emission_normals = (gd_api . godot_method_bind_get_method) (class_name , "get_emission_normals\0" . as_ptr () as * const c_char) ; table . get_emission_points = (gd_api . godot_method_bind_get_method) (class_name , "get_emission_points\0" . as_ptr () as * const c_char) ; table . get_emission_rect_extents = (gd_api . godot_method_bind_get_method) (class_name , "get_emission_rect_extents\0" . as_ptr () as * const c_char) ; table . get_emission_shape = (gd_api . godot_method_bind_get_method) (class_name , "get_emission_shape\0" . as_ptr () as * const c_char) ; table . get_emission_sphere_radius = (gd_api . godot_method_bind_get_method) (class_name , "get_emission_sphere_radius\0" . as_ptr () as * const c_char) ; table . get_explosiveness_ratio = (gd_api . godot_method_bind_get_method) (class_name , "get_explosiveness_ratio\0" . as_ptr () as * const c_char) ; table . get_fixed_fps = (gd_api . godot_method_bind_get_method) (class_name , "get_fixed_fps\0" . as_ptr () as * const c_char) ; table . get_fractional_delta = (gd_api . godot_method_bind_get_method) (class_name , "get_fractional_delta\0" . as_ptr () as * const c_char) ; table . get_gravity = (gd_api . godot_method_bind_get_method) (class_name , "get_gravity\0" . as_ptr () as * const c_char) ; table . get_lifetime = (gd_api . godot_method_bind_get_method) (class_name , "get_lifetime\0" . as_ptr () as * const c_char) ; table . get_lifetime_randomness = (gd_api . godot_method_bind_get_method) (class_name , "get_lifetime_randomness\0" . as_ptr () as * const c_char) ; table . get_normalmap = (gd_api . godot_method_bind_get_method) (class_name , "get_normalmap\0" . as_ptr () as * const c_char) ; table . get_one_shot = (gd_api . godot_method_bind_get_method) (class_name , "get_one_shot\0" . as_ptr () as * const c_char) ; table . get_param = (gd_api . godot_method_bind_get_method) (class_name , "get_param\0" . as_ptr () as * const c_char) ; table . get_param_curve = (gd_api . godot_method_bind_get_method) (class_name , "get_param_curve\0" . as_ptr () as * const c_char) ; table . get_param_randomness = (gd_api . godot_method_bind_get_method) (class_name , "get_param_randomness\0" . as_ptr () as * const c_char) ; table . get_particle_flag = (gd_api . godot_method_bind_get_method) (class_name , "get_particle_flag\0" . as_ptr () as * const c_char) ; table . get_pre_process_time = (gd_api . godot_method_bind_get_method) (class_name , "get_pre_process_time\0" . as_ptr () as * const c_char) ; table . get_randomness_ratio = (gd_api . godot_method_bind_get_method) (class_name , "get_randomness_ratio\0" . as_ptr () as * const c_char) ; table . get_speed_scale = (gd_api . godot_method_bind_get_method) (class_name , "get_speed_scale\0" . as_ptr () as * const c_char) ; table . get_spread = (gd_api . godot_method_bind_get_method) (class_name , "get_spread\0" . as_ptr () as * const c_char) ; table . get_texture = (gd_api . godot_method_bind_get_method) (class_name , "get_texture\0" . as_ptr () as * const c_char) ; table . get_use_local_coordinates = (gd_api . godot_method_bind_get_method) (class_name , "get_use_local_coordinates\0" . as_ptr () as * const c_char) ; table . is_emitting = (gd_api . godot_method_bind_get_method) (class_name , "is_emitting\0" . as_ptr () as * const c_char) ; table . restart = (gd_api . godot_method_bind_get_method) (class_name , "restart\0" . as_ptr () as * const c_char) ; table . set_amount = (gd_api . godot_method_bind_get_method) (class_name , "set_amount\0" . as_ptr () as * const c_char) ; table . set_color = (gd_api . godot_method_bind_get_method) (class_name , "set_color\0" . as_ptr () as * const c_char) ; table . set_color_ramp = (gd_api . godot_method_bind_get_method) (class_name , "set_color_ramp\0" . as_ptr () as * const c_char) ; table . set_direction = (gd_api . godot_method_bind_get_method) (class_name , "set_direction\0" . as_ptr () as * const c_char) ; table . set_draw_order = (gd_api . godot_method_bind_get_method) (class_name , "set_draw_order\0" . as_ptr () as * const c_char) ; table . set_emission_colors = (gd_api . godot_method_bind_get_method) (class_name , "set_emission_colors\0" . as_ptr () as * const c_char) ; table . set_emission_normals = (gd_api . godot_method_bind_get_method) (class_name , "set_emission_normals\0" . as_ptr () as * const c_char) ; table . set_emission_points = (gd_api . godot_method_bind_get_method) (class_name , "set_emission_points\0" . as_ptr () as * const c_char) ; table . set_emission_rect_extents = (gd_api . godot_method_bind_get_method) (class_name , "set_emission_rect_extents\0" . as_ptr () as * const c_char) ; table . set_emission_shape = (gd_api . godot_method_bind_get_method) (class_name , "set_emission_shape\0" . as_ptr () as * const c_char) ; table . set_emission_sphere_radius = (gd_api . godot_method_bind_get_method) (class_name , "set_emission_sphere_radius\0" . as_ptr () as * const c_char) ; table . set_emitting = (gd_api . godot_method_bind_get_method) (class_name , "set_emitting\0" . as_ptr () as * const c_char) ; table . set_explosiveness_ratio = (gd_api . godot_method_bind_get_method) (class_name , "set_explosiveness_ratio\0" . as_ptr () as * const c_char) ; table . set_fixed_fps = (gd_api . godot_method_bind_get_method) (class_name , "set_fixed_fps\0" . as_ptr () as * const c_char) ; table . set_fractional_delta = (gd_api . godot_method_bind_get_method) (class_name , "set_fractional_delta\0" . as_ptr () as * const c_char) ; table . set_gravity = (gd_api . godot_method_bind_get_method) (class_name , "set_gravity\0" . as_ptr () as * const c_char) ; table . set_lifetime = (gd_api . godot_method_bind_get_method) (class_name , "set_lifetime\0" . as_ptr () as * const c_char) ; table . set_lifetime_randomness = (gd_api . godot_method_bind_get_method) (class_name , "set_lifetime_randomness\0" . as_ptr () as * const c_char) ; table . set_normalmap = (gd_api . godot_method_bind_get_method) (class_name , "set_normalmap\0" . as_ptr () as * const c_char) ; table . set_one_shot = (gd_api . godot_method_bind_get_method) (class_name , "set_one_shot\0" . as_ptr () as * const c_char) ; table . set_param = (gd_api . godot_method_bind_get_method) (class_name , "set_param\0" . as_ptr () as * const c_char) ; table . set_param_curve = (gd_api . godot_method_bind_get_method) (class_name , "set_param_curve\0" . as_ptr () as * const c_char) ; table . set_param_randomness = (gd_api . godot_method_bind_get_method) (class_name , "set_param_randomness\0" . as_ptr () as * const c_char) ; table . set_particle_flag = (gd_api . godot_method_bind_get_method) (class_name , "set_particle_flag\0" . as_ptr () as * const c_char) ; table . set_pre_process_time = (gd_api . godot_method_bind_get_method) (class_name , "set_pre_process_time\0" . as_ptr () as * const c_char) ; table . set_randomness_ratio = (gd_api . godot_method_bind_get_method) (class_name , "set_randomness_ratio\0" . as_ptr () as * const c_char) ; table . set_speed_scale = (gd_api . godot_method_bind_get_method) (class_name , "set_speed_scale\0" . as_ptr () as * const c_char) ; table . set_spread = (gd_api . godot_method_bind_get_method) (class_name , "set_spread\0" . as_ptr () as * const c_char) ; table . set_texture = (gd_api . godot_method_bind_get_method) (class_name , "set_texture\0" . as_ptr () as * const c_char) ; table . set_use_local_coordinates = (gd_api . godot_method_bind_get_method) (class_name , "set_use_local_coordinates\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:556:5753 [INFO] [stdout] | [INFO] [stdout] 556 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 556 | # [doc = "`core class VisualShaderNodeTransformVecMult` inherits `VisualShaderNode` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_visualshadernodetransformvecmult.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nVisualShaderNodeTransformVecMult inherits methods from:\n - [VisualShaderNode](struct.VisualShaderNode.html)\n - [Resource](struct.Resource.html)\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct VisualShaderNodeTransformVecMult { this : RawObject < Self > , } # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct Operator (pub i64) ; impl Operator { pub const AXB : Operator = Operator (0i64) ; pub const BXA : Operator = Operator (1i64) ; pub const _3X3_AXB : Operator = Operator (2i64) ; pub const _3X3_BXA : Operator = Operator (3i64) ; } impl From < i64 > for Operator { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < Operator > for i64 { # [inline] fn from (v : Operator) -> Self { v . 0 } } # [doc = "Constants"] # [allow (non_upper_case_globals)] impl VisualShaderNodeTransformVecMult { pub const OP_3x3_AxB : i64 = 2i64 ; pub const OP_3x3_BxA : i64 = 3i64 ; pub const OP_AxB : i64 = 0i64 ; pub const OP_BxA : i64 = 1i64 ; } impl VisualShaderNodeTransformVecMult { # [doc = "Creates a new instance of this object.\n\nThis is a reference-counted type. The returned object is automatically managed\nby `Ref`."] # [inline] pub fn new () -> Ref < Self , thread_access :: Unique > { unsafe { let gd_api = get_api () ; let ctor = VisualShaderNodeTransformVecMultMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "The multiplication type to be performed. See [enum Operator] for options."] # [doc = ""] # [inline] pub fn operator (& self) -> crate :: generated :: visual_shader_node_transform_vec_mult :: Operator { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualShaderNodeTransformVecMultMethodTable :: get (get_api ()) . get_operator ; let ret = crate :: icalls :: icallptr_i64 (method_bind , self . this . sys () . as_ptr ()) ; crate :: generated :: visual_shader_node_transform_vec_mult :: Operator (ret) } } # [doc = "The multiplication type to be performed. See [enum Operator] for options."] # [doc = ""] # [inline] pub fn set_operator (& self , op : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = VisualShaderNodeTransformVecMultMethodTable :: get (get_api ()) . set_operator ; let ret = crate :: icalls :: icallptr_void_i64 (method_bind , self . this . sys () . as_ptr () , op) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for VisualShaderNodeTransformVecMult { } unsafe impl GodotObject for VisualShaderNodeTransformVecMult { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "VisualShaderNodeTransformVecMult" } } impl std :: ops :: Deref for VisualShaderNodeTransformVecMult { type Target = crate :: generated :: visual_shader_node :: VisualShaderNode ; # [inline] fn deref (& self) -> & crate :: generated :: visual_shader_node :: VisualShaderNode { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for VisualShaderNodeTransformVecMult { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: visual_shader_node :: VisualShaderNode { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: visual_shader_node :: VisualShaderNode > for VisualShaderNodeTransformVecMult { } unsafe impl SubClass < crate :: generated :: resource :: Resource > for VisualShaderNodeTransformVecMult { } unsafe impl SubClass < crate :: generated :: reference :: Reference > for VisualShaderNodeTransformVecMult { } unsafe impl SubClass < crate :: generated :: object :: Object > for VisualShaderNodeTransformVecMult { } impl Instanciable for VisualShaderNodeTransformVecMult { # [inline] fn construct () -> Ref < Self , thread_access :: Unique > { VisualShaderNodeTransformVecMult :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct VisualShaderNodeTransformVecMultMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_operator : * mut sys :: godot_method_bind , pub set_operator : * mut sys :: godot_method_bind } impl VisualShaderNodeTransformVecMultMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : VisualShaderNodeTransformVecMultMethodTable = VisualShaderNodeTransformVecMultMethodTable { class_constructor : None , get_operator : 0 as * mut sys :: godot_method_bind , set_operator : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { VisualShaderNodeTransformVecMultMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "VisualShaderNodeTransformVecMult\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_operator = (gd_api . godot_method_bind_get_method) (class_name , "get_operator\0" . as_ptr () as * const c_char) ; table . set_operator = (gd_api . godot_method_bind_get_method) (class_name , "set_operator\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:178:4537 [INFO] [stdout] | [INFO] [stdout] 178 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 178 | # [doc = "`core class WebSocketMultiplayerPeer` inherits `NetworkedMultiplayerPeer` (reference counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_websocketmultiplayerpeer.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nThe lifetime of this object is automatically managed through reference counting."] # [doc = "\n## Class hierarchy\n\nWebSocketMultiplayerPeer inherits methods from:\n - [NetworkedMultiplayerPeer](struct.NetworkedMultiplayerPeer.html)\n - [PacketPeer](struct.PacketPeer.html)\n - [Reference](struct.Reference.html)\n - [Object](struct.Object.html)\n"] # [doc = ""] # [doc = "\n## Safety\n\nAll types in the Godot API have \"interior mutability\" in Rust parlance.\nTo enforce that the official [thread-safety guidelines][thread-safety] are\nfollowed, the typestate pattern is used in the `Ref` and `TRef` smart pointers,\nand the `Instance` API. The typestate `Access` in these types tracks whether the\naccess is unique, shared, or exclusive to the current thread. For more information,\nsee the type-level documentation on `Ref`.\n\n[thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html"] # [allow (non_camel_case_types)] # [derive (Debug)] pub struct WebSocketMultiplayerPeer { this : RawObject < Self > , } impl WebSocketMultiplayerPeer { # [doc = ""] # [doc = ""] # [inline] pub fn get_peer (& self , peer_id : i64) -> Option < Ref < crate :: generated :: web_socket_peer :: WebSocketPeer , thread_access :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = WebSocketMultiplayerPeerMethodTable :: get (get_api ()) . get_peer ; let ret = crate :: icalls :: icallptr_obj_i64 (method_bind , self . this . sys () . as_ptr () , peer_id) ; ptr :: NonNull :: new (ret) . map (| sys | < Ref < crate :: generated :: web_socket_peer :: WebSocketPeer , thread_access :: Shared >> :: move_from_sys (sys)) } } # [doc = ""] # [doc = ""] # [inline] pub fn set_buffers (& self , input_buffer_size_kb : i64 , input_max_packets : i64 , output_buffer_size_kb : i64 , output_max_packets : i64) -> GodotResult { unsafe { let method_bind : * mut sys :: godot_method_bind = WebSocketMultiplayerPeerMethodTable :: get (get_api ()) . set_buffers ; let ret = crate :: icalls :: icallptr_i64_i64_i64_i64_i64 (method_bind , self . this . sys () . as_ptr () , input_buffer_size_kb , input_max_packets , output_buffer_size_kb , output_max_packets) ; GodotError :: result_from_sys (ret as _) } } } impl gdnative_core :: private :: godot_object :: Sealed for WebSocketMultiplayerPeer { } unsafe impl GodotObject for WebSocketMultiplayerPeer { type RefKind = ref_kind :: RefCounted ; # [inline] fn class_name () -> & 'static str { "WebSocketMultiplayerPeer" } } impl std :: ops :: Deref for WebSocketMultiplayerPeer { type Target = crate :: generated :: networked_multiplayer_peer :: NetworkedMultiplayerPeer ; # [inline] fn deref (& self) -> & crate :: generated :: networked_multiplayer_peer :: NetworkedMultiplayerPeer { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for WebSocketMultiplayerPeer { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: networked_multiplayer_peer :: NetworkedMultiplayerPeer { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: networked_multiplayer_peer :: NetworkedMultiplayerPeer > for WebSocketMultiplayerPeer { } unsafe impl SubClass < crate :: generated :: packet_peer :: PacketPeer > for WebSocketMultiplayerPeer { } unsafe impl SubClass < crate :: generated :: reference :: Reference > for WebSocketMultiplayerPeer { } unsafe impl SubClass < crate :: generated :: object :: Object > for WebSocketMultiplayerPeer { } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct WebSocketMultiplayerPeerMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_peer : * mut sys :: godot_method_bind , pub set_buffers : * mut sys :: godot_method_bind } impl WebSocketMultiplayerPeerMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : WebSocketMultiplayerPeerMethodTable = WebSocketMultiplayerPeerMethodTable { class_constructor : None , get_peer : 0 as * mut sys :: godot_method_bind , set_buffers : 0 as * mut sys :: godot_method_bind } ; addr_of_mut!(TABLE) } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'static Self { unsafe { let table = Self :: get_mut () ; static INIT : :: std :: sync :: Once = Once :: new () ; INIT . call_once (|| { WebSocketMultiplayerPeerMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "WebSocketMultiplayerPeer\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_peer = (gd_api . godot_method_bind_get_method) (class_name , "get_peer\0" . as_ptr () as * const c_char) ; table . set_buffers = (gd_api . godot_method_bind_get_method) (class_name , "set_buffers\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | ~~~~~~~~~~~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> /opt/rustwide/target/debug/build/gdnative-bindings-lily-d08fa740744aeb2e/out/generated.rs:562:11390 [INFO] [stdout] | [INFO] [stdout] 562 | ... : 0 as * mut sys :: godot_method_bind } ; & mut TABLE } # [inline] # [allow (dead_code)] pub fn get (gd_api : & GodotApi) -> & 'stati... [INFO] [stdout] | ^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see issue #114447 [INFO] [stdout] = note: this will be a hard error in the 2024 edition [INFO] [stdout] = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior [INFO] [stdout] help: use `addr_of_mut!` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 562 | # [doc = "`core class Button` inherits `BaseButton` (unsafe)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/latest/classes/class_button.html) in the Godot engine's official documentation.\nThe method descriptions are generated from it and typically contain code samples in GDScript, not Rust."] # [doc = "## Memory management\n\nNon reference counted objects such as the ones of this type are usually owned by the engine.\n\n`Button` is a reference-only type. Persistent references can\nonly exist in the unsafe `Ref