[INFO] fetching crate gdnative-bindings 0.11.3... [INFO] testing gdnative-bindings-0.11.3 against try#8de4c7234dd9b97c9d76b58671343fdbbc9a433e+target=x86_64-unknown-linux-musl for musl_upgrade_1_2_5_with_libc_patch_0 [INFO] extracting crate gdnative-bindings 0.11.3 into /workspace/builds/worker-6-tc1/source [INFO] started tweaking crates.io crate gdnative-bindings 0.11.3 [INFO] finished tweaking crates.io crate gdnative-bindings 0.11.3 [INFO] tweaked toml for crates.io crate gdnative-bindings 0.11.3 written to /workspace/builds/worker-6-tc1/source/Cargo.toml [INFO] validating manifest of crates.io crate gdnative-bindings 0.11.3 on toolchain 8de4c7234dd9b97c9d76b58671343fdbbc9a433e [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+8de4c7234dd9b97c9d76b58671343fdbbc9a433e" "metadata" "--manifest-path" "Cargo.toml" "--no-deps", kill_on_drop: false }` [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+8de4c7234dd9b97c9d76b58671343fdbbc9a433e" "generate-lockfile" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Updating crates.io index [INFO] [stderr] Locking 95 packages to latest compatible versions [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+8de4c7234dd9b97c9d76b58671343fdbbc9a433e" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded gdnative_bindings_generator v0.11.3 [INFO] [stderr] Downloaded gdnative-impl-proc-macros v0.11.3 [INFO] [stderr] Downloaded gdnative-derive v0.11.3 [INFO] [stderr] Downloaded roxmltree v0.17.0 [INFO] [stderr] Downloaded gdnative-core v0.11.3 [INFO] [stderr] Downloaded gdnative-sys v0.11.3 [INFO] [stderr] Downloaded glam v0.22.0 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-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:90999bfc7ae267e83380e433d8e61a7c072ca6729e92edbae886d3423b3a6f4c" "/opt/rustwide/cargo-home/bin/cargo" "+8de4c7234dd9b97c9d76b58671343fdbbc9a433e" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] b925fcc43dba7ee4938f58afb285d18117b9b6602f822b64402a88abd809336a [INFO] running `Command { std: "docker" "start" "-a" "b925fcc43dba7ee4938f58afb285d18117b9b6602f822b64402a88abd809336a", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "b925fcc43dba7ee4938f58afb285d18117b9b6602f822b64402a88abd809336a", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "b925fcc43dba7ee4938f58afb285d18117b9b6602f822b64402a88abd809336a", kill_on_drop: false }` [INFO] [stdout] b925fcc43dba7ee4938f58afb285d18117b9b6602f822b64402a88abd809336a [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-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:90999bfc7ae267e83380e433d8e61a7c072ca6729e92edbae886d3423b3a6f4c" "/opt/rustwide/cargo-home/bin/cargo" "+8de4c7234dd9b97c9d76b58671343fdbbc9a433e" "build" "--frozen" "--message-format=json" "--target" "x86_64-unknown-linux-musl", kill_on_drop: false }` [INFO] [stdout] 029a4ae1748bc101b741703e091d174f1b060e63563948e299c895255e9ae178 [INFO] running `Command { std: "docker" "start" "-a" "029a4ae1748bc101b741703e091d174f1b060e63563948e299c895255e9ae178", kill_on_drop: false }` [INFO] [stderr] Compiling syn v1.0.109 [INFO] [stderr] Compiling regex-syntax v0.8.5 [INFO] [stderr] Compiling itoa v1.0.15 [INFO] [stderr] Compiling ryu v1.0.20 [INFO] [stderr] Compiling bindgen v0.63.0 [INFO] [stderr] Compiling bitflags v1.3.2 [INFO] [stderr] Compiling lazycell v1.3.0 [INFO] [stderr] Compiling libc v0.2.174 [INFO] [stderr] Compiling peeking_take_while v0.1.2 [INFO] [stderr] Compiling syn v2.0.104 [INFO] [stderr] Compiling lazy_static v1.5.0 [INFO] [stderr] Compiling xmlparser v0.13.6 [INFO] [stderr] Compiling winnow v0.5.40 [INFO] [stderr] Compiling toml_datetime v0.6.11 [INFO] [stderr] Compiling getrandom v0.3.3 [INFO] [stderr] Compiling ahash v0.8.12 [INFO] [stderr] Compiling indexmap v1.9.3 [INFO] [stderr] Compiling unindent v0.2.4 [INFO] [stderr] Compiling approx v0.5.1 [INFO] [stderr] Compiling atomic-take v1.1.0 [INFO] [stderr] Compiling glam v0.22.0 [INFO] [stderr] Compiling roxmltree v0.17.0 [INFO] [stderr] Compiling clang-sys v1.8.1 [INFO] [stderr] Compiling regex-automata v0.4.9 [INFO] [stderr] Compiling toml_edit v0.19.15 [INFO] [stderr] Compiling regex v1.11.1 [INFO] [stderr] Compiling mini-internal v0.1.42 [INFO] [stderr] Compiling proc-macro-crate v1.3.1 [INFO] [stderr] Compiling miniserde v0.1.42 [INFO] [stderr] Compiling gdnative_bindings_generator v0.11.3 [INFO] [stderr] Compiling gdnative-impl-proc-macros v0.11.3 [INFO] [stderr] Compiling gdnative-derive v0.11.3 [INFO] [stderr] Compiling gdnative-bindings v0.11.3 (/opt/rustwide/workdir) [INFO] [stderr] Compiling gdnative-sys v0.11.3 [INFO] [stderr] Compiling gdnative-core v0.11.3 [INFO] [stdout] warning: creating a mutable reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:9:7203 [INFO] [stdout] | [INFO] [stdout] 9 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] = note: `#[warn(static_mut_refs)]` on by default [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 9 | # ! [doc = "This module contains types related to the API class [`AESContext`][super::AESContext]."] pub (crate) mod private { # [doc = "`core class AESContext` inherits `Reference` (reference-counted).\n\nThis class has related types in the [`aes_context`][super::aes_context] module."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_aescontext.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\nAESContext 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 `Ownership` in these types tracks whether\nownership 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 AESContext { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AESContext ; # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct Mode (pub i64) ; impl Mode { pub const ECB_ENCRYPT : Mode = Mode (0i64) ; pub const ECB_DECRYPT : Mode = Mode (1i64) ; pub const CBC_ENCRYPT : Mode = Mode (2i64) ; pub const CBC_DECRYPT : Mode = Mode (3i64) ; pub const MAX : 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 } } impl FromVariant for Mode { # [inline] fn from_variant (v : & Variant) -> Result < Self , FromVariantError > { i64 :: from_variant (v) . map (Self :: from) } } # [doc = "Constants"] # [allow (non_upper_case_globals)] impl AESContext { pub const MODE_ECB_ENCRYPT : i64 = 0i64 ; pub const MODE_ECB_DECRYPT : i64 = 1i64 ; pub const MODE_CBC_ENCRYPT : i64 = 2i64 ; pub const MODE_CBC_DECRYPT : i64 = 3i64 ; pub const MODE_MAX : i64 = 4i64 ; } impl AESContext { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AESContextMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "Close this AES context so it can be started again. See [`start`][Self::start]."] # [doc = ""] # [inline] pub fn finish (& self) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AESContextMethodTable :: get (get_api ()) . finish ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; } } # [doc = "Get the current IV state for this context (IV gets updated when calling [`update`][Self::update]). You normally don't need this function.\n**Note:** This function only makes sense when the context is started with [`MODE_CBC_ENCRYPT`][Self::MODE_CBC_ENCRYPT] or [`MODE_CBC_DECRYPT`][Self::MODE_CBC_DECRYPT]."] # [doc = ""] # [inline] pub fn get_iv_state (& self) -> PoolArray < u8 > { unsafe { let method_bind : * mut sys :: godot_method_bind = AESContextMethodTable :: get (get_api ()) . get_iv_state ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < PoolArray < u8 > > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Start the AES context in the given `mode`. A `key` of either 16 or 32 bytes must always be provided, while an `iv` (initialization vector) of exactly 16 bytes, is only needed when `mode` is either [`MODE_CBC_ENCRYPT`][Self::MODE_CBC_ENCRYPT] or [`MODE_CBC_DECRYPT`][Self::MODE_CBC_DECRYPT].\n# Default Arguments\n* `iv` - `PoolByteArray( )`"] # [doc = ""] # [inline] pub fn start (& self , mode : i64 , key : PoolArray < u8 > , iv : PoolArray < u8 >) -> GodotResult { unsafe { let method_bind : * mut sys :: godot_method_bind = AESContextMethodTable :: get (get_api ()) . start ; let ret = crate :: icalls :: icallvar__i64_bytearr_bytearr (method_bind , self . this . sys () . as_ptr () , mode as _ , key , iv) ; GodotError :: result_from_sys (sys :: godot_error :: from_variant (& ret) . expect ("Unexpected variant type")) } } # [doc = "Run the desired operation for this AES context. Will return a [`PoolByteArray`][PoolArray] containing the result of encrypting (or decrypting) the given `src`. See [`start`][Self::start] for mode of operation.\n**Note:** The size of `src` must be a multiple of 16. Apply some padding if needed."] # [doc = ""] # [inline] pub fn update (& self , src : PoolArray < u8 >) -> PoolArray < u8 > { unsafe { let method_bind : * mut sys :: godot_method_bind = AESContextMethodTable :: get (get_api ()) . update ; let ret = crate :: icalls :: icallvar__bytearr (method_bind , self . this . sys () . as_ptr () , src) ; < PoolArray < u8 > > :: from_variant (& ret) . expect ("Unexpected variant type") } } } impl gdnative_core :: private :: godot_object :: Sealed for AESContext { } unsafe impl GodotObject for AESContext { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AESContext" } } impl std :: ops :: Deref for AESContext { type Target = crate :: generated :: Reference ; # [inline] fn deref (& self) -> & crate :: generated :: Reference { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AESContext { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: Reference { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: Reference > for AESContext { } unsafe impl SubClass < crate :: generated :: Object > for AESContext { } impl Instanciable for AESContext { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { AESContext :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AESContextMethodTable { pub class_constructor : sys :: godot_class_constructor , pub finish : * mut sys :: godot_method_bind , pub get_iv_state : * mut sys :: godot_method_bind , pub start : * mut sys :: godot_method_bind , pub update : * mut sys :: godot_method_bind } impl AESContextMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AESContextMethodTable = AESContextMethodTable { class_constructor : None , finish : 0 as * mut sys :: godot_method_bind , get_iv_state : 0 as * mut sys :: godot_method_bind , start : 0 as * mut sys :: godot_method_bind , update : 0 as * mut sys :: godot_method_bind } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { AESContextMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AESContext\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 . get_iv_state = (gd_api . godot_method_bind_get_method) (class_name , "get_iv_state\0" . as_ptr () as * const c_char) ; table . start = (gd_api . godot_method_bind_get_method) (class_name , "start\0" . as_ptr () as * const c_char) ; table . update = (gd_api . godot_method_bind_get_method) (class_name , "update\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:15:9084 [INFO] [stdout] | [INFO] [stdout] 15 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 15 | # ! [doc = "This module contains types related to the API class [`ARVRAnchor`][super::ARVRAnchor]."] pub (crate) mod private { # [doc = "`core class ARVRAnchor` inherits `Spatial` (manually managed)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_arvranchor.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`ARVRAnchor` 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\nARVRAnchor 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 `Ownership` in these types tracks whether\nownership 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 ARVRAnchor { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: ARVRAnchor ; impl ARVRAnchor { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = ARVRAnchorMethodTable :: 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 anchor's ID. You can set this before the anchor itself exists. The first anchor gets an ID of `1`, the second an ID of `2`, etc. When anchors get removed, the engine can then assign the corresponding ID to new anchors. The most common situation where anchors \"disappear\" is when the AR server identifies that two anchors represent different parts of the same plane and merges them."] # [doc = ""] # [inline] pub fn anchor_id (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRAnchorMethodTable :: get (get_api ()) . get_anchor_id ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "Returns the name given to this anchor."] # [doc = ""] # [inline] pub fn get_anchor_name (& self) -> GodotString { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRAnchorMethodTable :: get (get_api ()) . get_anchor_name ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < GodotString > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns `true` if the anchor is being tracked and `false` if no anchor with this ID is currently known."] # [doc = ""] # [inline] pub fn get_is_active (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRAnchorMethodTable :: get (get_api ()) . get_is_active ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "If provided by the [`ARVRInterface`][ARVRInterface], this returns a mesh object for the anchor. For an anchor, this can be a shape related to the object being tracked or it can be a mesh that provides topology related to the anchor and can be used to create shadows/reflections on surfaces or for generating collision shapes."] # [doc = ""] # [inline] pub fn get_mesh (& self) -> Option < Ref < crate :: generated :: Mesh , ownership :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRAnchorMethodTable :: get (get_api ()) . get_mesh ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < Option < Ref < crate :: generated :: Mesh , ownership :: Shared > > > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns a plane aligned with our anchor; handy for intersection testing."] # [doc = ""] # [inline] pub fn get_plane (& self) -> Plane { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRAnchorMethodTable :: get (get_api ()) . get_plane ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < Plane > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns the estimated size of the plane that was detected. Say when the anchor relates to a table in the real world, this is the estimated size of the surface of that table."] # [doc = ""] # [inline] pub fn get_size (& self) -> Vector3 { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRAnchorMethodTable :: get (get_api ()) . get_size ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < Vector3 > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "The anchor's ID. You can set this before the anchor itself exists. The first anchor gets an ID of `1`, the second an ID of `2`, etc. When anchors get removed, the engine can then assign the corresponding ID to new anchors. The most common situation where anchors \"disappear\" is when the AR server identifies that two anchors represent different parts of the same plane and merges them."] # [doc = ""] # [inline] pub fn set_anchor_id (& self , anchor_id : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRAnchorMethodTable :: get (get_api ()) . set_anchor_id ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , anchor_id as _) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for ARVRAnchor { } unsafe impl GodotObject for ARVRAnchor { type Memory = memory :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "ARVRAnchor" } } impl QueueFree for ARVRAnchor { # [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 :: icallvar_ (method_bind , obj) ; } } impl std :: ops :: Deref for ARVRAnchor { type Target = crate :: generated :: Spatial ; # [inline] fn deref (& self) -> & crate :: generated :: Spatial { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for ARVRAnchor { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: Spatial { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: Spatial > for ARVRAnchor { } unsafe impl SubClass < crate :: generated :: Node > for ARVRAnchor { } unsafe impl SubClass < crate :: generated :: Object > for ARVRAnchor { } impl Instanciable for ARVRAnchor { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { ARVRAnchor :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct ARVRAnchorMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_anchor_id : * mut sys :: godot_method_bind , pub get_anchor_name : * mut sys :: godot_method_bind , pub get_is_active : * mut sys :: godot_method_bind , pub get_mesh : * mut sys :: godot_method_bind , pub get_plane : * mut sys :: godot_method_bind , pub get_size : * mut sys :: godot_method_bind , pub set_anchor_id : * mut sys :: godot_method_bind } impl ARVRAnchorMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : ARVRAnchorMethodTable = ARVRAnchorMethodTable { class_constructor : None , get_anchor_id : 0 as * mut sys :: godot_method_bind , get_anchor_name : 0 as * mut sys :: godot_method_bind , get_is_active : 0 as * mut sys :: godot_method_bind , get_mesh : 0 as * mut sys :: godot_method_bind , get_plane : 0 as * mut sys :: godot_method_bind , get_size : 0 as * mut sys :: godot_method_bind , set_anchor_id : 0 as * mut sys :: godot_method_bind } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { ARVRAnchorMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "ARVRAnchor\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_anchor_id = (gd_api . godot_method_bind_get_method) (class_name , "get_anchor_id\0" . as_ptr () as * const c_char) ; table . get_anchor_name = (gd_api . godot_method_bind_get_method) (class_name , "get_anchor_name\0" . as_ptr () as * const c_char) ; table . get_is_active = (gd_api . godot_method_bind_get_method) (class_name , "get_is_active\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_plane = (gd_api . godot_method_bind_get_method) (class_name , "get_plane\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 . set_anchor_id = (gd_api . godot_method_bind_get_method) (class_name , "set_anchor_id\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:21:4428 [INFO] [stdout] | [INFO] [stdout] 21 | ...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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 21 | # ! [doc = "This module contains types related to the API class [`ARVRCamera`][super::ARVRCamera]."] pub (crate) mod private { # [doc = "`core class ARVRCamera` inherits `Camera` (manually managed)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_arvrcamera.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`ARVRCamera` 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\nARVRCamera inherits methods from:\n - [Camera](struct.Camera.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 `Ownership` in these types tracks whether\nownership 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 ARVRCamera { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: ARVRCamera ; impl ARVRCamera { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = ARVRCameraMethodTable :: 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 ARVRCamera { } unsafe impl GodotObject for ARVRCamera { type Memory = memory :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "ARVRCamera" } } impl QueueFree for ARVRCamera { # [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 :: icallvar_ (method_bind , obj) ; } } impl std :: ops :: Deref for ARVRCamera { type Target = crate :: generated :: Camera ; # [inline] fn deref (& self) -> & crate :: generated :: Camera { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for ARVRCamera { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: Camera { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: Camera > for ARVRCamera { } unsafe impl SubClass < crate :: generated :: Spatial > for ARVRCamera { } unsafe impl SubClass < crate :: generated :: Node > for ARVRCamera { } unsafe impl SubClass < crate :: generated :: Object > for ARVRCamera { } impl Instanciable for ARVRCamera { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { ARVRCamera :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct ARVRCameraMethodTable { pub class_constructor : sys :: godot_class_constructor , } impl ARVRCameraMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : ARVRCameraMethodTable = ARVRCameraMethodTable { class_constructor : None , } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { ARVRCameraMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "ARVRCamera\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 [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:27:12462 [INFO] [stdout] | [INFO] [stdout] 27 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 27 | # ! [doc = "This module contains types related to the API class [`ARVRController`][super::ARVRController]."] pub (crate) mod private { # [doc = "`core class ARVRController` inherits `Spatial` (manually managed)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_arvrcontroller.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`ARVRController` 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\nARVRController 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 `Ownership` in these types tracks whether\nownership 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 ARVRController { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: ARVRController ; impl ARVRController { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = ARVRControllerMethodTable :: 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 controller's ID.\nA controller ID of 0 is unbound and will always result in an inactive node. Controller ID 1 is reserved for the first controller that identifies itself as the left-hand controller and ID 2 is reserved for the first controller that identifies itself as the right-hand controller.\nFor any other controller that the [`ARVRServer`][ARVRServer] detects, we continue with controller ID 3.\nWhen a controller is turned off, its slot is freed. This ensures controllers will keep the same ID even when controllers with lower IDs are turned off."] # [doc = ""] # [inline] pub fn controller_id (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRControllerMethodTable :: get (get_api ()) . get_controller_id ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "If active, returns the name of the associated controller if provided by the AR/VR SDK used."] # [doc = ""] # [inline] pub fn get_controller_name (& self) -> GodotString { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRControllerMethodTable :: get (get_api ()) . get_controller_name ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < GodotString > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns the hand holding this controller, if known. See [enum ARVRPositionalTracker.TrackerHand]."] # [doc = ""] # [inline] pub fn get_hand (& self) -> crate :: generated :: arvr_positional_tracker :: TrackerHand { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRControllerMethodTable :: get (get_api ()) . get_hand ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < crate :: generated :: arvr_positional_tracker :: TrackerHand > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns `true` if the bound controller is active. ARVR systems attempt to track active controllers."] # [doc = ""] # [inline] pub fn get_is_active (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRControllerMethodTable :: get (get_api ()) . get_is_active ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "Returns the value of the given axis for things like triggers, touchpads, etc. that are embedded into the controller."] # [doc = ""] # [inline] pub fn get_joystick_axis (& self , axis : i64) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRControllerMethodTable :: get (get_api ()) . get_joystick_axis ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , axis as _) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Returns the ID of the joystick object bound to this. Every controller tracked by the [`ARVRServer`][ARVRServer] that has buttons and axis will also be registered as a joystick within Godot. This means that all the normal joystick tracking and input mapping will work for buttons and axis found on the AR/VR controllers. This ID is purely offered as information so you can link up the controller with its joystick entry."] # [doc = ""] # [inline] pub fn get_joystick_id (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRControllerMethodTable :: get (get_api ()) . get_joystick_id ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "If provided by the [`ARVRInterface`][ARVRInterface], this returns a mesh associated with the controller. This can be used to visualize the controller."] # [doc = ""] # [inline] pub fn get_mesh (& self) -> Option < Ref < crate :: generated :: Mesh , ownership :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRControllerMethodTable :: get (get_api ()) . get_mesh ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < Option < Ref < crate :: generated :: Mesh , ownership :: Shared > > > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "The degree to which the controller vibrates. Ranges from `0.0` to `1.0`. If changed, updates [`ARVRPositionalTracker.rumble`][ARVRPositionalTracker::rumble] accordingly.\nThis is a useful property to animate if you want the controller to vibrate for a limited duration."] # [doc = ""] # [inline] pub fn rumble (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRControllerMethodTable :: get (get_api ()) . get_rumble ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Returns `true` if the button at index `button` is pressed. See [`JoystickList`][JoystickList], in particular the `JOY_VR_*` constants."] # [doc = ""] # [inline] pub fn is_button_pressed (& self , button : i64) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRControllerMethodTable :: get (get_api ()) . is_button_pressed ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , button as _) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "The controller's ID.\nA controller ID of 0 is unbound and will always result in an inactive node. Controller ID 1 is reserved for the first controller that identifies itself as the left-hand controller and ID 2 is reserved for the first controller that identifies itself as the right-hand controller.\nFor any other controller that the [`ARVRServer`][ARVRServer] detects, we continue with controller ID 3.\nWhen a controller is turned off, its slot is freed. This ensures controllers will keep the same ID even when controllers with lower IDs are turned off."] # [doc = ""] # [inline] pub fn set_controller_id (& self , controller_id : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRControllerMethodTable :: get (get_api ()) . set_controller_id ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , controller_id as _) ; } } # [doc = "The degree to which the controller vibrates. Ranges from `0.0` to `1.0`. If changed, updates [`ARVRPositionalTracker.rumble`][ARVRPositionalTracker::rumble] accordingly.\nThis is a useful property to animate if you want the controller to vibrate for a limited duration."] # [doc = ""] # [inline] pub fn set_rumble (& self , rumble : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRControllerMethodTable :: get (get_api ()) . set_rumble ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , rumble as _) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for ARVRController { } unsafe impl GodotObject for ARVRController { type Memory = memory :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "ARVRController" } } impl QueueFree for ARVRController { # [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 :: icallvar_ (method_bind , obj) ; } } impl std :: ops :: Deref for ARVRController { type Target = crate :: generated :: Spatial ; # [inline] fn deref (& self) -> & crate :: generated :: Spatial { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for ARVRController { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: Spatial { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: Spatial > for ARVRController { } unsafe impl SubClass < crate :: generated :: Node > for ARVRController { } unsafe impl SubClass < crate :: generated :: Object > for ARVRController { } impl Instanciable for ARVRController { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { ARVRController :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct ARVRControllerMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_controller_id : * mut sys :: godot_method_bind , pub get_controller_name : * mut sys :: godot_method_bind , pub get_hand : * mut sys :: godot_method_bind , pub get_is_active : * mut sys :: godot_method_bind , pub get_joystick_axis : * mut sys :: godot_method_bind , pub get_joystick_id : * mut sys :: godot_method_bind , pub get_mesh : * mut sys :: godot_method_bind , pub get_rumble : * mut sys :: godot_method_bind , pub is_button_pressed : * mut sys :: godot_method_bind , pub set_controller_id : * mut sys :: godot_method_bind , pub set_rumble : * mut sys :: godot_method_bind } impl ARVRControllerMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : ARVRControllerMethodTable = ARVRControllerMethodTable { class_constructor : None , get_controller_id : 0 as * mut sys :: godot_method_bind , get_controller_name : 0 as * mut sys :: godot_method_bind , get_hand : 0 as * mut sys :: godot_method_bind , get_is_active : 0 as * mut sys :: godot_method_bind , get_joystick_axis : 0 as * mut sys :: godot_method_bind , get_joystick_id : 0 as * mut sys :: godot_method_bind , get_mesh : 0 as * mut sys :: godot_method_bind , get_rumble : 0 as * mut sys :: godot_method_bind , is_button_pressed : 0 as * mut sys :: godot_method_bind , set_controller_id : 0 as * mut sys :: godot_method_bind , set_rumble : 0 as * mut sys :: godot_method_bind } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { ARVRControllerMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "ARVRController\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_controller_id = (gd_api . godot_method_bind_get_method) (class_name , "get_controller_id\0" . as_ptr () as * const c_char) ; table . get_controller_name = (gd_api . godot_method_bind_get_method) (class_name , "get_controller_name\0" . as_ptr () as * const c_char) ; table . get_hand = (gd_api . godot_method_bind_get_method) (class_name , "get_hand\0" . as_ptr () as * const c_char) ; table . get_is_active = (gd_api . godot_method_bind_get_method) (class_name , "get_is_active\0" . as_ptr () as * const c_char) ; table . get_joystick_axis = (gd_api . godot_method_bind_get_method) (class_name , "get_joystick_axis\0" . as_ptr () as * const c_char) ; table . get_joystick_id = (gd_api . godot_method_bind_get_method) (class_name , "get_joystick_id\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_rumble = (gd_api . godot_method_bind_get_method) (class_name , "get_rumble\0" . as_ptr () as * const c_char) ; table . is_button_pressed = (gd_api . godot_method_bind_get_method) (class_name , "is_button_pressed\0" . as_ptr () as * const c_char) ; table . set_controller_id = (gd_api . godot_method_bind_get_method) (class_name , "set_controller_id\0" . as_ptr () as * const c_char) ; table . set_rumble = (gd_api . godot_method_bind_get_method) (class_name , "set_rumble\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:33:14173 [INFO] [stdout] | [INFO] [stdout] 33 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 33 | # ! [doc = "This module contains types related to the API class [`ARVRInterface`][super::ARVRInterface]."] pub (crate) mod private { # [doc = "`core class ARVRInterface` inherits `Reference` (reference-counted).\n\nThis class has related types in the [`arvr_interface`][super::arvr_interface] module."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_arvrinterface.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\nARVRInterface 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 `Ownership` in these types tracks whether\nownership 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 ARVRInterface { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: ARVRInterface ; # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct Capabilities (pub i64) ; impl Capabilities { pub const NONE : Capabilities = Capabilities (0i64) ; pub const MONO : Capabilities = Capabilities (1i64) ; pub const STEREO : Capabilities = Capabilities (2i64) ; pub const AR : Capabilities = Capabilities (4i64) ; pub const EXTERNAL : Capabilities = Capabilities (8i64) ; } impl From < i64 > for Capabilities { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < Capabilities > for i64 { # [inline] fn from (v : Capabilities) -> Self { v . 0 } } impl FromVariant for Capabilities { # [inline] fn from_variant (v : & Variant) -> Result < Self , FromVariantError > { i64 :: from_variant (v) . map (Self :: from) } } # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct Eyes (pub i64) ; impl Eyes { pub const MONO : Eyes = Eyes (0i64) ; pub const LEFT : Eyes = Eyes (1i64) ; pub const RIGHT : Eyes = Eyes (2i64) ; } impl From < i64 > for Eyes { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < Eyes > for i64 { # [inline] fn from (v : Eyes) -> Self { v . 0 } } impl FromVariant for Eyes { # [inline] fn from_variant (v : & Variant) -> Result < Self , FromVariantError > { i64 :: from_variant (v) . map (Self :: from) } } # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct TrackingStatus (pub i64) ; impl TrackingStatus { pub const NORMAL_TRACKING : TrackingStatus = TrackingStatus (0i64) ; pub const EXCESSIVE_MOTION : TrackingStatus = TrackingStatus (1i64) ; pub const INSUFFICIENT_FEATURES : TrackingStatus = TrackingStatus (2i64) ; pub const UNKNOWN_TRACKING : TrackingStatus = TrackingStatus (3i64) ; pub const NOT_TRACKING : TrackingStatus = TrackingStatus (4i64) ; } impl From < i64 > for TrackingStatus { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < TrackingStatus > for i64 { # [inline] fn from (v : TrackingStatus) -> Self { v . 0 } } impl FromVariant for TrackingStatus { # [inline] fn from_variant (v : & Variant) -> Result < Self , FromVariantError > { i64 :: from_variant (v) . map (Self :: from) } } # [doc = "Constants"] # [allow (non_upper_case_globals)] impl ARVRInterface { pub const ARVR_NONE : i64 = 0i64 ; pub const ARVR_NORMAL_TRACKING : i64 = 0i64 ; pub const EYE_MONO : i64 = 0i64 ; pub const ARVR_EXCESSIVE_MOTION : i64 = 1i64 ; pub const ARVR_MONO : i64 = 1i64 ; pub const EYE_LEFT : i64 = 1i64 ; pub const ARVR_INSUFFICIENT_FEATURES : i64 = 2i64 ; pub const ARVR_STEREO : i64 = 2i64 ; pub const EYE_RIGHT : i64 = 2i64 ; pub const ARVR_UNKNOWN_TRACKING : i64 = 3i64 ; pub const ARVR_AR : i64 = 4i64 ; pub const ARVR_NOT_TRACKING : i64 = 4i64 ; pub const ARVR_EXTERNAL : i64 = 8i64 ; } impl ARVRInterface { # [doc = "On an AR interface, `true` if anchor detection is enabled."] # [doc = ""] # [inline] pub fn anchor_detection_is_enabled (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRInterfaceMethodTable :: get (get_api ()) . get_anchor_detection_is_enabled ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "If this is an AR interface that requires displaying a camera feed as the background, this method returns the feed ID in the [`CameraServer`][CameraServer] for this interface."] # [doc = ""] # [inline] pub fn get_camera_feed_id (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRInterfaceMethodTable :: get (get_api ()) . get_camera_feed_id ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "Returns a combination of [`Capabilities`][Capabilities] flags providing information about the capabilities of this interface."] # [doc = ""] # [inline] pub fn get_capabilities (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRInterfaceMethodTable :: get (get_api ()) . get_capabilities ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "Returns the name of this interface (OpenVR, OpenHMD, ARKit, etc)."] # [doc = ""] # [inline] pub fn get_name (& self) -> GodotString { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRInterfaceMethodTable :: get (get_api ()) . get_name ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < GodotString > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns the resolution at which we should render our intermediate results before things like lens distortion are applied by the VR platform."] # [doc = ""] # [inline] pub fn get_render_targetsize (& self) -> Vector2 { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRInterfaceMethodTable :: get (get_api ()) . get_render_targetsize ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < Vector2 > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "If supported, returns the status of our tracking. This will allow you to provide feedback to the user whether there are issues with positional tracking."] # [doc = ""] # [inline] pub fn get_tracking_status (& self) -> crate :: generated :: arvr_interface :: TrackingStatus { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRInterfaceMethodTable :: get (get_api ()) . get_tracking_status ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < crate :: generated :: arvr_interface :: TrackingStatus > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Call this to initialize this interface. The first interface that is initialized is identified as the primary interface and it will be used for rendering output.\nAfter initializing the interface you want to use you then need to enable the AR/VR mode of a viewport and rendering should commence.\n**Note:** You must enable the AR/VR mode on the main viewport for any device that uses the main output of Godot, such as for mobile VR.\nIf you do this for a platform that handles its own output (such as OpenVR) Godot will show just one eye without distortion on screen. Alternatively, you can add a separate viewport node to your scene and enable AR/VR on that viewport. It will be used to output to the HMD, leaving you free to do anything you like in the main window, such as using a separate camera as a spectator camera or rendering something completely different.\nWhile currently not used, you can activate additional interfaces. You may wish to do this if you want to track controllers from other platforms. However, at this point in time only one interface can render to an HMD."] # [doc = ""] # [inline] pub fn initialize (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRInterfaceMethodTable :: get (get_api ()) . initialize ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "`true` if this interface been initialized."] # [doc = ""] # [inline] pub fn is_initialized (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRInterfaceMethodTable :: get (get_api ()) . is_initialized ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "`true` if this is the primary interface."] # [doc = ""] # [inline] pub fn is_primary (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRInterfaceMethodTable :: get (get_api ()) . is_primary ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "Returns `true` if the current output of this interface is in stereo."] # [doc = ""] # [inline] pub fn is_stereo (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRInterfaceMethodTable :: get (get_api ()) . is_stereo ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "On an AR interface, `true` if anchor detection is enabled."] # [doc = ""] # [inline] pub fn set_anchor_detection_is_enabled (& self , enable : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRInterfaceMethodTable :: get (get_api ()) . set_anchor_detection_is_enabled ; let ret = crate :: icalls :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , enable as _) ; } } # [doc = "`true` if this interface been initialized."] # [doc = ""] # [inline] pub fn set_is_initialized (& self , initialized : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRInterfaceMethodTable :: get (get_api ()) . set_is_initialized ; let ret = crate :: icalls :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , initialized as _) ; } } # [doc = "`true` if this is the primary interface."] # [doc = ""] # [inline] pub fn set_is_primary (& self , enable : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRInterfaceMethodTable :: get (get_api ()) . set_is_primary ; let ret = crate :: icalls :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , enable as _) ; } } # [doc = "Turns the interface off."] # [doc = ""] # [inline] pub fn uninitialize (& self) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRInterfaceMethodTable :: get (get_api ()) . uninitialize ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for ARVRInterface { } unsafe impl GodotObject for ARVRInterface { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "ARVRInterface" } } impl std :: ops :: Deref for ARVRInterface { type Target = crate :: generated :: Reference ; # [inline] fn deref (& self) -> & crate :: generated :: Reference { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for ARVRInterface { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: Reference { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: Reference > for ARVRInterface { } unsafe impl SubClass < crate :: generated :: Object > for ARVRInterface { } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct ARVRInterfaceMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_anchor_detection_is_enabled : * mut sys :: godot_method_bind , pub get_camera_feed_id : * mut sys :: godot_method_bind , pub get_capabilities : * mut sys :: godot_method_bind , pub get_name : * mut sys :: godot_method_bind , pub get_render_targetsize : * mut sys :: godot_method_bind , pub get_tracking_status : * mut sys :: godot_method_bind , pub initialize : * mut sys :: godot_method_bind , pub is_initialized : * mut sys :: godot_method_bind , pub is_primary : * mut sys :: godot_method_bind , pub is_stereo : * mut sys :: godot_method_bind , pub set_anchor_detection_is_enabled : * mut sys :: godot_method_bind , pub set_is_initialized : * mut sys :: godot_method_bind , pub set_is_primary : * mut sys :: godot_method_bind , pub uninitialize : * mut sys :: godot_method_bind } impl ARVRInterfaceMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : ARVRInterfaceMethodTable = ARVRInterfaceMethodTable { class_constructor : None , get_anchor_detection_is_enabled : 0 as * mut sys :: godot_method_bind , get_camera_feed_id : 0 as * mut sys :: godot_method_bind , get_capabilities : 0 as * mut sys :: godot_method_bind , get_name : 0 as * mut sys :: godot_method_bind , get_render_targetsize : 0 as * mut sys :: godot_method_bind , get_tracking_status : 0 as * mut sys :: godot_method_bind , initialize : 0 as * mut sys :: godot_method_bind , is_initialized : 0 as * mut sys :: godot_method_bind , is_primary : 0 as * mut sys :: godot_method_bind , is_stereo : 0 as * mut sys :: godot_method_bind , set_anchor_detection_is_enabled : 0 as * mut sys :: godot_method_bind , set_is_initialized : 0 as * mut sys :: godot_method_bind , set_is_primary : 0 as * mut sys :: godot_method_bind , uninitialize : 0 as * mut sys :: godot_method_bind } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { ARVRInterfaceMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "ARVRInterface\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_anchor_detection_is_enabled = (gd_api . godot_method_bind_get_method) (class_name , "get_anchor_detection_is_enabled\0" . as_ptr () as * const c_char) ; table . get_camera_feed_id = (gd_api . godot_method_bind_get_method) (class_name , "get_camera_feed_id\0" . as_ptr () as * const c_char) ; table . get_capabilities = (gd_api . godot_method_bind_get_method) (class_name , "get_capabilities\0" . as_ptr () as * const c_char) ; table . get_name = (gd_api . godot_method_bind_get_method) (class_name , "get_name\0" . as_ptr () as * const c_char) ; table . get_render_targetsize = (gd_api . godot_method_bind_get_method) (class_name , "get_render_targetsize\0" . as_ptr () as * const c_char) ; table . get_tracking_status = (gd_api . godot_method_bind_get_method) (class_name , "get_tracking_status\0" . as_ptr () as * const c_char) ; table . initialize = (gd_api . godot_method_bind_get_method) (class_name , "initialize\0" . as_ptr () as * const c_char) ; table . is_initialized = (gd_api . godot_method_bind_get_method) (class_name , "is_initialized\0" . as_ptr () as * const c_char) ; table . is_primary = (gd_api . godot_method_bind_get_method) (class_name , "is_primary\0" . as_ptr () as * const c_char) ; table . is_stereo = (gd_api . godot_method_bind_get_method) (class_name , "is_stereo\0" . as_ptr () as * const c_char) ; table . set_anchor_detection_is_enabled = (gd_api . godot_method_bind_get_method) (class_name , "set_anchor_detection_is_enabled\0" . as_ptr () as * const c_char) ; table . set_is_initialized = (gd_api . godot_method_bind_get_method) (class_name , "set_is_initialized\0" . as_ptr () as * const c_char) ; table . set_is_primary = (gd_api . godot_method_bind_get_method) (class_name , "set_is_primary\0" . as_ptr () as * const c_char) ; table . uninitialize = (gd_api . godot_method_bind_get_method) (class_name , "uninitialize\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:39:3613 [INFO] [stdout] | [INFO] [stdout] 39 | ...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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 39 | # ! [doc = "This module contains types related to the API class [`ARVRInterfaceGDNative`][super::ARVRInterfaceGDNative]."] pub (crate) mod private { # [doc = "`core class ARVRInterfaceGDNative` inherits `ARVRInterface` (reference-counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_arvrinterfacegdnative.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\nARVRInterfaceGDNative inherits methods from:\n - [ARVRInterface](struct.ARVRInterface.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 `Ownership` in these types tracks whether\nownership 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 ARVRInterfaceGDNative { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: ARVRInterfaceGDNative ; impl ARVRInterfaceGDNative { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = ARVRInterfaceGDNativeMethodTable :: 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 ARVRInterfaceGDNative { } unsafe impl GodotObject for ARVRInterfaceGDNative { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "ARVRInterfaceGDNative" } } impl std :: ops :: Deref for ARVRInterfaceGDNative { type Target = crate :: generated :: ARVRInterface ; # [inline] fn deref (& self) -> & crate :: generated :: ARVRInterface { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for ARVRInterfaceGDNative { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: ARVRInterface { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: ARVRInterface > for ARVRInterfaceGDNative { } unsafe impl SubClass < crate :: generated :: Reference > for ARVRInterfaceGDNative { } unsafe impl SubClass < crate :: generated :: Object > for ARVRInterfaceGDNative { } impl Instanciable for ARVRInterfaceGDNative { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { ARVRInterfaceGDNative :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct ARVRInterfaceGDNativeMethodTable { pub class_constructor : sys :: godot_class_constructor , } impl ARVRInterfaceGDNativeMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : ARVRInterfaceGDNativeMethodTable = ARVRInterfaceGDNativeMethodTable { class_constructor : None , } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { ARVRInterfaceGDNativeMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "ARVRInterfaceGDNative\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 [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:45:5635 [INFO] [stdout] | [INFO] [stdout] 45 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 45 | # ! [doc = "This module contains types related to the API class [`ARVROrigin`][super::ARVROrigin]."] pub (crate) mod private { # [doc = "`core class ARVROrigin` inherits `Spatial` (manually managed)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_arvrorigin.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`ARVROrigin` 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\nARVROrigin 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 `Ownership` in these types tracks whether\nownership 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 ARVROrigin { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: ARVROrigin ; impl ARVROrigin { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = ARVROriginMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "Allows you to adjust the scale to your game's units. Most AR/VR platforms assume a scale of 1 game world unit = 1 real world meter.\n**Note:** This method is a passthrough to the [`ARVRServer`][ARVRServer] itself."] # [doc = ""] # [inline] pub fn world_scale (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVROriginMethodTable :: get (get_api ()) . get_world_scale ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Allows you to adjust the scale to your game's units. Most AR/VR platforms assume a scale of 1 game world unit = 1 real world meter.\n**Note:** This method is a passthrough to the [`ARVRServer`][ARVRServer] itself."] # [doc = ""] # [inline] pub fn set_world_scale (& self , world_scale : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVROriginMethodTable :: get (get_api ()) . set_world_scale ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , world_scale as _) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for ARVROrigin { } unsafe impl GodotObject for ARVROrigin { type Memory = memory :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "ARVROrigin" } } impl QueueFree for ARVROrigin { # [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 :: icallvar_ (method_bind , obj) ; } } impl std :: ops :: Deref for ARVROrigin { type Target = crate :: generated :: Spatial ; # [inline] fn deref (& self) -> & crate :: generated :: Spatial { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for ARVROrigin { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: Spatial { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: Spatial > for ARVROrigin { } unsafe impl SubClass < crate :: generated :: Node > for ARVROrigin { } unsafe impl SubClass < crate :: generated :: Object > for ARVROrigin { } impl Instanciable for ARVROrigin { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { ARVROrigin :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct ARVROriginMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_world_scale : * mut sys :: godot_method_bind , pub set_world_scale : * mut sys :: godot_method_bind } impl ARVROriginMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : ARVROriginMethodTable = ARVROriginMethodTable { class_constructor : None , get_world_scale : 0 as * mut sys :: godot_method_bind , set_world_scale : 0 as * mut sys :: godot_method_bind } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { ARVROriginMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "ARVROrigin\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_world_scale = (gd_api . godot_method_bind_get_method) (class_name , "get_world_scale\0" . as_ptr () as * const c_char) ; table . set_world_scale = (gd_api . godot_method_bind_get_method) (class_name , "set_world_scale\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:51:11877 [INFO] [stdout] | [INFO] [stdout] 51 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 51 | # ! [doc = "This module contains types related to the API class [`ARVRPositionalTracker`][super::ARVRPositionalTracker]."] pub (crate) mod private { # [doc = "`core class ARVRPositionalTracker` inherits `Reference` (reference-counted).\n\nThis class has related types in the [`arvr_positional_tracker`][super::arvr_positional_tracker] module."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_arvrpositionaltracker.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\nARVRPositionalTracker 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 `Ownership` in these types tracks whether\nownership 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 ARVRPositionalTracker { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: ARVRPositionalTracker ; # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct TrackerHand (pub i64) ; impl TrackerHand { pub const HAND_UNKNOWN : TrackerHand = TrackerHand (0i64) ; pub const LEFT_HAND : TrackerHand = TrackerHand (1i64) ; pub const RIGHT_HAND : TrackerHand = TrackerHand (2i64) ; } impl From < i64 > for TrackerHand { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < TrackerHand > for i64 { # [inline] fn from (v : TrackerHand) -> Self { v . 0 } } impl FromVariant for TrackerHand { # [inline] fn from_variant (v : & Variant) -> Result < Self , FromVariantError > { i64 :: from_variant (v) . map (Self :: from) } } # [doc = "Constants"] # [allow (non_upper_case_globals)] impl ARVRPositionalTracker { pub const TRACKER_HAND_UNKNOWN : i64 = 0i64 ; pub const TRACKER_LEFT_HAND : i64 = 1i64 ; pub const TRACKER_RIGHT_HAND : i64 = 2i64 ; } impl ARVRPositionalTracker { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = ARVRPositionalTrackerMethodTable :: 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 hand holding this tracker, if known. See [`TrackerHand`][TrackerHand] constants."] # [doc = ""] # [inline] pub fn get_hand (& self) -> crate :: generated :: arvr_positional_tracker :: TrackerHand { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRPositionalTrackerMethodTable :: get (get_api ()) . get_hand ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < crate :: generated :: arvr_positional_tracker :: TrackerHand > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "If this is a controller that is being tracked, the controller will also be represented by a joystick entry with this ID."] # [doc = ""] # [inline] pub fn get_joy_id (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRPositionalTrackerMethodTable :: get (get_api ()) . get_joy_id ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "Returns the mesh related to a controller or anchor point if one is available."] # [doc = ""] # [inline] pub fn get_mesh (& self) -> Option < Ref < crate :: generated :: Mesh , ownership :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRPositionalTrackerMethodTable :: get (get_api ()) . get_mesh ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < Option < Ref < crate :: generated :: Mesh , ownership :: Shared > > > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns the controller or anchor point's name if available."] # [doc = ""] # [inline] pub fn get_name (& self) -> GodotString { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRPositionalTrackerMethodTable :: get (get_api ()) . get_name ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < GodotString > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns the controller's orientation matrix."] # [doc = ""] # [inline] pub fn get_orientation (& self) -> Basis { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRPositionalTrackerMethodTable :: get (get_api ()) . get_orientation ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < Basis > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns the world-space controller position."] # [doc = ""] # [inline] pub fn get_position (& self) -> Vector3 { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRPositionalTrackerMethodTable :: get (get_api ()) . get_position ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < Vector3 > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "The degree to which the tracker rumbles. Ranges from `0.0` to `1.0` with precision `.01`."] # [doc = ""] # [inline] pub fn rumble (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRPositionalTrackerMethodTable :: get (get_api ()) . get_rumble ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Returns the internal tracker ID. This uniquely identifies the tracker per tracker type and matches the ID you need to specify for nodes such as the [`ARVRController`][ARVRController] and [`ARVRAnchor`][ARVRAnchor] nodes."] # [doc = ""] # [inline] pub fn get_tracker_id (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRPositionalTrackerMethodTable :: get (get_api ()) . get_tracker_id ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "Returns `true` if this device tracks orientation."] # [doc = ""] # [inline] pub fn get_tracks_orientation (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRPositionalTrackerMethodTable :: get (get_api ()) . get_tracks_orientation ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "Returns `true` if this device tracks position."] # [doc = ""] # [inline] pub fn get_tracks_position (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRPositionalTrackerMethodTable :: get (get_api ()) . get_tracks_position ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "Returns the transform combining this device's orientation and position."] # [doc = ""] # [inline] pub fn get_transform (& self , adjust_by_reference_frame : bool) -> Transform { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRPositionalTrackerMethodTable :: get (get_api ()) . get_transform ; let ret = crate :: icalls :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , adjust_by_reference_frame as _) ; < Transform > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns the tracker's type."] # [doc = ""] # [inline] pub fn get_type (& self) -> crate :: generated :: arvr_server :: TrackerType { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRPositionalTrackerMethodTable :: get (get_api ()) . get_type ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < crate :: generated :: arvr_server :: TrackerType > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "The degree to which the tracker rumbles. Ranges from `0.0` to `1.0` with precision `.01`."] # [doc = ""] # [inline] pub fn set_rumble (& self , rumble : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRPositionalTrackerMethodTable :: get (get_api ()) . set_rumble ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , rumble as _) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for ARVRPositionalTracker { } unsafe impl GodotObject for ARVRPositionalTracker { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "ARVRPositionalTracker" } } impl std :: ops :: Deref for ARVRPositionalTracker { type Target = crate :: generated :: Reference ; # [inline] fn deref (& self) -> & crate :: generated :: Reference { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for ARVRPositionalTracker { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: Reference { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: Reference > for ARVRPositionalTracker { } unsafe impl SubClass < crate :: generated :: Object > for ARVRPositionalTracker { } impl Instanciable for ARVRPositionalTracker { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { ARVRPositionalTracker :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct ARVRPositionalTrackerMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_hand : * mut sys :: godot_method_bind , pub get_joy_id : * mut sys :: godot_method_bind , pub get_mesh : * mut sys :: godot_method_bind , pub get_name : * mut sys :: godot_method_bind , pub get_orientation : * mut sys :: godot_method_bind , pub get_position : * mut sys :: godot_method_bind , pub get_rumble : * mut sys :: godot_method_bind , pub get_tracker_id : * mut sys :: godot_method_bind , pub get_tracks_orientation : * mut sys :: godot_method_bind , pub get_tracks_position : * mut sys :: godot_method_bind , pub get_transform : * mut sys :: godot_method_bind , pub get_type : * mut sys :: godot_method_bind , pub set_rumble : * mut sys :: godot_method_bind } impl ARVRPositionalTrackerMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : ARVRPositionalTrackerMethodTable = ARVRPositionalTrackerMethodTable { class_constructor : None , get_hand : 0 as * mut sys :: godot_method_bind , get_joy_id : 0 as * mut sys :: godot_method_bind , get_mesh : 0 as * mut sys :: godot_method_bind , get_name : 0 as * mut sys :: godot_method_bind , get_orientation : 0 as * mut sys :: godot_method_bind , get_position : 0 as * mut sys :: godot_method_bind , get_rumble : 0 as * mut sys :: godot_method_bind , get_tracker_id : 0 as * mut sys :: godot_method_bind , get_tracks_orientation : 0 as * mut sys :: godot_method_bind , get_tracks_position : 0 as * mut sys :: godot_method_bind , get_transform : 0 as * mut sys :: godot_method_bind , get_type : 0 as * mut sys :: godot_method_bind , set_rumble : 0 as * mut sys :: godot_method_bind } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { ARVRPositionalTrackerMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "ARVRPositionalTracker\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_hand = (gd_api . godot_method_bind_get_method) (class_name , "get_hand\0" . as_ptr () as * const c_char) ; table . get_joy_id = (gd_api . godot_method_bind_get_method) (class_name , "get_joy_id\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_name = (gd_api . godot_method_bind_get_method) (class_name , "get_name\0" . as_ptr () as * const c_char) ; table . get_orientation = (gd_api . godot_method_bind_get_method) (class_name , "get_orientation\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_rumble = (gd_api . godot_method_bind_get_method) (class_name , "get_rumble\0" . as_ptr () as * const c_char) ; table . get_tracker_id = (gd_api . godot_method_bind_get_method) (class_name , "get_tracker_id\0" . as_ptr () as * const c_char) ; table . get_tracks_orientation = (gd_api . godot_method_bind_get_method) (class_name , "get_tracks_orientation\0" . as_ptr () as * const c_char) ; table . get_tracks_position = (gd_api . godot_method_bind_get_method) (class_name , "get_tracks_position\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 . get_type = (gd_api . godot_method_bind_get_method) (class_name , "get_type\0" . as_ptr () as * const c_char) ; table . set_rumble = (gd_api . godot_method_bind_get_method) (class_name , "set_rumble\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:57:19226 [INFO] [stdout] | [INFO] [stdout] 57 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 57 | # ! [doc = "This module contains types related to the API class [`ARVRServer`][super::ARVRServer]."] pub (crate) mod private { # [doc = "`core singleton class ARVRServer` inherits `Object` (manually managed).\n\nThis class has related types in the [`arvr_server`][super::arvr_server] module."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_arvrserver.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\nARVRServer 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 `Ownership` in these types tracks whether\nownership 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 ARVRServer { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: ARVRServer ; # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct RotationMode (pub i64) ; impl RotationMode { pub const RESET_FULL_ROTATION : RotationMode = RotationMode (0i64) ; pub const RESET_BUT_KEEP_TILT : RotationMode = RotationMode (1i64) ; pub const DONT_RESET_ROTATION : RotationMode = RotationMode (2i64) ; } impl From < i64 > for RotationMode { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < RotationMode > for i64 { # [inline] fn from (v : RotationMode) -> Self { v . 0 } } impl FromVariant for RotationMode { # [inline] fn from_variant (v : & Variant) -> Result < Self , FromVariantError > { i64 :: from_variant (v) . map (Self :: from) } } # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct TrackerType (pub i64) ; impl TrackerType { pub const CONTROLLER : TrackerType = TrackerType (1i64) ; pub const BASESTATION : TrackerType = TrackerType (2i64) ; pub const ANCHOR : TrackerType = TrackerType (4i64) ; pub const ANY_KNOWN : TrackerType = TrackerType (127i64) ; pub const UNKNOWN : TrackerType = TrackerType (128i64) ; pub const ANY : TrackerType = TrackerType (255i64) ; } impl From < i64 > for TrackerType { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < TrackerType > for i64 { # [inline] fn from (v : TrackerType) -> Self { v . 0 } } impl FromVariant for TrackerType { # [inline] fn from_variant (v : & Variant) -> Result < Self , FromVariantError > { i64 :: from_variant (v) . map (Self :: from) } } # [doc = "Constants"] # [allow (non_upper_case_globals)] impl ARVRServer { pub const RESET_FULL_ROTATION : i64 = 0i64 ; pub const RESET_BUT_KEEP_TILT : i64 = 1i64 ; pub const TRACKER_CONTROLLER : i64 = 1i64 ; pub const DONT_RESET_ROTATION : i64 = 2i64 ; pub const TRACKER_BASESTATION : i64 = 2i64 ; pub const TRACKER_ANCHOR : i64 = 4i64 ; pub const TRACKER_ANY_KNOWN : i64 = 127i64 ; pub const TRACKER_UNKNOWN : i64 = 128i64 ; pub const TRACKER_ANY : i64 = 255i64 ; } impl ARVRServer { # [doc = "Returns a reference to the singleton instance."] # [inline] pub fn godot_singleton () -> & 'static Self { unsafe { let this = (get_api () . godot_global_get_singleton) ("ARVRServer\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 = "Registers an [`ARVRInterface`][ARVRInterface] object."] # [doc = ""] # [inline] pub fn add_interface (& self , interface : impl AsArg < crate :: generated :: ARVRInterface >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRServerMethodTable :: get (get_api ()) . add_interface ; let ret = crate :: icalls :: icallvar__obj (method_bind , self . this . sys () . as_ptr () , interface . as_arg_ptr ()) ; } } # [doc = "Registers a new [`ARVRPositionalTracker`][ARVRPositionalTracker] that tracks a spatial location in real space."] # [doc = ""] # [inline] pub fn add_tracker (& self , tracker : impl AsArg < crate :: generated :: ARVRPositionalTracker >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRServerMethodTable :: get (get_api ()) . add_tracker ; let ret = crate :: icalls :: icallvar__obj (method_bind , self . this . sys () . as_ptr () , tracker . as_arg_ptr ()) ; } } # [doc = "This is an important function to understand correctly. AR and VR platforms all handle positioning slightly differently.\nFor platforms that do not offer spatial tracking, our origin point (0,0,0) is the location of our HMD, but you have little control over the direction the player is facing in the real world.\nFor platforms that do offer spatial tracking, our origin point depends very much on the system. For OpenVR, our origin point is usually the center of the tracking space, on the ground. For other platforms, it's often the location of the tracking camera.\nThis method allows you to center your tracker on the location of the HMD. It will take the current location of the HMD and use that to adjust all your tracking data; in essence, realigning the real world to your player's current position in the game world.\nFor this method to produce usable results, tracking information must be available. This often takes a few frames after starting your game.\nYou should call this method after a few seconds have passed. For instance, when the user requests a realignment of the display holding a designated button on a controller for a short period of time, or when implementing a teleport mechanism."] # [doc = ""] # [inline] pub fn center_on_hmd (& self , rotation_mode : i64 , keep_height : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRServerMethodTable :: get (get_api ()) . center_on_hmd ; let ret = crate :: icalls :: icallvar__i64_bool (method_bind , self . this . sys () . as_ptr () , rotation_mode as _ , keep_height as _) ; } } # [doc = "Clears our current primary interface if it is set to the provided interface."] # [doc = ""] # [inline] pub fn clear_primary_interface_if (& self , interface : impl AsArg < crate :: generated :: ARVRInterface >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRServerMethodTable :: get (get_api ()) . clear_primary_interface_if ; let ret = crate :: icalls :: icallvar__obj (method_bind , self . this . sys () . as_ptr () , interface . as_arg_ptr ()) ; } } # [doc = "Finds an interface by its name. For instance, if your project uses capabilities of an AR/VR platform, you can find the interface for that platform by name and initialize it."] # [doc = ""] # [inline] pub fn find_interface (& self , name : impl Into < GodotString >) -> Option < Ref < crate :: generated :: ARVRInterface , ownership :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRServerMethodTable :: get (get_api ()) . find_interface ; let ret = crate :: icalls :: icallvar__str (method_bind , self . this . sys () . as_ptr () , name . into ()) ; < Option < Ref < crate :: generated :: ARVRInterface , ownership :: Shared > > > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns the primary interface's transformation."] # [doc = ""] # [inline] pub fn get_hmd_transform (& self) -> Transform { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRServerMethodTable :: get (get_api ()) . get_hmd_transform ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < Transform > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns the interface registered at a given index in our list of interfaces."] # [doc = ""] # [inline] pub fn get_interface (& self , idx : i64) -> Option < Ref < crate :: generated :: ARVRInterface , ownership :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRServerMethodTable :: get (get_api ()) . get_interface ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , idx as _) ; < Option < Ref < crate :: generated :: ARVRInterface , ownership :: Shared > > > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns the number of interfaces currently registered with the AR/VR server. If your project supports multiple AR/VR platforms, you can look through the available interface, and either present the user with a selection or simply try to initialize each interface and use the first one that returns `true`."] # [doc = ""] # [inline] pub fn get_interface_count (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRServerMethodTable :: get (get_api ()) . get_interface_count ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "Returns a list of available interfaces the ID and name of each interface."] # [doc = ""] # [inline] pub fn get_interfaces (& self) -> VariantArray { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRServerMethodTable :: get (get_api ()) . get_interfaces ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < VariantArray > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns the absolute timestamp (in μs) of the last [`ARVRServer`][ARVRServer] commit of the AR/VR eyes to [`VisualServer`][VisualServer]. The value comes from an internal call to [`OS.get_ticks_usec`][OS::get_ticks_usec]."] # [doc = ""] # [inline] pub fn get_last_commit_usec (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRServerMethodTable :: get (get_api ()) . get_last_commit_usec ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "Returns the duration (in μs) of the last frame. This is computed as the difference between [`get_last_commit_usec`][Self::get_last_commit_usec] and [`get_last_process_usec`][Self::get_last_process_usec] when committing."] # [doc = ""] # [inline] pub fn get_last_frame_usec (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRServerMethodTable :: get (get_api ()) . get_last_frame_usec ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "Returns the absolute timestamp (in μs) of the last [`ARVRServer`][ARVRServer] process callback. The value comes from an internal call to [`OS.get_ticks_usec`][OS::get_ticks_usec]."] # [doc = ""] # [inline] pub fn get_last_process_usec (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRServerMethodTable :: get (get_api ()) . get_last_process_usec ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "The primary [`ARVRInterface`][ARVRInterface] currently bound to the [`ARVRServer`][ARVRServer]."] # [doc = ""] # [inline] pub fn primary_interface (& self) -> Option < Ref < crate :: generated :: ARVRInterface , ownership :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRServerMethodTable :: get (get_api ()) . get_primary_interface ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < Option < Ref < crate :: generated :: ARVRInterface , ownership :: Shared > > > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns the reference frame transform. Mostly used internally and exposed for GDNative build interfaces."] # [doc = ""] # [inline] pub fn get_reference_frame (& self) -> Transform { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRServerMethodTable :: get (get_api ()) . get_reference_frame ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < Transform > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns the positional tracker at the given ID."] # [doc = ""] # [inline] pub fn get_tracker (& self , idx : i64) -> Option < Ref < crate :: generated :: ARVRPositionalTracker , ownership :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRServerMethodTable :: get (get_api ()) . get_tracker ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , idx as _) ; < Option < Ref < crate :: generated :: ARVRPositionalTracker , ownership :: Shared > > > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns the number of trackers currently registered."] # [doc = ""] # [inline] pub fn get_tracker_count (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRServerMethodTable :: get (get_api ()) . get_tracker_count ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "Allows you to adjust the scale to your game's units. Most AR/VR platforms assume a scale of 1 game world unit = 1 real world meter."] # [doc = ""] # [inline] pub fn world_scale (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRServerMethodTable :: get (get_api ()) . get_world_scale ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Removes this interface."] # [doc = ""] # [inline] pub fn remove_interface (& self , interface : impl AsArg < crate :: generated :: ARVRInterface >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRServerMethodTable :: get (get_api ()) . remove_interface ; let ret = crate :: icalls :: icallvar__obj (method_bind , self . this . sys () . as_ptr () , interface . as_arg_ptr ()) ; } } # [doc = "Removes this positional tracker."] # [doc = ""] # [inline] pub fn remove_tracker (& self , tracker : impl AsArg < crate :: generated :: ARVRPositionalTracker >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRServerMethodTable :: get (get_api ()) . remove_tracker ; let ret = crate :: icalls :: icallvar__obj (method_bind , self . this . sys () . as_ptr () , tracker . as_arg_ptr ()) ; } } # [doc = "The primary [`ARVRInterface`][ARVRInterface] currently bound to the [`ARVRServer`][ARVRServer]."] # [doc = ""] # [inline] pub fn set_primary_interface (& self , interface : impl AsArg < crate :: generated :: ARVRInterface >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRServerMethodTable :: get (get_api ()) . set_primary_interface ; let ret = crate :: icalls :: icallvar__obj (method_bind , self . this . sys () . as_ptr () , interface . as_arg_ptr ()) ; } } # [doc = "Allows you to adjust the scale to your game's units. Most AR/VR platforms assume a scale of 1 game world unit = 1 real world meter."] # [doc = ""] # [inline] pub fn set_world_scale (& self , world_scale : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = ARVRServerMethodTable :: get (get_api ()) . set_world_scale ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , world_scale as _) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for ARVRServer { } unsafe impl GodotObject for ARVRServer { type Memory = memory :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "ARVRServer" } } impl std :: ops :: Deref for ARVRServer { type Target = crate :: generated :: Object ; # [inline] fn deref (& self) -> & crate :: generated :: Object { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for ARVRServer { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: Object { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: Object > for ARVRServer { } unsafe impl Send for ARVRServer { } unsafe impl Sync for ARVRServer { } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct ARVRServerMethodTable { pub class_constructor : sys :: godot_class_constructor , pub add_interface : * mut sys :: godot_method_bind , pub add_tracker : * mut sys :: godot_method_bind , pub center_on_hmd : * mut sys :: godot_method_bind , pub clear_primary_interface_if : * mut sys :: godot_method_bind , pub find_interface : * mut sys :: godot_method_bind , pub get_hmd_transform : * mut sys :: godot_method_bind , pub get_interface : * mut sys :: godot_method_bind , pub get_interface_count : * mut sys :: godot_method_bind , pub get_interfaces : * mut sys :: godot_method_bind , pub get_last_commit_usec : * mut sys :: godot_method_bind , pub get_last_frame_usec : * mut sys :: godot_method_bind , pub get_last_process_usec : * mut sys :: godot_method_bind , pub get_primary_interface : * mut sys :: godot_method_bind , pub get_reference_frame : * mut sys :: godot_method_bind , pub get_tracker : * mut sys :: godot_method_bind , pub get_tracker_count : * mut sys :: godot_method_bind , pub get_world_scale : * mut sys :: godot_method_bind , pub remove_interface : * mut sys :: godot_method_bind , pub remove_tracker : * mut sys :: godot_method_bind , pub set_primary_interface : * mut sys :: godot_method_bind , pub set_world_scale : * mut sys :: godot_method_bind } impl ARVRServerMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : ARVRServerMethodTable = ARVRServerMethodTable { class_constructor : None , add_interface : 0 as * mut sys :: godot_method_bind , add_tracker : 0 as * mut sys :: godot_method_bind , center_on_hmd : 0 as * mut sys :: godot_method_bind , clear_primary_interface_if : 0 as * mut sys :: godot_method_bind , find_interface : 0 as * mut sys :: godot_method_bind , get_hmd_transform : 0 as * mut sys :: godot_method_bind , get_interface : 0 as * mut sys :: godot_method_bind , get_interface_count : 0 as * mut sys :: godot_method_bind , get_interfaces : 0 as * mut sys :: godot_method_bind , get_last_commit_usec : 0 as * mut sys :: godot_method_bind , get_last_frame_usec : 0 as * mut sys :: godot_method_bind , get_last_process_usec : 0 as * mut sys :: godot_method_bind , get_primary_interface : 0 as * mut sys :: godot_method_bind , get_reference_frame : 0 as * mut sys :: godot_method_bind , get_tracker : 0 as * mut sys :: godot_method_bind , get_tracker_count : 0 as * mut sys :: godot_method_bind , get_world_scale : 0 as * mut sys :: godot_method_bind , remove_interface : 0 as * mut sys :: godot_method_bind , remove_tracker : 0 as * mut sys :: godot_method_bind , set_primary_interface : 0 as * mut sys :: godot_method_bind , set_world_scale : 0 as * mut sys :: godot_method_bind } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { ARVRServerMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "ARVRServer\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . add_interface = (gd_api . godot_method_bind_get_method) (class_name , "add_interface\0" . as_ptr () as * const c_char) ; table . add_tracker = (gd_api . godot_method_bind_get_method) (class_name , "add_tracker\0" . as_ptr () as * const c_char) ; table . center_on_hmd = (gd_api . godot_method_bind_get_method) (class_name , "center_on_hmd\0" . as_ptr () as * const c_char) ; table . clear_primary_interface_if = (gd_api . godot_method_bind_get_method) (class_name , "clear_primary_interface_if\0" . as_ptr () as * const c_char) ; table . find_interface = (gd_api . godot_method_bind_get_method) (class_name , "find_interface\0" . as_ptr () as * const c_char) ; table . get_hmd_transform = (gd_api . godot_method_bind_get_method) (class_name , "get_hmd_transform\0" . as_ptr () as * const c_char) ; table . get_interface = (gd_api . godot_method_bind_get_method) (class_name , "get_interface\0" . as_ptr () as * const c_char) ; table . get_interface_count = (gd_api . godot_method_bind_get_method) (class_name , "get_interface_count\0" . as_ptr () as * const c_char) ; table . get_interfaces = (gd_api . godot_method_bind_get_method) (class_name , "get_interfaces\0" . as_ptr () as * const c_char) ; table . get_last_commit_usec = (gd_api . godot_method_bind_get_method) (class_name , "get_last_commit_usec\0" . as_ptr () as * const c_char) ; table . get_last_frame_usec = (gd_api . godot_method_bind_get_method) (class_name , "get_last_frame_usec\0" . as_ptr () as * const c_char) ; table . get_last_process_usec = (gd_api . godot_method_bind_get_method) (class_name , "get_last_process_usec\0" . as_ptr () as * const c_char) ; table . get_primary_interface = (gd_api . godot_method_bind_get_method) (class_name , "get_primary_interface\0" . as_ptr () as * const c_char) ; table . get_reference_frame = (gd_api . godot_method_bind_get_method) (class_name , "get_reference_frame\0" . as_ptr () as * const c_char) ; table . get_tracker = (gd_api . godot_method_bind_get_method) (class_name , "get_tracker\0" . as_ptr () as * const c_char) ; table . get_tracker_count = (gd_api . godot_method_bind_get_method) (class_name , "get_tracker_count\0" . as_ptr () as * const c_char) ; table . get_world_scale = (gd_api . godot_method_bind_get_method) (class_name , "get_world_scale\0" . as_ptr () as * const c_char) ; table . remove_interface = (gd_api . godot_method_bind_get_method) (class_name , "remove_interface\0" . as_ptr () as * const c_char) ; table . remove_tracker = (gd_api . godot_method_bind_get_method) (class_name , "remove_tracker\0" . as_ptr () as * const c_char) ; table . set_primary_interface = (gd_api . godot_method_bind_get_method) (class_name , "set_primary_interface\0" . as_ptr () as * const c_char) ; table . set_world_scale = (gd_api . godot_method_bind_get_method) (class_name , "set_world_scale\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:63:19833 [INFO] [stdout] | [INFO] [stdout] 63 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 63 | # ! [doc = "This module contains types related to the API class [`AStar`][super::AStar]."] pub (crate) mod private { # [doc = "`core class AStar` inherits `Reference` (reference-counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_astar.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\nAStar 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 `Ownership` in these types tracks whether\nownership 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 AStar { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AStar ; impl AStar { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AStarMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "_Sample code is GDScript unless otherwise noted._\n\nAdds a new point at the given position with the given identifier. The `id` must be 0 or larger, and the `weight_scale` must be 0.0 or greater.\nThe `weight_scale` is multiplied by the result of [`_compute_cost`][Self::_compute_cost] when determining the overall cost of traveling across a segment from a neighboring point to this point. Thus, all else being equal, the algorithm prefers points with lower `weight_scale`s to form a path.\n```gdscript\nvar astar = AStar.new()\nastar.add_point(1, Vector3(1, 0, 0), 4) # Adds the point (1, 0, 0) with weight_scale 4 and id 1\n```\nIf there already exists a point for the given `id`, its position and weight scale are updated to the given values.\n# Default Arguments\n* `weight_scale` - `1.0`"] # [doc = ""] # [inline] pub fn add_point (& self , id : i64 , position : Vector3 , weight_scale : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AStarMethodTable :: get (get_api ()) . add_point ; let ret = crate :: icalls :: icallvar__i64_vec3_f64 (method_bind , self . this . sys () . as_ptr () , id as _ , position , weight_scale as _) ; } } # [doc = "Returns whether the two given points are directly connected by a segment. If `bidirectional` is `false`, returns whether movement from `id` to `to_id` is possible through this segment.\n# Default Arguments\n* `bidirectional` - `true`"] # [doc = ""] # [inline] pub fn are_points_connected (& self , id : i64 , to_id : i64 , bidirectional : bool) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AStarMethodTable :: get (get_api ()) . are_points_connected ; let ret = crate :: icalls :: icallvar__i64_i64_bool (method_bind , self . this . sys () . as_ptr () , id as _ , to_id as _ , bidirectional as _) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "Clears all the points and segments."] # [doc = ""] # [inline] pub fn clear (& self) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AStarMethodTable :: get (get_api ()) . clear ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; } } # [doc = "_Sample code is GDScript unless otherwise noted._\n\nCreates a segment between the given points. If `bidirectional` is `false`, only movement from `id` to `to_id` is allowed, not the reverse direction.\n```gdscript\nvar astar = AStar.new()\nastar.add_point(1, Vector3(1, 1, 0))\nastar.add_point(2, Vector3(0, 5, 0))\nastar.connect_points(1, 2, false)\n```\n# Default Arguments\n* `bidirectional` - `true`"] # [doc = ""] # [inline] pub fn connect_points (& self , id : i64 , to_id : i64 , bidirectional : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AStarMethodTable :: get (get_api ()) . connect_points ; let ret = crate :: icalls :: icallvar__i64_i64_bool (method_bind , self . this . sys () . as_ptr () , id as _ , to_id as _ , bidirectional as _) ; } } # [doc = "Deletes the segment between the given points. If `bidirectional` is `false`, only movement from `id` to `to_id` is prevented, and a unidirectional segment possibly remains.\n# Default Arguments\n* `bidirectional` - `true`"] # [doc = ""] # [inline] pub fn disconnect_points (& self , id : i64 , to_id : i64 , bidirectional : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AStarMethodTable :: get (get_api ()) . disconnect_points ; let ret = crate :: icalls :: icallvar__i64_i64_bool (method_bind , self . this . sys () . as_ptr () , id as _ , to_id as _ , bidirectional as _) ; } } # [doc = "Returns the next available point ID with no point associated to it."] # [doc = ""] # [inline] pub fn get_available_point_id (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AStarMethodTable :: get (get_api ()) . get_available_point_id ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "Returns the ID of the closest point to `to_position`, optionally taking disabled points into account. Returns `-1` if there are no points in the points pool.\n**Note:** If several points are the closest to `to_position`, the one with the smallest ID will be returned, ensuring a deterministic result.\n# Default Arguments\n* `include_disabled` - `false`"] # [doc = ""] # [inline] pub fn get_closest_point (& self , to_position : Vector3 , include_disabled : bool) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AStarMethodTable :: get (get_api ()) . get_closest_point ; let ret = crate :: icalls :: icallvar__vec3_bool (method_bind , self . this . sys () . as_ptr () , to_position , include_disabled as _) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "_Sample code is GDScript unless otherwise noted._\n\nReturns the closest position to `to_position` that resides inside a segment between two connected points.\n```gdscript\nvar astar = AStar.new()\nastar.add_point(1, Vector3(0, 0, 0))\nastar.add_point(2, Vector3(0, 5, 0))\nastar.connect_points(1, 2)\nvar res = astar.get_closest_position_in_segment(Vector3(3, 3, 0)) # Returns (0, 3, 0)\n```\nThe result is in the segment that goes from `y = 0` to `y = 5`. It's the closest position in the segment to the given point."] # [doc = ""] # [inline] pub fn get_closest_position_in_segment (& self , to_position : Vector3) -> Vector3 { unsafe { let method_bind : * mut sys :: godot_method_bind = AStarMethodTable :: get (get_api ()) . get_closest_position_in_segment ; let ret = crate :: icalls :: icallvar__vec3 (method_bind , self . this . sys () . as_ptr () , to_position) ; < Vector3 > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "_Sample code is GDScript unless otherwise noted._\n\nReturns an array with the IDs of the points that form the path found by AStar between the given points. The array is ordered from the starting point to the ending point of the path.\n```gdscript\nvar astar = AStar.new()\nastar.add_point(1, Vector3(0, 0, 0))\nastar.add_point(2, Vector3(0, 1, 0), 1) # Default weight is 1\nastar.add_point(3, Vector3(1, 1, 0))\nastar.add_point(4, Vector3(2, 0, 0))\n\nastar.connect_points(1, 2, false)\nastar.connect_points(2, 3, false)\nastar.connect_points(4, 3, false)\nastar.connect_points(1, 4, false)\n\nvar res = astar.get_id_path(1, 3) # Returns [1, 2, 3]\n```\nIf you change the 2nd point's weight to 3, then the result will be `[1, 4, 3]` instead, because now even though the distance is longer, it's \"easier\" to get through point 4 than through point 2."] # [doc = ""] # [inline] pub fn get_id_path (& self , from_id : i64 , to_id : i64) -> PoolArray < i32 > { unsafe { let method_bind : * mut sys :: godot_method_bind = AStarMethodTable :: get (get_api ()) . get_id_path ; let ret = crate :: icalls :: icallvar__i64_i64 (method_bind , self . this . sys () . as_ptr () , from_id as _ , to_id as _) ; < PoolArray < i32 > > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns the capacity of the structure backing the points, useful in conjunction with `reserve_space`."] # [doc = ""] # [inline] pub fn get_point_capacity (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AStarMethodTable :: get (get_api ()) . get_point_capacity ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "_Sample code is GDScript unless otherwise noted._\n\nReturns an array with the IDs of the points that form the connection with the given point.\n```gdscript\nvar astar = AStar.new()\nastar.add_point(1, Vector3(0, 0, 0))\nastar.add_point(2, Vector3(0, 1, 0))\nastar.add_point(3, Vector3(1, 1, 0))\nastar.add_point(4, Vector3(2, 0, 0))\n\nastar.connect_points(1, 2, true)\nastar.connect_points(1, 3, true)\n\nvar neighbors = astar.get_point_connections(1) # Returns [2, 3]\n```"] # [doc = ""] # [inline] pub fn get_point_connections (& self , id : i64) -> PoolArray < i32 > { unsafe { let method_bind : * mut sys :: godot_method_bind = AStarMethodTable :: get (get_api ()) . get_point_connections ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , id as _) ; < PoolArray < i32 > > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns the number of points currently in the points pool."] # [doc = ""] # [inline] pub fn get_point_count (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AStarMethodTable :: get (get_api ()) . get_point_count ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "Returns an array with the points that are in the path found by AStar between the given points. The array is ordered from the starting point to the ending point of the path.\n**Note:** This method is not thread-safe. If called from a [`Thread`][Thread], it will return an empty [`PoolVector3Array`][PoolArray] and will print an error message."] # [doc = ""] # [inline] pub fn get_point_path (& self , from_id : i64 , to_id : i64) -> PoolArray < Vector3 > { unsafe { let method_bind : * mut sys :: godot_method_bind = AStarMethodTable :: get (get_api ()) . get_point_path ; let ret = crate :: icalls :: icallvar__i64_i64 (method_bind , self . this . sys () . as_ptr () , from_id as _ , to_id as _) ; < PoolArray < Vector3 > > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns the position of the point associated with the given `id`."] # [doc = ""] # [inline] pub fn get_point_position (& self , id : i64) -> Vector3 { unsafe { let method_bind : * mut sys :: godot_method_bind = AStarMethodTable :: get (get_api ()) . get_point_position ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , id as _) ; < Vector3 > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns the weight scale of the point associated with the given `id`."] # [doc = ""] # [inline] pub fn get_point_weight_scale (& self , id : i64) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AStarMethodTable :: get (get_api ()) . get_point_weight_scale ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , id as _) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Returns an array of all points."] # [doc = ""] # [inline] pub fn get_points (& self) -> VariantArray { unsafe { let method_bind : * mut sys :: godot_method_bind = AStarMethodTable :: get (get_api ()) . get_points ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < VariantArray > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns whether a point associated with the given `id` exists."] # [doc = ""] # [inline] pub fn has_point (& self , id : i64) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AStarMethodTable :: get (get_api ()) . has_point ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , id as _) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "Returns whether a point is disabled or not for pathfinding. By default, all points are enabled."] # [doc = ""] # [inline] pub fn is_point_disabled (& self , id : i64) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AStarMethodTable :: get (get_api ()) . is_point_disabled ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , id as _) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "Removes the point associated with the given `id` from the points pool."] # [doc = ""] # [inline] pub fn remove_point (& self , id : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AStarMethodTable :: get (get_api ()) . remove_point ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , id as _) ; } } # [doc = "Reserves space internally for `num_nodes` points, useful if you're adding a known large number of points at once, for a grid for instance. New capacity must be greater or equals to old capacity."] # [doc = ""] # [inline] pub fn reserve_space (& self , num_nodes : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AStarMethodTable :: get (get_api ()) . reserve_space ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , num_nodes as _) ; } } # [doc = "Disables or enables the specified point for pathfinding. Useful for making a temporary obstacle.\n# Default Arguments\n* `disabled` - `true`"] # [doc = ""] # [inline] pub fn set_point_disabled (& self , id : i64 , disabled : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AStarMethodTable :: get (get_api ()) . set_point_disabled ; let ret = crate :: icalls :: icallvar__i64_bool (method_bind , self . this . sys () . as_ptr () , id as _ , disabled as _) ; } } # [doc = "Sets the `position` for the point with the given `id`."] # [doc = ""] # [inline] pub fn set_point_position (& self , id : i64 , position : Vector3) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AStarMethodTable :: get (get_api ()) . set_point_position ; let ret = crate :: icalls :: icallvar__i64_vec3 (method_bind , self . this . sys () . as_ptr () , id as _ , position) ; } } # [doc = "Sets the `weight_scale` for the point with the given `id`. The `weight_scale` is multiplied by the result of [`_compute_cost`][Self::_compute_cost] when determining the overall cost of traveling across a segment from a neighboring point to this point."] # [doc = ""] # [inline] pub fn set_point_weight_scale (& self , id : i64 , weight_scale : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AStarMethodTable :: get (get_api ()) . set_point_weight_scale ; let ret = crate :: icalls :: icallvar__i64_f64 (method_bind , self . this . sys () . as_ptr () , id as _ , weight_scale as _) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for AStar { } unsafe impl GodotObject for AStar { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AStar" } } impl std :: ops :: Deref for AStar { type Target = crate :: generated :: Reference ; # [inline] fn deref (& self) -> & crate :: generated :: Reference { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AStar { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: Reference { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: Reference > for AStar { } unsafe impl SubClass < crate :: generated :: Object > for AStar { } impl Instanciable for AStar { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { AStar :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AStarMethodTable { pub class_constructor : sys :: godot_class_constructor , pub add_point : * mut sys :: godot_method_bind , pub are_points_connected : * mut sys :: godot_method_bind , pub clear : * mut sys :: godot_method_bind , pub connect_points : * mut sys :: godot_method_bind , pub disconnect_points : * mut sys :: godot_method_bind , pub get_available_point_id : * mut sys :: godot_method_bind , pub get_closest_point : * mut sys :: godot_method_bind , pub get_closest_position_in_segment : * mut sys :: godot_method_bind , pub get_id_path : * mut sys :: godot_method_bind , pub get_point_capacity : * mut sys :: godot_method_bind , pub get_point_connections : * mut sys :: godot_method_bind , pub get_point_count : * mut sys :: godot_method_bind , pub get_point_path : * mut sys :: godot_method_bind , pub get_point_position : * mut sys :: godot_method_bind , pub get_point_weight_scale : * mut sys :: godot_method_bind , pub get_points : * mut sys :: godot_method_bind , pub has_point : * mut sys :: godot_method_bind , pub is_point_disabled : * mut sys :: godot_method_bind , pub remove_point : * mut sys :: godot_method_bind , pub reserve_space : * mut sys :: godot_method_bind , pub set_point_disabled : * mut sys :: godot_method_bind , pub set_point_position : * mut sys :: godot_method_bind , pub set_point_weight_scale : * mut sys :: godot_method_bind } impl AStarMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AStarMethodTable = AStarMethodTable { class_constructor : None , add_point : 0 as * mut sys :: godot_method_bind , are_points_connected : 0 as * mut sys :: godot_method_bind , clear : 0 as * mut sys :: godot_method_bind , connect_points : 0 as * mut sys :: godot_method_bind , disconnect_points : 0 as * mut sys :: godot_method_bind , get_available_point_id : 0 as * mut sys :: godot_method_bind , get_closest_point : 0 as * mut sys :: godot_method_bind , get_closest_position_in_segment : 0 as * mut sys :: godot_method_bind , get_id_path : 0 as * mut sys :: godot_method_bind , get_point_capacity : 0 as * mut sys :: godot_method_bind , get_point_connections : 0 as * mut sys :: godot_method_bind , get_point_count : 0 as * mut sys :: godot_method_bind , get_point_path : 0 as * mut sys :: godot_method_bind , get_point_position : 0 as * mut sys :: godot_method_bind , get_point_weight_scale : 0 as * mut sys :: godot_method_bind , get_points : 0 as * mut sys :: godot_method_bind , has_point : 0 as * mut sys :: godot_method_bind , is_point_disabled : 0 as * mut sys :: godot_method_bind , remove_point : 0 as * mut sys :: godot_method_bind , reserve_space : 0 as * mut sys :: godot_method_bind , set_point_disabled : 0 as * mut sys :: godot_method_bind , set_point_position : 0 as * mut sys :: godot_method_bind , set_point_weight_scale : 0 as * mut sys :: godot_method_bind } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { AStarMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AStar\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 . are_points_connected = (gd_api . godot_method_bind_get_method) (class_name , "are_points_connected\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 . connect_points = (gd_api . godot_method_bind_get_method) (class_name , "connect_points\0" . as_ptr () as * const c_char) ; table . disconnect_points = (gd_api . godot_method_bind_get_method) (class_name , "disconnect_points\0" . as_ptr () as * const c_char) ; table . get_available_point_id = (gd_api . godot_method_bind_get_method) (class_name , "get_available_point_id\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_closest_position_in_segment = (gd_api . godot_method_bind_get_method) (class_name , "get_closest_position_in_segment\0" . as_ptr () as * const c_char) ; table . get_id_path = (gd_api . godot_method_bind_get_method) (class_name , "get_id_path\0" . as_ptr () as * const c_char) ; table . get_point_capacity = (gd_api . godot_method_bind_get_method) (class_name , "get_point_capacity\0" . as_ptr () as * const c_char) ; table . get_point_connections = (gd_api . godot_method_bind_get_method) (class_name , "get_point_connections\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_path = (gd_api . godot_method_bind_get_method) (class_name , "get_point_path\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_weight_scale = (gd_api . godot_method_bind_get_method) (class_name , "get_point_weight_scale\0" . as_ptr () as * const c_char) ; table . get_points = (gd_api . godot_method_bind_get_method) (class_name , "get_points\0" . as_ptr () as * const c_char) ; table . has_point = (gd_api . godot_method_bind_get_method) (class_name , "has_point\0" . as_ptr () as * const c_char) ; table . is_point_disabled = (gd_api . godot_method_bind_get_method) (class_name , "is_point_disabled\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 . reserve_space = (gd_api . godot_method_bind_get_method) (class_name , "reserve_space\0" . as_ptr () as * const c_char) ; table . set_point_disabled = (gd_api . godot_method_bind_get_method) (class_name , "set_point_disabled\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_weight_scale = (gd_api . godot_method_bind_get_method) (class_name , "set_point_weight_scale\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:69:19887 [INFO] [stdout] | [INFO] [stdout] 69 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 69 | # ! [doc = "This module contains types related to the API class [`AStar2D`][super::AStar2D]."] pub (crate) mod private { # [doc = "`core class AStar2D` inherits `Reference` (reference-counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_astar2d.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\nAStar2D 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 `Ownership` in these types tracks whether\nownership 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 AStar2D { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AStar2D ; impl AStar2D { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AStar2DMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "_Sample code is GDScript unless otherwise noted._\n\nAdds a new point at the given position with the given identifier. The `id` must be 0 or larger, and the `weight_scale` must be 0.0 or greater.\nThe `weight_scale` is multiplied by the result of [`_compute_cost`][Self::_compute_cost] when determining the overall cost of traveling across a segment from a neighboring point to this point. Thus, all else being equal, the algorithm prefers points with lower `weight_scale`s to form a path.\n```gdscript\nvar astar = AStar2D.new()\nastar.add_point(1, Vector2(1, 0), 4) # Adds the point (1, 0) with weight_scale 4 and id 1\n```\nIf there already exists a point for the given `id`, its position and weight scale are updated to the given values.\n# Default Arguments\n* `weight_scale` - `1.0`"] # [doc = ""] # [inline] pub fn add_point (& self , id : i64 , position : Vector2 , weight_scale : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AStar2DMethodTable :: get (get_api ()) . add_point ; let ret = crate :: icalls :: icallvar__i64_vec2_f64 (method_bind , self . this . sys () . as_ptr () , id as _ , position , weight_scale as _) ; } } # [doc = "Returns whether there is a connection/segment between the given points. If `bidirectional` is `false`, returns whether movement from `id` to `to_id` is possible through this segment.\n# Default Arguments\n* `bidirectional` - `true`"] # [doc = ""] # [inline] pub fn are_points_connected (& self , id : i64 , to_id : i64 , bidirectional : bool) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AStar2DMethodTable :: get (get_api ()) . are_points_connected ; let ret = crate :: icalls :: icallvar__i64_i64_bool (method_bind , self . this . sys () . as_ptr () , id as _ , to_id as _ , bidirectional as _) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "Clears all the points and segments."] # [doc = ""] # [inline] pub fn clear (& self) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AStar2DMethodTable :: get (get_api ()) . clear ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; } } # [doc = "_Sample code is GDScript unless otherwise noted._\n\nCreates a segment between the given points. If `bidirectional` is `false`, only movement from `id` to `to_id` is allowed, not the reverse direction.\n```gdscript\nvar astar = AStar2D.new()\nastar.add_point(1, Vector2(1, 1))\nastar.add_point(2, Vector2(0, 5))\nastar.connect_points(1, 2, false)\n```\n# Default Arguments\n* `bidirectional` - `true`"] # [doc = ""] # [inline] pub fn connect_points (& self , id : i64 , to_id : i64 , bidirectional : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AStar2DMethodTable :: get (get_api ()) . connect_points ; let ret = crate :: icalls :: icallvar__i64_i64_bool (method_bind , self . this . sys () . as_ptr () , id as _ , to_id as _ , bidirectional as _) ; } } # [doc = "Deletes the segment between the given points. If `bidirectional` is `false`, only movement from `id` to `to_id` is prevented, and a unidirectional segment possibly remains.\n# Default Arguments\n* `bidirectional` - `true`"] # [doc = ""] # [inline] pub fn disconnect_points (& self , id : i64 , to_id : i64 , bidirectional : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AStar2DMethodTable :: get (get_api ()) . disconnect_points ; let ret = crate :: icalls :: icallvar__i64_i64_bool (method_bind , self . this . sys () . as_ptr () , id as _ , to_id as _ , bidirectional as _) ; } } # [doc = "Returns the next available point ID with no point associated to it."] # [doc = ""] # [inline] pub fn get_available_point_id (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AStar2DMethodTable :: get (get_api ()) . get_available_point_id ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "Returns the ID of the closest point to `to_position`, optionally taking disabled points into account. Returns `-1` if there are no points in the points pool.\n**Note:** If several points are the closest to `to_position`, the one with the smallest ID will be returned, ensuring a deterministic result.\n# Default Arguments\n* `include_disabled` - `false`"] # [doc = ""] # [inline] pub fn get_closest_point (& self , to_position : Vector2 , include_disabled : bool) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AStar2DMethodTable :: get (get_api ()) . get_closest_point ; let ret = crate :: icalls :: icallvar__vec2_bool (method_bind , self . this . sys () . as_ptr () , to_position , include_disabled as _) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "_Sample code is GDScript unless otherwise noted._\n\nReturns the closest position to `to_position` that resides inside a segment between two connected points.\n```gdscript\nvar astar = AStar2D.new()\nastar.add_point(1, Vector2(0, 0))\nastar.add_point(2, Vector2(0, 5))\nastar.connect_points(1, 2)\nvar res = astar.get_closest_position_in_segment(Vector2(3, 3)) # Returns (0, 3)\n```\nThe result is in the segment that goes from `y = 0` to `y = 5`. It's the closest position in the segment to the given point."] # [doc = ""] # [inline] pub fn get_closest_position_in_segment (& self , to_position : Vector2) -> Vector2 { unsafe { let method_bind : * mut sys :: godot_method_bind = AStar2DMethodTable :: get (get_api ()) . get_closest_position_in_segment ; let ret = crate :: icalls :: icallvar__vec2 (method_bind , self . this . sys () . as_ptr () , to_position) ; < Vector2 > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "_Sample code is GDScript unless otherwise noted._\n\nReturns an array with the IDs of the points that form the path found by AStar2D between the given points. The array is ordered from the starting point to the ending point of the path.\n```gdscript\nvar astar = AStar2D.new()\nastar.add_point(1, Vector2(0, 0))\nastar.add_point(2, Vector2(0, 1), 1) # Default weight is 1\nastar.add_point(3, Vector2(1, 1))\nastar.add_point(4, Vector2(2, 0))\n\nastar.connect_points(1, 2, false)\nastar.connect_points(2, 3, false)\nastar.connect_points(4, 3, false)\nastar.connect_points(1, 4, false)\n\nvar res = astar.get_id_path(1, 3) # Returns [1, 2, 3]\n```\nIf you change the 2nd point's weight to 3, then the result will be `[1, 4, 3]` instead, because now even though the distance is longer, it's \"easier\" to get through point 4 than through point 2."] # [doc = ""] # [inline] pub fn get_id_path (& self , from_id : i64 , to_id : i64) -> PoolArray < i32 > { unsafe { let method_bind : * mut sys :: godot_method_bind = AStar2DMethodTable :: get (get_api ()) . get_id_path ; let ret = crate :: icalls :: icallvar__i64_i64 (method_bind , self . this . sys () . as_ptr () , from_id as _ , to_id as _) ; < PoolArray < i32 > > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns the capacity of the structure backing the points, useful in conjunction with `reserve_space`."] # [doc = ""] # [inline] pub fn get_point_capacity (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AStar2DMethodTable :: get (get_api ()) . get_point_capacity ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "_Sample code is GDScript unless otherwise noted._\n\nReturns an array with the IDs of the points that form the connection with the given point.\n```gdscript\nvar astar = AStar2D.new()\nastar.add_point(1, Vector2(0, 0))\nastar.add_point(2, Vector2(0, 1))\nastar.add_point(3, Vector2(1, 1))\nastar.add_point(4, Vector2(2, 0))\n\nastar.connect_points(1, 2, true)\nastar.connect_points(1, 3, true)\n\nvar neighbors = astar.get_point_connections(1) # Returns [2, 3]\n```"] # [doc = ""] # [inline] pub fn get_point_connections (& self , id : i64) -> PoolArray < i32 > { unsafe { let method_bind : * mut sys :: godot_method_bind = AStar2DMethodTable :: get (get_api ()) . get_point_connections ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , id as _) ; < PoolArray < i32 > > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns the number of points currently in the points pool."] # [doc = ""] # [inline] pub fn get_point_count (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AStar2DMethodTable :: get (get_api ()) . get_point_count ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "Returns an array with the points that are in the path found by AStar2D between the given points. The array is ordered from the starting point to the ending point of the path.\n**Note:** This method is not thread-safe. If called from a [`Thread`][Thread], it will return an empty [`PoolVector2Array`][PoolArray] and will print an error message."] # [doc = ""] # [inline] pub fn get_point_path (& self , from_id : i64 , to_id : i64) -> PoolArray < Vector2 > { unsafe { let method_bind : * mut sys :: godot_method_bind = AStar2DMethodTable :: get (get_api ()) . get_point_path ; let ret = crate :: icalls :: icallvar__i64_i64 (method_bind , self . this . sys () . as_ptr () , from_id as _ , to_id as _) ; < PoolArray < Vector2 > > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns the position of the point associated with the given `id`."] # [doc = ""] # [inline] pub fn get_point_position (& self , id : i64) -> Vector2 { unsafe { let method_bind : * mut sys :: godot_method_bind = AStar2DMethodTable :: get (get_api ()) . get_point_position ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , id as _) ; < Vector2 > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns the weight scale of the point associated with the given `id`."] # [doc = ""] # [inline] pub fn get_point_weight_scale (& self , id : i64) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AStar2DMethodTable :: get (get_api ()) . get_point_weight_scale ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , id as _) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Returns an array of all points."] # [doc = ""] # [inline] pub fn get_points (& self) -> VariantArray { unsafe { let method_bind : * mut sys :: godot_method_bind = AStar2DMethodTable :: get (get_api ()) . get_points ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < VariantArray > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns whether a point associated with the given `id` exists."] # [doc = ""] # [inline] pub fn has_point (& self , id : i64) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AStar2DMethodTable :: get (get_api ()) . has_point ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , id as _) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "Returns whether a point is disabled or not for pathfinding. By default, all points are enabled."] # [doc = ""] # [inline] pub fn is_point_disabled (& self , id : i64) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AStar2DMethodTable :: get (get_api ()) . is_point_disabled ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , id as _) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "Removes the point associated with the given `id` from the points pool."] # [doc = ""] # [inline] pub fn remove_point (& self , id : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AStar2DMethodTable :: get (get_api ()) . remove_point ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , id as _) ; } } # [doc = "Reserves space internally for `num_nodes` points, useful if you're adding a known large number of points at once, for a grid for instance. New capacity must be greater or equals to old capacity."] # [doc = ""] # [inline] pub fn reserve_space (& self , num_nodes : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AStar2DMethodTable :: get (get_api ()) . reserve_space ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , num_nodes as _) ; } } # [doc = "Disables or enables the specified point for pathfinding. Useful for making a temporary obstacle.\n# Default Arguments\n* `disabled` - `true`"] # [doc = ""] # [inline] pub fn set_point_disabled (& self , id : i64 , disabled : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AStar2DMethodTable :: get (get_api ()) . set_point_disabled ; let ret = crate :: icalls :: icallvar__i64_bool (method_bind , self . this . sys () . as_ptr () , id as _ , disabled as _) ; } } # [doc = "Sets the `position` for the point with the given `id`."] # [doc = ""] # [inline] pub fn set_point_position (& self , id : i64 , position : Vector2) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AStar2DMethodTable :: get (get_api ()) . set_point_position ; let ret = crate :: icalls :: icallvar__i64_vec2 (method_bind , self . this . sys () . as_ptr () , id as _ , position) ; } } # [doc = "Sets the `weight_scale` for the point with the given `id`. The `weight_scale` is multiplied by the result of [`_compute_cost`][Self::_compute_cost] when determining the overall cost of traveling across a segment from a neighboring point to this point."] # [doc = ""] # [inline] pub fn set_point_weight_scale (& self , id : i64 , weight_scale : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AStar2DMethodTable :: get (get_api ()) . set_point_weight_scale ; let ret = crate :: icalls :: icallvar__i64_f64 (method_bind , self . this . sys () . as_ptr () , id as _ , weight_scale as _) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for AStar2D { } unsafe impl GodotObject for AStar2D { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AStar2D" } } impl std :: ops :: Deref for AStar2D { type Target = crate :: generated :: Reference ; # [inline] fn deref (& self) -> & crate :: generated :: Reference { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AStar2D { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: Reference { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: Reference > for AStar2D { } unsafe impl SubClass < crate :: generated :: Object > for AStar2D { } impl Instanciable for AStar2D { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { AStar2D :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AStar2DMethodTable { pub class_constructor : sys :: godot_class_constructor , pub add_point : * mut sys :: godot_method_bind , pub are_points_connected : * mut sys :: godot_method_bind , pub clear : * mut sys :: godot_method_bind , pub connect_points : * mut sys :: godot_method_bind , pub disconnect_points : * mut sys :: godot_method_bind , pub get_available_point_id : * mut sys :: godot_method_bind , pub get_closest_point : * mut sys :: godot_method_bind , pub get_closest_position_in_segment : * mut sys :: godot_method_bind , pub get_id_path : * mut sys :: godot_method_bind , pub get_point_capacity : * mut sys :: godot_method_bind , pub get_point_connections : * mut sys :: godot_method_bind , pub get_point_count : * mut sys :: godot_method_bind , pub get_point_path : * mut sys :: godot_method_bind , pub get_point_position : * mut sys :: godot_method_bind , pub get_point_weight_scale : * mut sys :: godot_method_bind , pub get_points : * mut sys :: godot_method_bind , pub has_point : * mut sys :: godot_method_bind , pub is_point_disabled : * mut sys :: godot_method_bind , pub remove_point : * mut sys :: godot_method_bind , pub reserve_space : * mut sys :: godot_method_bind , pub set_point_disabled : * mut sys :: godot_method_bind , pub set_point_position : * mut sys :: godot_method_bind , pub set_point_weight_scale : * mut sys :: godot_method_bind } impl AStar2DMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AStar2DMethodTable = AStar2DMethodTable { class_constructor : None , add_point : 0 as * mut sys :: godot_method_bind , are_points_connected : 0 as * mut sys :: godot_method_bind , clear : 0 as * mut sys :: godot_method_bind , connect_points : 0 as * mut sys :: godot_method_bind , disconnect_points : 0 as * mut sys :: godot_method_bind , get_available_point_id : 0 as * mut sys :: godot_method_bind , get_closest_point : 0 as * mut sys :: godot_method_bind , get_closest_position_in_segment : 0 as * mut sys :: godot_method_bind , get_id_path : 0 as * mut sys :: godot_method_bind , get_point_capacity : 0 as * mut sys :: godot_method_bind , get_point_connections : 0 as * mut sys :: godot_method_bind , get_point_count : 0 as * mut sys :: godot_method_bind , get_point_path : 0 as * mut sys :: godot_method_bind , get_point_position : 0 as * mut sys :: godot_method_bind , get_point_weight_scale : 0 as * mut sys :: godot_method_bind , get_points : 0 as * mut sys :: godot_method_bind , has_point : 0 as * mut sys :: godot_method_bind , is_point_disabled : 0 as * mut sys :: godot_method_bind , remove_point : 0 as * mut sys :: godot_method_bind , reserve_space : 0 as * mut sys :: godot_method_bind , set_point_disabled : 0 as * mut sys :: godot_method_bind , set_point_position : 0 as * mut sys :: godot_method_bind , set_point_weight_scale : 0 as * mut sys :: godot_method_bind } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { AStar2DMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AStar2D\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 . are_points_connected = (gd_api . godot_method_bind_get_method) (class_name , "are_points_connected\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 . connect_points = (gd_api . godot_method_bind_get_method) (class_name , "connect_points\0" . as_ptr () as * const c_char) ; table . disconnect_points = (gd_api . godot_method_bind_get_method) (class_name , "disconnect_points\0" . as_ptr () as * const c_char) ; table . get_available_point_id = (gd_api . godot_method_bind_get_method) (class_name , "get_available_point_id\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_closest_position_in_segment = (gd_api . godot_method_bind_get_method) (class_name , "get_closest_position_in_segment\0" . as_ptr () as * const c_char) ; table . get_id_path = (gd_api . godot_method_bind_get_method) (class_name , "get_id_path\0" . as_ptr () as * const c_char) ; table . get_point_capacity = (gd_api . godot_method_bind_get_method) (class_name , "get_point_capacity\0" . as_ptr () as * const c_char) ; table . get_point_connections = (gd_api . godot_method_bind_get_method) (class_name , "get_point_connections\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_path = (gd_api . godot_method_bind_get_method) (class_name , "get_point_path\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_weight_scale = (gd_api . godot_method_bind_get_method) (class_name , "get_point_weight_scale\0" . as_ptr () as * const c_char) ; table . get_points = (gd_api . godot_method_bind_get_method) (class_name , "get_points\0" . as_ptr () as * const c_char) ; table . has_point = (gd_api . godot_method_bind_get_method) (class_name , "has_point\0" . as_ptr () as * const c_char) ; table . is_point_disabled = (gd_api . godot_method_bind_get_method) (class_name , "is_point_disabled\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 . reserve_space = (gd_api . godot_method_bind_get_method) (class_name , "reserve_space\0" . as_ptr () as * const c_char) ; table . set_point_disabled = (gd_api . godot_method_bind_get_method) (class_name , "set_point_disabled\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_weight_scale = (gd_api . godot_method_bind_get_method) (class_name , "set_point_weight_scale\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:75:13958 [INFO] [stdout] | [INFO] [stdout] 75 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 75 | # ! [doc = "This module contains types related to the API class [`AcceptDialog`][super::AcceptDialog]."] pub (crate) mod private { # [doc = "`core class AcceptDialog` inherits `WindowDialog` (manually managed)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_acceptdialog.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`AcceptDialog` 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\nAcceptDialog inherits methods from:\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 = ""] # [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 `Ownership` in these types tracks whether\nownership 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 AcceptDialog { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AcceptDialog ; impl AcceptDialog { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AcceptDialogMethodTable :: 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 button with label `text` and a custom `action` to the dialog and returns the created button. `action` will be passed to the `custom_action` signal when pressed.\nIf `true`, `right` will place the button to the right of any sibling buttons.\nYou can use [`remove_button`][Self::remove_button] method to remove a button created with this method from the dialog.\n# Default Arguments\n* `right` - `false`\n* `action` - `\"\"`"] # [doc = ""] # [inline] pub fn add_button (& self , text : impl Into < GodotString > , right : bool , action : impl Into < GodotString >) -> Option < Ref < crate :: generated :: Button , ownership :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = AcceptDialogMethodTable :: get (get_api ()) . add_button ; let ret = crate :: icalls :: icallvar__str_bool_str (method_bind , self . this . sys () . as_ptr () , text . into () , right as _ , action . into ()) ; < Option < Ref < crate :: generated :: Button , ownership :: Shared > > > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Adds a button with label `name` and a cancel action to the dialog and returns the created button.\nYou can use [`remove_button`][Self::remove_button] method to remove a button created with this method from the dialog."] # [doc = ""] # [inline] pub fn add_cancel (& self , name : impl Into < GodotString >) -> Option < Ref < crate :: generated :: Button , ownership :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = AcceptDialogMethodTable :: get (get_api ()) . add_cancel ; let ret = crate :: icalls :: icallvar__str (method_bind , self . this . sys () . as_ptr () , name . into ()) ; < Option < Ref < crate :: generated :: Button , ownership :: Shared > > > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "If `true`, the dialog is hidden when the OK button is pressed. You can set it to `false` if you want to do e.g. input validation when receiving the `confirmed` signal, and handle hiding the dialog in your own logic.\n**Note:** Some nodes derived from this class can have a different default value, and potentially their own built-in logic overriding this setting. For example [`FileDialog`][FileDialog] defaults to `false`, and has its own input validation code that is called when you press OK, which eventually hides the dialog if the input is valid. As such, this property can't be used in [`FileDialog`][FileDialog] to disable hiding the dialog when pressing OK."] # [doc = ""] # [inline] pub fn hide_on_ok (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AcceptDialogMethodTable :: get (get_api ()) . get_hide_on_ok ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "Returns the label used for built-in text.\n**Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [`CanvasItem.visible`][CanvasItem::visible] property."] # [doc = ""] # [inline] pub fn get_label (& self) -> Option < Ref < crate :: generated :: Label , ownership :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = AcceptDialogMethodTable :: get (get_api ()) . get_label ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < Option < Ref < crate :: generated :: Label , ownership :: Shared > > > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns the OK [`Button`][Button] instance.\n**Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [`CanvasItem.visible`][CanvasItem::visible] property."] # [doc = ""] # [inline] pub fn get_ok (& self) -> Option < Ref < crate :: generated :: Button , ownership :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = AcceptDialogMethodTable :: get (get_api ()) . get_ok ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < Option < Ref < crate :: generated :: Button , ownership :: Shared > > > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "The text displayed by the dialog."] # [doc = ""] # [inline] pub fn text (& self) -> GodotString { unsafe { let method_bind : * mut sys :: godot_method_bind = AcceptDialogMethodTable :: get (get_api ()) . get_text ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < GodotString > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Sets autowrapping for the text in the dialog."] # [doc = ""] # [inline] pub fn has_autowrap (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AcceptDialogMethodTable :: get (get_api ()) . has_autowrap ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "Registers a [`LineEdit`][LineEdit] in the dialog. When the enter key is pressed, the dialog will be accepted."] # [doc = ""] # [inline] pub fn register_text_enter (& self , line_edit : impl AsArg < crate :: generated :: Node >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AcceptDialogMethodTable :: get (get_api ()) . register_text_enter ; let ret = crate :: icalls :: icallvar__obj (method_bind , self . this . sys () . as_ptr () , line_edit . as_arg_ptr ()) ; } } # [doc = "Removes the `button` from the dialog. Does NOT free the `button`. The `button` must be a [`Button`][Button] added with [`add_button`][Self::add_button] or [`add_cancel`][Self::add_cancel] method. After removal, pressing the `button` will no longer emit this dialog's `custom_action` signal or cancel this dialog."] # [doc = ""] # [inline] pub fn remove_button (& self , button : impl AsArg < crate :: generated :: Control >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AcceptDialogMethodTable :: get (get_api ()) . remove_button ; let ret = crate :: icalls :: icallvar__obj (method_bind , self . this . sys () . as_ptr () , button . as_arg_ptr ()) ; } } # [doc = "Sets autowrapping for the text in the dialog."] # [doc = ""] # [inline] pub fn set_autowrap (& self , autowrap : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AcceptDialogMethodTable :: get (get_api ()) . set_autowrap ; let ret = crate :: icalls :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , autowrap as _) ; } } # [doc = "If `true`, the dialog is hidden when the OK button is pressed. You can set it to `false` if you want to do e.g. input validation when receiving the `confirmed` signal, and handle hiding the dialog in your own logic.\n**Note:** Some nodes derived from this class can have a different default value, and potentially their own built-in logic overriding this setting. For example [`FileDialog`][FileDialog] defaults to `false`, and has its own input validation code that is called when you press OK, which eventually hides the dialog if the input is valid. As such, this property can't be used in [`FileDialog`][FileDialog] to disable hiding the dialog when pressing OK."] # [doc = ""] # [inline] pub fn set_hide_on_ok (& self , enabled : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AcceptDialogMethodTable :: get (get_api ()) . set_hide_on_ok ; let ret = crate :: icalls :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , enabled as _) ; } } # [doc = "The text displayed by the dialog."] # [doc = ""] # [inline] pub fn set_text (& self , text : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AcceptDialogMethodTable :: get (get_api ()) . set_text ; let ret = crate :: icalls :: icallvar__str (method_bind , self . this . sys () . as_ptr () , text . into ()) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for AcceptDialog { } unsafe impl GodotObject for AcceptDialog { type Memory = memory :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "AcceptDialog" } } impl QueueFree for AcceptDialog { # [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 :: icallvar_ (method_bind , obj) ; } } impl std :: ops :: Deref for AcceptDialog { type Target = crate :: generated :: WindowDialog ; # [inline] fn deref (& self) -> & crate :: generated :: WindowDialog { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AcceptDialog { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: WindowDialog { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: WindowDialog > for AcceptDialog { } unsafe impl SubClass < crate :: generated :: Popup > for AcceptDialog { } unsafe impl SubClass < crate :: generated :: Control > for AcceptDialog { } unsafe impl SubClass < crate :: generated :: CanvasItem > for AcceptDialog { } unsafe impl SubClass < crate :: generated :: Node > for AcceptDialog { } unsafe impl SubClass < crate :: generated :: Object > for AcceptDialog { } impl Instanciable for AcceptDialog { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { AcceptDialog :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AcceptDialogMethodTable { pub class_constructor : sys :: godot_class_constructor , pub add_button : * mut sys :: godot_method_bind , pub add_cancel : * mut sys :: godot_method_bind , pub get_hide_on_ok : * mut sys :: godot_method_bind , pub get_label : * mut sys :: godot_method_bind , pub get_ok : * mut sys :: godot_method_bind , pub get_text : * mut sys :: godot_method_bind , pub has_autowrap : * mut sys :: godot_method_bind , pub register_text_enter : * mut sys :: godot_method_bind , pub remove_button : * mut sys :: godot_method_bind , pub set_autowrap : * mut sys :: godot_method_bind , pub set_hide_on_ok : * mut sys :: godot_method_bind , pub set_text : * mut sys :: godot_method_bind } impl AcceptDialogMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AcceptDialogMethodTable = AcceptDialogMethodTable { class_constructor : None , add_button : 0 as * mut sys :: godot_method_bind , add_cancel : 0 as * mut sys :: godot_method_bind , get_hide_on_ok : 0 as * mut sys :: godot_method_bind , get_label : 0 as * mut sys :: godot_method_bind , get_ok : 0 as * mut sys :: godot_method_bind , get_text : 0 as * mut sys :: godot_method_bind , has_autowrap : 0 as * mut sys :: godot_method_bind , register_text_enter : 0 as * mut sys :: godot_method_bind , remove_button : 0 as * mut sys :: godot_method_bind , set_autowrap : 0 as * mut sys :: godot_method_bind , set_hide_on_ok : 0 as * mut sys :: godot_method_bind , set_text : 0 as * mut sys :: godot_method_bind } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { AcceptDialogMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AcceptDialog\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . add_button = (gd_api . godot_method_bind_get_method) (class_name , "add_button\0" . as_ptr () as * const c_char) ; table . add_cancel = (gd_api . godot_method_bind_get_method) (class_name , "add_cancel\0" . as_ptr () as * const c_char) ; table . get_hide_on_ok = (gd_api . godot_method_bind_get_method) (class_name , "get_hide_on_ok\0" . as_ptr () as * const c_char) ; table . get_label = (gd_api . godot_method_bind_get_method) (class_name , "get_label\0" . as_ptr () as * const c_char) ; table . get_ok = (gd_api . godot_method_bind_get_method) (class_name , "get_ok\0" . as_ptr () as * const c_char) ; table . get_text = (gd_api . godot_method_bind_get_method) (class_name , "get_text\0" . as_ptr () as * const c_char) ; table . has_autowrap = (gd_api . godot_method_bind_get_method) (class_name , "has_autowrap\0" . as_ptr () as * const c_char) ; table . register_text_enter = (gd_api . godot_method_bind_get_method) (class_name , "register_text_enter\0" . as_ptr () as * const c_char) ; table . remove_button = (gd_api . godot_method_bind_get_method) (class_name , "remove_button\0" . as_ptr () as * const c_char) ; table . set_autowrap = (gd_api . godot_method_bind_get_method) (class_name , "set_autowrap\0" . as_ptr () as * const c_char) ; table . set_hide_on_ok = (gd_api . godot_method_bind_get_method) (class_name , "set_hide_on_ok\0" . as_ptr () as * const c_char) ; table . set_text = (gd_api . godot_method_bind_get_method) (class_name , "set_text\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:81:15042 [INFO] [stdout] | [INFO] [stdout] 81 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 81 | # ! [doc = "This module contains types related to the API class [`AnimatedSprite`][super::AnimatedSprite]."] pub (crate) mod private { # [doc = "`core class AnimatedSprite` inherits `Node2D` (manually managed)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_animatedsprite.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`AnimatedSprite` 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\nAnimatedSprite 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 `Ownership` in these types tracks whether\nownership 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 AnimatedSprite { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AnimatedSprite ; impl AnimatedSprite { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AnimatedSpriteMethodTable :: 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 animation from the [`frames`][Self::frames] resource. If this value changes, the `frame` counter is reset."] # [doc = ""] # [inline] pub fn animation (& self) -> GodotString { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimatedSpriteMethodTable :: get (get_api ()) . get_animation ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < GodotString > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "The displayed animation frame's index."] # [doc = ""] # [inline] pub fn frame (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimatedSpriteMethodTable :: get (get_api ()) . get_frame ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "The texture's drawing offset."] # [doc = ""] # [inline] pub fn offset (& self) -> Vector2 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimatedSpriteMethodTable :: get (get_api ()) . get_offset ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < Vector2 > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "The animation speed is multiplied by this value."] # [doc = ""] # [inline] pub fn speed_scale (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimatedSpriteMethodTable :: get (get_api ()) . get_speed_scale ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "The [`SpriteFrames`][SpriteFrames] resource containing the animation(s). Allows you the option to load, edit, clear, make unique and save the states of the [`SpriteFrames`][SpriteFrames] resource."] # [doc = ""] # [inline] pub fn sprite_frames (& self) -> Option < Ref < crate :: generated :: SpriteFrames , ownership :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimatedSpriteMethodTable :: get (get_api ()) . get_sprite_frames ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < Option < Ref < crate :: generated :: SpriteFrames , ownership :: Shared > > > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "If `true`, texture will be centered."] # [doc = ""] # [inline] pub fn is_centered (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimatedSpriteMethodTable :: get (get_api ()) . is_centered ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "If `true`, texture is flipped horizontally."] # [doc = ""] # [inline] pub fn is_flipped_h (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimatedSpriteMethodTable :: get (get_api ()) . is_flipped_h ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "If `true`, texture is flipped vertically."] # [doc = ""] # [inline] pub fn is_flipped_v (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimatedSpriteMethodTable :: get (get_api ()) . is_flipped_v ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "If `true`, the [`animation`][Self::animation] is currently playing."] # [doc = ""] # [inline] pub fn is_playing (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimatedSpriteMethodTable :: get (get_api ()) . is_playing ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "Plays the animation named `anim`. If no `anim` is provided, the current animation is played. If `backwards` is `true`, the animation will be played in reverse.\n# Default Arguments\n* `anim` - `\"\"`\n* `backwards` - `false`"] # [doc = ""] # [inline] pub fn play (& self , anim : impl Into < GodotString > , backwards : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimatedSpriteMethodTable :: get (get_api ()) . play ; let ret = crate :: icalls :: icallvar__str_bool (method_bind , self . this . sys () . as_ptr () , anim . into () , backwards as _) ; } } # [doc = "The current animation from the [`frames`][Self::frames] resource. If this value changes, the `frame` counter is reset."] # [doc = ""] # [inline] pub fn set_animation (& self , animation : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimatedSpriteMethodTable :: get (get_api ()) . set_animation ; let ret = crate :: icalls :: icallvar__str (method_bind , self . this . sys () . as_ptr () , animation . into ()) ; } } # [doc = "If `true`, texture will be centered."] # [doc = ""] # [inline] pub fn set_centered (& self , centered : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimatedSpriteMethodTable :: get (get_api ()) . set_centered ; let ret = crate :: icalls :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , centered as _) ; } } # [doc = "If `true`, texture is flipped horizontally."] # [doc = ""] # [inline] pub fn set_flip_h (& self , flip_h : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimatedSpriteMethodTable :: get (get_api ()) . set_flip_h ; let ret = crate :: icalls :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , flip_h as _) ; } } # [doc = "If `true`, texture is flipped vertically."] # [doc = ""] # [inline] pub fn set_flip_v (& self , flip_v : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimatedSpriteMethodTable :: get (get_api ()) . set_flip_v ; let ret = crate :: icalls :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , flip_v as _) ; } } # [doc = "The displayed animation frame's index."] # [doc = ""] # [inline] pub fn set_frame (& self , frame : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimatedSpriteMethodTable :: get (get_api ()) . set_frame ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , frame as _) ; } } # [doc = "The texture's drawing offset."] # [doc = ""] # [inline] pub fn set_offset (& self , offset : Vector2) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimatedSpriteMethodTable :: get (get_api ()) . set_offset ; let ret = crate :: icalls :: icallvar__vec2 (method_bind , self . this . sys () . as_ptr () , offset) ; } } # [doc = "If `true`, the [`animation`][Self::animation] is currently playing."] # [doc = ""] # [inline] pub fn set_playing (& self , playing : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimatedSpriteMethodTable :: get (get_api ()) . set_playing ; let ret = crate :: icalls :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , playing as _) ; } } # [doc = "The animation speed is multiplied by this value."] # [doc = ""] # [inline] pub fn set_speed_scale (& self , speed_scale : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimatedSpriteMethodTable :: get (get_api ()) . set_speed_scale ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , speed_scale as _) ; } } # [doc = "The [`SpriteFrames`][SpriteFrames] resource containing the animation(s). Allows you the option to load, edit, clear, make unique and save the states of the [`SpriteFrames`][SpriteFrames] resource."] # [doc = ""] # [inline] pub fn set_sprite_frames (& self , sprite_frames : impl AsArg < crate :: generated :: SpriteFrames >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimatedSpriteMethodTable :: get (get_api ()) . set_sprite_frames ; let ret = crate :: icalls :: icallvar__obj (method_bind , self . this . sys () . as_ptr () , sprite_frames . as_arg_ptr ()) ; } } # [doc = "Stops the current animation (does not reset the frame counter)."] # [doc = ""] # [inline] pub fn stop (& self) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimatedSpriteMethodTable :: get (get_api ()) . stop ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for AnimatedSprite { } unsafe impl GodotObject for AnimatedSprite { type Memory = memory :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "AnimatedSprite" } } impl QueueFree for AnimatedSprite { # [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 :: icallvar_ (method_bind , obj) ; } } impl std :: ops :: Deref for AnimatedSprite { type Target = crate :: generated :: Node2D ; # [inline] fn deref (& self) -> & crate :: generated :: Node2D { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AnimatedSprite { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: Node2D { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: Node2D > for AnimatedSprite { } unsafe impl SubClass < crate :: generated :: CanvasItem > for AnimatedSprite { } unsafe impl SubClass < crate :: generated :: Node > for AnimatedSprite { } unsafe impl SubClass < crate :: generated :: Object > for AnimatedSprite { } impl Instanciable for AnimatedSprite { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { AnimatedSprite :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AnimatedSpriteMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_animation : * mut sys :: godot_method_bind , pub get_frame : * mut sys :: godot_method_bind , pub get_offset : * mut sys :: godot_method_bind , pub get_speed_scale : * mut sys :: godot_method_bind , pub get_sprite_frames : * mut sys :: godot_method_bind , pub is_centered : * mut sys :: godot_method_bind , pub is_flipped_h : * mut sys :: godot_method_bind , pub is_flipped_v : * mut sys :: godot_method_bind , pub is_playing : * mut sys :: godot_method_bind , pub play : * mut sys :: godot_method_bind , pub set_animation : * mut sys :: godot_method_bind , pub set_centered : * mut sys :: godot_method_bind , pub set_flip_h : * mut sys :: godot_method_bind , pub set_flip_v : * mut sys :: godot_method_bind , pub set_frame : * mut sys :: godot_method_bind , pub set_offset : * mut sys :: godot_method_bind , pub set_playing : * mut sys :: godot_method_bind , pub set_speed_scale : * mut sys :: godot_method_bind , pub set_sprite_frames : * mut sys :: godot_method_bind , pub stop : * mut sys :: godot_method_bind } impl AnimatedSpriteMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AnimatedSpriteMethodTable = AnimatedSpriteMethodTable { class_constructor : None , get_animation : 0 as * mut sys :: godot_method_bind , get_frame : 0 as * mut sys :: godot_method_bind , get_offset : 0 as * mut sys :: godot_method_bind , get_speed_scale : 0 as * mut sys :: godot_method_bind , get_sprite_frames : 0 as * mut sys :: godot_method_bind , is_centered : 0 as * mut sys :: godot_method_bind , is_flipped_h : 0 as * mut sys :: godot_method_bind , is_flipped_v : 0 as * mut sys :: godot_method_bind , is_playing : 0 as * mut sys :: godot_method_bind , play : 0 as * mut sys :: godot_method_bind , set_animation : 0 as * mut sys :: godot_method_bind , set_centered : 0 as * mut sys :: godot_method_bind , set_flip_h : 0 as * mut sys :: godot_method_bind , set_flip_v : 0 as * mut sys :: godot_method_bind , set_frame : 0 as * mut sys :: godot_method_bind , set_offset : 0 as * mut sys :: godot_method_bind , set_playing : 0 as * mut sys :: godot_method_bind , set_speed_scale : 0 as * mut sys :: godot_method_bind , set_sprite_frames : 0 as * mut sys :: godot_method_bind , stop : 0 as * mut sys :: godot_method_bind } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { AnimatedSpriteMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AnimatedSprite\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_animation = (gd_api . godot_method_bind_get_method) (class_name , "get_animation\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_offset = (gd_api . godot_method_bind_get_method) (class_name , "get_offset\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_sprite_frames = (gd_api . godot_method_bind_get_method) (class_name , "get_sprite_frames\0" . as_ptr () as * const c_char) ; table . is_centered = (gd_api . godot_method_bind_get_method) (class_name , "is_centered\0" . as_ptr () as * const c_char) ; table . is_flipped_h = (gd_api . godot_method_bind_get_method) (class_name , "is_flipped_h\0" . as_ptr () as * const c_char) ; table . is_flipped_v = (gd_api . godot_method_bind_get_method) (class_name , "is_flipped_v\0" . as_ptr () as * const c_char) ; table . is_playing = (gd_api . godot_method_bind_get_method) (class_name , "is_playing\0" . as_ptr () as * const c_char) ; table . play = (gd_api . godot_method_bind_get_method) (class_name , "play\0" . as_ptr () as * const c_char) ; table . set_animation = (gd_api . godot_method_bind_get_method) (class_name , "set_animation\0" . as_ptr () as * const c_char) ; table . set_centered = (gd_api . godot_method_bind_get_method) (class_name , "set_centered\0" . as_ptr () as * const c_char) ; table . set_flip_h = (gd_api . godot_method_bind_get_method) (class_name , "set_flip_h\0" . as_ptr () as * const c_char) ; table . set_flip_v = (gd_api . godot_method_bind_get_method) (class_name , "set_flip_v\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_offset = (gd_api . godot_method_bind_get_method) (class_name , "set_offset\0" . as_ptr () as * const c_char) ; table . set_playing = (gd_api . godot_method_bind_get_method) (class_name , "set_playing\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_sprite_frames = (gd_api . godot_method_bind_get_method) (class_name , "set_sprite_frames\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) ; } } } [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:87:9873 [INFO] [stdout] | [INFO] [stdout] 87 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 87 | # ! [doc = "This module contains types related to the API class [`AnimatedSprite3D`][super::AnimatedSprite3D]."] pub (crate) mod private { # [doc = "`core class AnimatedSprite3D` inherits `SpriteBase3D` (manually managed)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_animatedsprite3d.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`AnimatedSprite3D` 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\nAnimatedSprite3D inherits methods from:\n - [SpriteBase3D](struct.SpriteBase3D.html)\n - [GeometryInstance](struct.GeometryInstance.html)\n - [VisualInstance](struct.VisualInstance.html)\n - [CullInstance](struct.CullInstance.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 `Ownership` in these types tracks whether\nownership 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 AnimatedSprite3D { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AnimatedSprite3D ; impl AnimatedSprite3D { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AnimatedSprite3DMethodTable :: 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 animation from the `frames` resource. If this value changes, the `frame` counter is reset."] # [doc = ""] # [inline] pub fn animation (& self) -> GodotString { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimatedSprite3DMethodTable :: get (get_api ()) . get_animation ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < GodotString > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "The displayed animation frame's index."] # [doc = ""] # [inline] pub fn frame (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimatedSprite3DMethodTable :: get (get_api ()) . get_frame ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "The [`SpriteFrames`][SpriteFrames] resource containing the animation(s)."] # [doc = ""] # [inline] pub fn sprite_frames (& self) -> Option < Ref < crate :: generated :: SpriteFrames , ownership :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimatedSprite3DMethodTable :: get (get_api ()) . get_sprite_frames ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < Option < Ref < crate :: generated :: SpriteFrames , ownership :: Shared > > > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns `true` if an animation is currently being played."] # [doc = ""] # [inline] pub fn is_playing (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimatedSprite3DMethodTable :: get (get_api ()) . is_playing ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "Plays the animation named `anim`. If no `anim` is provided, the current animation is played.\n# Default Arguments\n* `anim` - `\"\"`"] # [doc = ""] # [inline] pub fn play (& self , anim : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimatedSprite3DMethodTable :: get (get_api ()) . play ; let ret = crate :: icalls :: icallvar__str (method_bind , self . this . sys () . as_ptr () , anim . into ()) ; } } # [doc = "The current animation from the `frames` resource. If this value changes, the `frame` counter is reset."] # [doc = ""] # [inline] pub fn set_animation (& self , animation : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimatedSprite3DMethodTable :: get (get_api ()) . set_animation ; let ret = crate :: icalls :: icallvar__str (method_bind , self . this . sys () . as_ptr () , animation . into ()) ; } } # [doc = "The displayed animation frame's index."] # [doc = ""] # [inline] pub fn set_frame (& self , frame : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimatedSprite3DMethodTable :: get (get_api ()) . set_frame ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , frame as _) ; } } # [doc = "The [`SpriteFrames`][SpriteFrames] resource containing the animation(s)."] # [doc = ""] # [inline] pub fn set_sprite_frames (& self , sprite_frames : impl AsArg < crate :: generated :: SpriteFrames >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimatedSprite3DMethodTable :: get (get_api ()) . set_sprite_frames ; let ret = crate :: icalls :: icallvar__obj (method_bind , self . this . sys () . as_ptr () , sprite_frames . as_arg_ptr ()) ; } } # [doc = "Stops the current animation (does not reset the frame counter)."] # [doc = ""] # [inline] pub fn stop (& self) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimatedSprite3DMethodTable :: get (get_api ()) . stop ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for AnimatedSprite3D { } unsafe impl GodotObject for AnimatedSprite3D { type Memory = memory :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "AnimatedSprite3D" } } impl QueueFree for AnimatedSprite3D { # [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 :: icallvar_ (method_bind , obj) ; } } impl std :: ops :: Deref for AnimatedSprite3D { type Target = crate :: generated :: SpriteBase3D ; # [inline] fn deref (& self) -> & crate :: generated :: SpriteBase3D { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AnimatedSprite3D { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: SpriteBase3D { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: SpriteBase3D > for AnimatedSprite3D { } unsafe impl SubClass < crate :: generated :: GeometryInstance > for AnimatedSprite3D { } unsafe impl SubClass < crate :: generated :: VisualInstance > for AnimatedSprite3D { } unsafe impl SubClass < crate :: generated :: CullInstance > for AnimatedSprite3D { } unsafe impl SubClass < crate :: generated :: Spatial > for AnimatedSprite3D { } unsafe impl SubClass < crate :: generated :: Node > for AnimatedSprite3D { } unsafe impl SubClass < crate :: generated :: Object > for AnimatedSprite3D { } impl Instanciable for AnimatedSprite3D { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { AnimatedSprite3D :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AnimatedSprite3DMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_animation : * mut sys :: godot_method_bind , pub get_frame : * mut sys :: godot_method_bind , pub get_sprite_frames : * mut sys :: godot_method_bind , pub is_playing : * mut sys :: godot_method_bind , pub play : * mut sys :: godot_method_bind , pub set_animation : * mut sys :: godot_method_bind , pub set_frame : * mut sys :: godot_method_bind , pub set_sprite_frames : * mut sys :: godot_method_bind , pub stop : * mut sys :: godot_method_bind } impl AnimatedSprite3DMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AnimatedSprite3DMethodTable = AnimatedSprite3DMethodTable { class_constructor : None , get_animation : 0 as * mut sys :: godot_method_bind , get_frame : 0 as * mut sys :: godot_method_bind , get_sprite_frames : 0 as * mut sys :: godot_method_bind , is_playing : 0 as * mut sys :: godot_method_bind , play : 0 as * mut sys :: godot_method_bind , set_animation : 0 as * mut sys :: godot_method_bind , set_frame : 0 as * mut sys :: godot_method_bind , set_sprite_frames : 0 as * mut sys :: godot_method_bind , stop : 0 as * mut sys :: godot_method_bind } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { AnimatedSprite3DMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AnimatedSprite3D\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_animation = (gd_api . godot_method_bind_get_method) (class_name , "get_animation\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_sprite_frames = (gd_api . godot_method_bind_get_method) (class_name , "get_sprite_frames\0" . as_ptr () as * const c_char) ; table . is_playing = (gd_api . godot_method_bind_get_method) (class_name , "is_playing\0" . as_ptr () as * const c_char) ; table . play = (gd_api . godot_method_bind_get_method) (class_name , "play\0" . as_ptr () as * const c_char) ; table . set_animation = (gd_api . godot_method_bind_get_method) (class_name , "set_animation\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_sprite_frames = (gd_api . godot_method_bind_get_method) (class_name , "set_sprite_frames\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) ; } } } [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:93:13614 [INFO] [stdout] | [INFO] [stdout] 93 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 93 | # ! [doc = "This module contains types related to the API class [`AnimatedTexture`][super::AnimatedTexture]."] pub (crate) mod private { # [doc = "`core class AnimatedTexture` inherits `Texture` (reference-counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/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 `Ownership` in these types tracks whether\nownership 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 { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AnimatedTexture ; # [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 , ownership :: 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 :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < i64 > :: coerce_from_variant (& ret) } } # [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 [`frames`][Self::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 [`set_frame_delay`][Self::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 :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [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 :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , frame as _) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Returns the given frame's [`Texture`][Texture]."] # [doc = ""] # [inline] pub fn frame_texture (& self , frame : i64) -> Option < Ref < crate :: generated :: Texture , ownership :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimatedTextureMethodTable :: get (get_api ()) . get_frame_texture ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , frame as _) ; < Option < Ref < crate :: generated :: Texture , ownership :: Shared > > > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Number of frames to use in the animation. While you can create the frames independently with [`set_frame_texture`][Self::set_frame_texture], you need to set this value for the animation to take new frames into account. The maximum number of frames is [`MAX_FRAMES`][Self::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 :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < i64 > :: coerce_from_variant (& ret) } } # [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 [`pause`][Self::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 :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "If `true`, the animation will pause where it currently is (i.e. at [`current_frame`][Self::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 :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [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 :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , frame 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 [`frames`][Self::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 [`set_frame_delay`][Self::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 :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , fps as _) ; } } # [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 [`fps`][Self::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 :: icallvar__i64_f64 (method_bind , self . this . sys () . as_ptr () , frame as _ , delay as _) ; } } # [doc = "Assigns a [`Texture`][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 [`frames`][Self::frames] - 1.\nYou can define any number of textures up to [`MAX_FRAMES`][Self::MAX_FRAMES], but keep in mind that only frames from 0 to [`frames`][Self::frames] - 1 will be part of the animation."] # [doc = ""] # [inline] pub fn set_frame_texture (& self , frame : i64 , texture : impl AsArg < crate :: generated :: Texture >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimatedTextureMethodTable :: get (get_api ()) . set_frame_texture ; let ret = crate :: icalls :: icallvar__i64_obj (method_bind , self . this . sys () . as_ptr () , frame as _ , texture . as_arg_ptr ()) ; } } # [doc = "Number of frames to use in the animation. While you can create the frames independently with [`set_frame_texture`][Self::set_frame_texture], you need to set this value for the animation to take new frames into account. The maximum number of frames is [`MAX_FRAMES`][Self::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 :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , frames 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 [`pause`][Self::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 :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , oneshot as _) ; } } # [doc = "If `true`, the animation will pause where it currently is (i.e. at [`current_frame`][Self::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 :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , pause as _) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for AnimatedTexture { } unsafe impl GodotObject for AnimatedTexture { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AnimatedTexture" } } impl std :: ops :: Deref for AnimatedTexture { type Target = crate :: generated :: Texture ; # [inline] fn deref (& self) -> & crate :: generated :: Texture { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AnimatedTexture { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: Texture { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: Texture > for AnimatedTexture { } unsafe impl SubClass < crate :: generated :: Resource > for AnimatedTexture { } unsafe impl SubClass < crate :: generated :: Reference > for AnimatedTexture { } unsafe impl SubClass < crate :: generated :: Object > for AnimatedTexture { } impl Instanciable for AnimatedTexture { # [inline] fn construct () -> Ref < Self , ownership :: 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 } ; &raw 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 = std :: sync :: 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 [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:99:48027 [INFO] [stdout] | [INFO] [stdout] 99 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 99 | # ! [doc = "This module contains types related to the API class [`Animation`][super::Animation]."] pub (crate) mod private { # [doc = "`core class Animation` inherits `Resource` (reference-counted).\n\nThis class has related types in the [`animation`][super::animation] module."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_animation.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\nAnimation 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 `Ownership` in these types tracks whether\nownership 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 Animation { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: Animation ; # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct InterpolationType (pub i64) ; impl InterpolationType { pub const NEAREST : InterpolationType = InterpolationType (0i64) ; pub const LINEAR : InterpolationType = InterpolationType (1i64) ; pub const CUBIC : InterpolationType = InterpolationType (2i64) ; } impl From < i64 > for InterpolationType { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < InterpolationType > for i64 { # [inline] fn from (v : InterpolationType) -> Self { v . 0 } } impl FromVariant for InterpolationType { # [inline] fn from_variant (v : & Variant) -> Result < Self , FromVariantError > { i64 :: from_variant (v) . map (Self :: from) } } # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct TrackType (pub i64) ; impl TrackType { pub const VALUE : TrackType = TrackType (0i64) ; pub const TRANSFORM : TrackType = TrackType (1i64) ; pub const METHOD : TrackType = TrackType (2i64) ; pub const BEZIER : TrackType = TrackType (3i64) ; pub const AUDIO : TrackType = TrackType (4i64) ; pub const ANIMATION : TrackType = TrackType (5i64) ; } impl From < i64 > for TrackType { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < TrackType > for i64 { # [inline] fn from (v : TrackType) -> Self { v . 0 } } impl FromVariant for TrackType { # [inline] fn from_variant (v : & Variant) -> Result < Self , FromVariantError > { i64 :: from_variant (v) . map (Self :: from) } } # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct UpdateMode (pub i64) ; impl UpdateMode { pub const CONTINUOUS : UpdateMode = UpdateMode (0i64) ; pub const DISCRETE : UpdateMode = UpdateMode (1i64) ; pub const TRIGGER : UpdateMode = UpdateMode (2i64) ; pub const CAPTURE : UpdateMode = UpdateMode (3i64) ; } impl From < i64 > for UpdateMode { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < UpdateMode > for i64 { # [inline] fn from (v : UpdateMode) -> Self { v . 0 } } impl FromVariant for UpdateMode { # [inline] fn from_variant (v : & Variant) -> Result < Self , FromVariantError > { i64 :: from_variant (v) . map (Self :: from) } } # [doc = "Constants"] # [allow (non_upper_case_globals)] impl Animation { pub const INTERPOLATION_NEAREST : i64 = 0i64 ; pub const TYPE_VALUE : i64 = 0i64 ; pub const UPDATE_CONTINUOUS : i64 = 0i64 ; pub const INTERPOLATION_LINEAR : i64 = 1i64 ; pub const TYPE_TRANSFORM : i64 = 1i64 ; pub const UPDATE_DISCRETE : i64 = 1i64 ; pub const INTERPOLATION_CUBIC : i64 = 2i64 ; pub const TYPE_METHOD : i64 = 2i64 ; pub const UPDATE_TRIGGER : i64 = 2i64 ; pub const TYPE_BEZIER : i64 = 3i64 ; pub const UPDATE_CAPTURE : i64 = 3i64 ; pub const TYPE_AUDIO : i64 = 4i64 ; pub const TYPE_ANIMATION : i64 = 5i64 ; } impl Animation { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AnimationMethodTable :: 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 track to the Animation.\n# Default Arguments\n* `at_position` - `-1`"] # [doc = ""] # [inline] pub fn add_track (& self , type_ : i64 , at_position : i64) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationMethodTable :: get (get_api ()) . add_track ; let ret = crate :: icalls :: icallvar__i64_i64 (method_bind , self . this . sys () . as_ptr () , type_ as _ , at_position as _) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "Returns the animation name at the key identified by `key_idx`. The `track_idx` must be the index of an Animation Track."] # [doc = ""] # [inline] pub fn animation_track_get_key_animation (& self , track_idx : i64 , key_idx : i64) -> GodotString { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationMethodTable :: get (get_api ()) . animation_track_get_key_animation ; let ret = crate :: icalls :: icallvar__i64_i64 (method_bind , self . this . sys () . as_ptr () , track_idx as _ , key_idx as _) ; < GodotString > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Inserts a key with value `animation` at the given `time` (in seconds). The `track_idx` must be the index of an Animation Track."] # [doc = ""] # [inline] pub fn animation_track_insert_key (& self , track_idx : i64 , time : f64 , animation : impl Into < GodotString >) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationMethodTable :: get (get_api ()) . animation_track_insert_key ; let ret = crate :: icalls :: icallvar__i64_f64_str (method_bind , self . this . sys () . as_ptr () , track_idx as _ , time as _ , animation . into ()) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "Sets the key identified by `key_idx` to value `animation`. The `track_idx` must be the index of an Animation Track."] # [doc = ""] # [inline] pub fn animation_track_set_key_animation (& self , track_idx : i64 , key_idx : i64 , animation : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationMethodTable :: get (get_api ()) . animation_track_set_key_animation ; let ret = crate :: icalls :: icallvar__i64_i64_str (method_bind , self . this . sys () . as_ptr () , track_idx as _ , key_idx as _ , animation . into ()) ; } } # [doc = "Returns the end offset of the key identified by `key_idx`. The `track_idx` must be the index of an Audio Track.\nEnd offset is the number of seconds cut off at the ending of the audio stream."] # [doc = ""] # [inline] pub fn audio_track_get_key_end_offset (& self , track_idx : i64 , key_idx : i64) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationMethodTable :: get (get_api ()) . audio_track_get_key_end_offset ; let ret = crate :: icalls :: icallvar__i64_i64 (method_bind , self . this . sys () . as_ptr () , track_idx as _ , key_idx as _) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Returns the start offset of the key identified by `key_idx`. The `track_idx` must be the index of an Audio Track.\nStart offset is the number of seconds cut off at the beginning of the audio stream."] # [doc = ""] # [inline] pub fn audio_track_get_key_start_offset (& self , track_idx : i64 , key_idx : i64) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationMethodTable :: get (get_api ()) . audio_track_get_key_start_offset ; let ret = crate :: icalls :: icallvar__i64_i64 (method_bind , self . this . sys () . as_ptr () , track_idx as _ , key_idx as _) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Returns the audio stream of the key identified by `key_idx`. The `track_idx` must be the index of an Audio Track."] # [doc = ""] # [inline] pub fn audio_track_get_key_stream (& self , track_idx : i64 , key_idx : i64) -> Option < Ref < crate :: generated :: Resource , ownership :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationMethodTable :: get (get_api ()) . audio_track_get_key_stream ; let ret = crate :: icalls :: icallvar__i64_i64 (method_bind , self . this . sys () . as_ptr () , track_idx as _ , key_idx as _) ; < Option < Ref < crate :: generated :: Resource , ownership :: Shared > > > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Inserts an Audio Track key at the given `time` in seconds. The `track_idx` must be the index of an Audio Track.\n`stream` is the [`AudioStream`][AudioStream] resource to play. `start_offset` is the number of seconds cut off at the beginning of the audio stream, while `end_offset` is at the ending.\n# Default Arguments\n* `start_offset` - `0`\n* `end_offset` - `0`"] # [doc = ""] # [inline] pub fn audio_track_insert_key (& self , track_idx : i64 , time : f64 , stream : impl AsArg < crate :: generated :: Resource > , start_offset : f64 , end_offset : f64) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationMethodTable :: get (get_api ()) . audio_track_insert_key ; let ret = crate :: icalls :: icallvar__i64_f64_obj_f64_f64 (method_bind , self . this . sys () . as_ptr () , track_idx as _ , time as _ , stream . as_arg_ptr () , start_offset as _ , end_offset as _) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "Sets the end offset of the key identified by `key_idx` to value `offset`. The `track_idx` must be the index of an Audio Track."] # [doc = ""] # [inline] pub fn audio_track_set_key_end_offset (& self , track_idx : i64 , key_idx : i64 , offset : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationMethodTable :: get (get_api ()) . audio_track_set_key_end_offset ; let ret = crate :: icalls :: icallvar__i64_i64_f64 (method_bind , self . this . sys () . as_ptr () , track_idx as _ , key_idx as _ , offset as _) ; } } # [doc = "Sets the start offset of the key identified by `key_idx` to value `offset`. The `track_idx` must be the index of an Audio Track."] # [doc = ""] # [inline] pub fn audio_track_set_key_start_offset (& self , track_idx : i64 , key_idx : i64 , offset : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationMethodTable :: get (get_api ()) . audio_track_set_key_start_offset ; let ret = crate :: icalls :: icallvar__i64_i64_f64 (method_bind , self . this . sys () . as_ptr () , track_idx as _ , key_idx as _ , offset as _) ; } } # [doc = "Sets the stream of the key identified by `key_idx` to value `stream`. The `track_idx` must be the index of an Audio Track."] # [doc = ""] # [inline] pub fn audio_track_set_key_stream (& self , track_idx : i64 , key_idx : i64 , stream : impl AsArg < crate :: generated :: Resource >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationMethodTable :: get (get_api ()) . audio_track_set_key_stream ; let ret = crate :: icalls :: icallvar__i64_i64_obj (method_bind , self . this . sys () . as_ptr () , track_idx as _ , key_idx as _ , stream . as_arg_ptr ()) ; } } # [doc = "Returns the in handle of the key identified by `key_idx`. The `track_idx` must be the index of a Bezier Track."] # [doc = ""] # [inline] pub fn bezier_track_get_key_in_handle (& self , track_idx : i64 , key_idx : i64) -> Vector2 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationMethodTable :: get (get_api ()) . bezier_track_get_key_in_handle ; let ret = crate :: icalls :: icallvar__i64_i64 (method_bind , self . this . sys () . as_ptr () , track_idx as _ , key_idx as _) ; < Vector2 > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns the out handle of the key identified by `key_idx`. The `track_idx` must be the index of a Bezier Track."] # [doc = ""] # [inline] pub fn bezier_track_get_key_out_handle (& self , track_idx : i64 , key_idx : i64) -> Vector2 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationMethodTable :: get (get_api ()) . bezier_track_get_key_out_handle ; let ret = crate :: icalls :: icallvar__i64_i64 (method_bind , self . this . sys () . as_ptr () , track_idx as _ , key_idx as _) ; < Vector2 > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns the value of the key identified by `key_idx`. The `track_idx` must be the index of a Bezier Track."] # [doc = ""] # [inline] pub fn bezier_track_get_key_value (& self , track_idx : i64 , key_idx : i64) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationMethodTable :: get (get_api ()) . bezier_track_get_key_value ; let ret = crate :: icalls :: icallvar__i64_i64 (method_bind , self . this . sys () . as_ptr () , track_idx as _ , key_idx as _) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Inserts a Bezier Track key at the given `time` in seconds. The `track_idx` must be the index of a Bezier Track.\n`in_handle` is the left-side weight of the added Bezier curve point, `out_handle` is the right-side one, while `value` is the actual value at this point.\n# Default Arguments\n* `in_handle` - `Vector2( 0, 0 )`\n* `out_handle` - `Vector2( 0, 0 )`"] # [doc = ""] # [inline] pub fn bezier_track_insert_key (& self , track_idx : i64 , time : f64 , value : f64 , in_handle : Vector2 , out_handle : Vector2) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationMethodTable :: get (get_api ()) . bezier_track_insert_key ; let ret = crate :: icalls :: icallvar__i64_f64_f64_vec2_vec2 (method_bind , self . this . sys () . as_ptr () , track_idx as _ , time as _ , value as _ , in_handle , out_handle) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "Returns the interpolated value at the given `time` (in seconds). The `track_idx` must be the index of a Bezier Track."] # [doc = ""] # [inline] pub fn bezier_track_interpolate (& self , track_idx : i64 , time : f64) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationMethodTable :: get (get_api ()) . bezier_track_interpolate ; let ret = crate :: icalls :: icallvar__i64_f64 (method_bind , self . this . sys () . as_ptr () , track_idx as _ , time as _) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Sets the in handle of the key identified by `key_idx` to value `in_handle`. The `track_idx` must be the index of a Bezier Track."] # [doc = ""] # [inline] pub fn bezier_track_set_key_in_handle (& self , track_idx : i64 , key_idx : i64 , in_handle : Vector2) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationMethodTable :: get (get_api ()) . bezier_track_set_key_in_handle ; let ret = crate :: icalls :: icallvar__i64_i64_vec2 (method_bind , self . this . sys () . as_ptr () , track_idx as _ , key_idx as _ , in_handle) ; } } # [doc = "Sets the out handle of the key identified by `key_idx` to value `out_handle`. The `track_idx` must be the index of a Bezier Track."] # [doc = ""] # [inline] pub fn bezier_track_set_key_out_handle (& self , track_idx : i64 , key_idx : i64 , out_handle : Vector2) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationMethodTable :: get (get_api ()) . bezier_track_set_key_out_handle ; let ret = crate :: icalls :: icallvar__i64_i64_vec2 (method_bind , self . this . sys () . as_ptr () , track_idx as _ , key_idx as _ , out_handle) ; } } # [doc = "Sets the value of the key identified by `key_idx` to the given value. The `track_idx` must be the index of a Bezier Track."] # [doc = ""] # [inline] pub fn bezier_track_set_key_value (& self , track_idx : i64 , key_idx : i64 , value : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationMethodTable :: get (get_api ()) . bezier_track_set_key_value ; let ret = crate :: icalls :: icallvar__i64_i64_f64 (method_bind , self . this . sys () . as_ptr () , track_idx as _ , key_idx as _ , value as _) ; } } # [doc = "Clear the animation (clear all tracks and reset all)."] # [doc = ""] # [inline] pub fn clear (& self) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationMethodTable :: get (get_api ()) . clear ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; } } # [doc = "Adds a new track that is a copy of the given track from `to_animation`."] # [doc = ""] # [inline] pub fn copy_track (& self , track_idx : i64 , to_animation : impl AsArg < crate :: generated :: Animation >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationMethodTable :: get (get_api ()) . copy_track ; let ret = crate :: icalls :: icallvar__i64_obj (method_bind , self . this . sys () . as_ptr () , track_idx as _ , to_animation . as_arg_ptr ()) ; } } # [doc = "Returns the index of the specified track. If the track is not found, return -1."] # [doc = ""] # [inline] pub fn find_track (& self , path : impl Into < NodePath >) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationMethodTable :: get (get_api ()) . find_track ; let ret = crate :: icalls :: icallvar__nodepath (method_bind , self . this . sys () . as_ptr () , path . into ()) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "The total length of the animation (in seconds).\n**Note:** Length is not delimited by the last key, as this one may be before or after the end to ensure correct interpolation and looping."] # [doc = ""] # [inline] pub fn length (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationMethodTable :: get (get_api ()) . get_length ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "The animation step value."] # [doc = ""] # [inline] pub fn step (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationMethodTable :: get (get_api ()) . get_step ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Returns the amount of tracks in the animation."] # [doc = ""] # [inline] pub fn get_track_count (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationMethodTable :: get (get_api ()) . get_track_count ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "A flag indicating that the animation must loop. This is used for correct interpolation of animation cycles, and for hinting the player that it must restart the animation."] # [doc = ""] # [inline] pub fn has_loop (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationMethodTable :: get (get_api ()) . has_loop ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "Returns all the key indices of a method track, given a position and delta time."] # [doc = ""] # [inline] pub fn method_track_get_key_indices (& self , track_idx : i64 , time_sec : f64 , delta : f64) -> PoolArray < i32 > { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationMethodTable :: get (get_api ()) . method_track_get_key_indices ; let ret = crate :: icalls :: icallvar__i64_f64_f64 (method_bind , self . this . sys () . as_ptr () , track_idx as _ , time_sec as _ , delta as _) ; < PoolArray < i32 > > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns the method name of a method track."] # [doc = ""] # [inline] pub fn method_track_get_name (& self , track_idx : i64 , key_idx : i64) -> GodotString { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationMethodTable :: get (get_api ()) . method_track_get_name ; let ret = crate :: icalls :: icallvar__i64_i64 (method_bind , self . this . sys () . as_ptr () , track_idx as _ , key_idx as _) ; < GodotString > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns the arguments values to be called on a method track for a given key in a given track."] # [doc = ""] # [inline] pub fn method_track_get_params (& self , track_idx : i64 , key_idx : i64) -> VariantArray { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationMethodTable :: get (get_api ()) . method_track_get_params ; let ret = crate :: icalls :: icallvar__i64_i64 (method_bind , self . this . sys () . as_ptr () , track_idx as _ , key_idx as _) ; < VariantArray > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Removes a track by specifying the track index."] # [doc = ""] # [inline] pub fn remove_track (& self , track_idx : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationMethodTable :: get (get_api ()) . remove_track ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , track_idx as _) ; } } # [doc = "The total length of the animation (in seconds).\n**Note:** Length is not delimited by the last key, as this one may be before or after the end to ensure correct interpolation and looping."] # [doc = ""] # [inline] pub fn set_length (& self , time_sec : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationMethodTable :: get (get_api ()) . set_length ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , time_sec as _) ; } } # [doc = "A flag indicating that the animation must loop. This is used for correct interpolation of animation cycles, and for hinting the player that it must restart the animation."] # [doc = ""] # [inline] pub fn set_loop (& self , enabled : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationMethodTable :: get (get_api ()) . set_loop ; let ret = crate :: icalls :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , enabled as _) ; } } # [doc = "The animation step value."] # [doc = ""] # [inline] pub fn set_step (& self , size_sec : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationMethodTable :: get (get_api ()) . set_step ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , size_sec as _) ; } } # [doc = "Finds the key index by time in a given track. Optionally, only find it if the exact time is given.\n# Default Arguments\n* `exact` - `false`"] # [doc = ""] # [inline] pub fn track_find_key (& self , track_idx : i64 , time : f64 , exact : bool) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationMethodTable :: get (get_api ()) . track_find_key ; let ret = crate :: icalls :: icallvar__i64_f64_bool (method_bind , self . this . sys () . as_ptr () , track_idx as _ , time as _ , exact as _) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "Returns `true` if the track at `idx` wraps the interpolation loop. New tracks wrap the interpolation loop by default."] # [doc = ""] # [inline] pub fn track_get_interpolation_loop_wrap (& self , track_idx : i64) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationMethodTable :: get (get_api ()) . track_get_interpolation_loop_wrap ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , track_idx as _) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "Returns the interpolation type of a given track."] # [doc = ""] # [inline] pub fn track_get_interpolation_type (& self , track_idx : i64) -> crate :: generated :: animation :: InterpolationType { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationMethodTable :: get (get_api ()) . track_get_interpolation_type ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , track_idx as _) ; < crate :: generated :: animation :: InterpolationType > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns the amount of keys in a given track."] # [doc = ""] # [inline] pub fn track_get_key_count (& self , track_idx : i64) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationMethodTable :: get (get_api ()) . track_get_key_count ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , track_idx as _) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "Returns the time at which the key is located."] # [doc = ""] # [inline] pub fn track_get_key_time (& self , track_idx : i64 , key_idx : i64) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationMethodTable :: get (get_api ()) . track_get_key_time ; let ret = crate :: icalls :: icallvar__i64_i64 (method_bind , self . this . sys () . as_ptr () , track_idx as _ , key_idx as _) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Returns the transition curve (easing) for a specific key (see the built-in math function [method @GDScript.ease])."] # [doc = ""] # [inline] pub fn track_get_key_transition (& self , track_idx : i64 , key_idx : i64) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationMethodTable :: get (get_api ()) . track_get_key_transition ; let ret = crate :: icalls :: icallvar__i64_i64 (method_bind , self . this . sys () . as_ptr () , track_idx as _ , key_idx as _) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Returns the value of a given key in a given track."] # [doc = ""] # [inline] pub fn track_get_key_value (& self , track_idx : i64 , key_idx : i64) -> Variant { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationMethodTable :: get (get_api ()) . track_get_key_value ; let ret = crate :: icalls :: icallvar__i64_i64 (method_bind , self . this . sys () . as_ptr () , track_idx as _ , key_idx as _) ; < Variant > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Gets the path of a track. For more information on the path format, see [`track_set_path`][Self::track_set_path]."] # [doc = ""] # [inline] pub fn track_get_path (& self , track_idx : i64) -> NodePath { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationMethodTable :: get (get_api ()) . track_get_path ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , track_idx as _) ; < NodePath > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Gets the type of a track."] # [doc = ""] # [inline] pub fn track_get_type (& self , track_idx : i64) -> crate :: generated :: animation :: TrackType { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationMethodTable :: get (get_api ()) . track_get_type ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , track_idx as _) ; < crate :: generated :: animation :: TrackType > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Insert a generic key in a given track.\n# Default Arguments\n* `transition` - `1`"] # [doc = ""] # [inline] pub fn track_insert_key (& self , track_idx : i64 , time : f64 , key : impl OwnedToVariant , transition : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationMethodTable :: get (get_api ()) . track_insert_key ; let ret = crate :: icalls :: icallvar__i64_f64_var_f64 (method_bind , self . this . sys () . as_ptr () , track_idx as _ , time as _ , key . owned_to_variant () , transition as _) ; } } # [doc = "Returns `true` if the track at index `idx` is enabled."] # [doc = ""] # [inline] pub fn track_is_enabled (& self , track_idx : i64) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationMethodTable :: get (get_api ()) . track_is_enabled ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , track_idx as _) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "Returns `true` if the given track is imported. Else, return `false`."] # [doc = ""] # [inline] pub fn track_is_imported (& self , track_idx : i64) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationMethodTable :: get (get_api ()) . track_is_imported ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , track_idx as _) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "Moves a track down."] # [doc = ""] # [inline] pub fn track_move_down (& self , track_idx : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationMethodTable :: get (get_api ()) . track_move_down ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , track_idx as _) ; } } # [doc = "Changes the index position of track `idx` to the one defined in `to_idx`."] # [doc = ""] # [inline] pub fn track_move_to (& self , track_idx : i64 , to_idx : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationMethodTable :: get (get_api ()) . track_move_to ; let ret = crate :: icalls :: icallvar__i64_i64 (method_bind , self . this . sys () . as_ptr () , track_idx as _ , to_idx as _) ; } } # [doc = "Moves a track up."] # [doc = ""] # [inline] pub fn track_move_up (& self , track_idx : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationMethodTable :: get (get_api ()) . track_move_up ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , track_idx as _) ; } } # [doc = "Removes a key by index in a given track."] # [doc = ""] # [inline] pub fn track_remove_key (& self , track_idx : i64 , key_idx : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationMethodTable :: get (get_api ()) . track_remove_key ; let ret = crate :: icalls :: icallvar__i64_i64 (method_bind , self . this . sys () . as_ptr () , track_idx as _ , key_idx as _) ; } } # [doc = "Removes a key by position (seconds) in a given track."] # [doc = ""] # [inline] pub fn track_remove_key_at_position (& self , track_idx : i64 , position : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationMethodTable :: get (get_api ()) . track_remove_key_at_position ; let ret = crate :: icalls :: icallvar__i64_f64 (method_bind , self . this . sys () . as_ptr () , track_idx as _ , position as _) ; } } # [doc = "Enables/disables the given track. Tracks are enabled by default."] # [doc = ""] # [inline] pub fn track_set_enabled (& self , track_idx : i64 , enabled : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationMethodTable :: get (get_api ()) . track_set_enabled ; let ret = crate :: icalls :: icallvar__i64_bool (method_bind , self . this . sys () . as_ptr () , track_idx as _ , enabled as _) ; } } # [doc = "Sets the given track as imported or not."] # [doc = ""] # [inline] pub fn track_set_imported (& self , track_idx : i64 , imported : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationMethodTable :: get (get_api ()) . track_set_imported ; let ret = crate :: icalls :: icallvar__i64_bool (method_bind , self . this . sys () . as_ptr () , track_idx as _ , imported as _) ; } } # [doc = "If `true`, the track at `idx` wraps the interpolation loop."] # [doc = ""] # [inline] pub fn track_set_interpolation_loop_wrap (& self , track_idx : i64 , interpolation : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationMethodTable :: get (get_api ()) . track_set_interpolation_loop_wrap ; let ret = crate :: icalls :: icallvar__i64_bool (method_bind , self . this . sys () . as_ptr () , track_idx as _ , interpolation as _) ; } } # [doc = "Sets the interpolation type of a given track."] # [doc = ""] # [inline] pub fn track_set_interpolation_type (& self , track_idx : i64 , interpolation : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationMethodTable :: get (get_api ()) . track_set_interpolation_type ; let ret = crate :: icalls :: icallvar__i64_i64 (method_bind , self . this . sys () . as_ptr () , track_idx as _ , interpolation as _) ; } } # [doc = "Sets the time of an existing key."] # [doc = ""] # [inline] pub fn track_set_key_time (& self , track_idx : i64 , key_idx : i64 , time : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationMethodTable :: get (get_api ()) . track_set_key_time ; let ret = crate :: icalls :: icallvar__i64_i64_f64 (method_bind , self . this . sys () . as_ptr () , track_idx as _ , key_idx as _ , time as _) ; } } # [doc = "Sets the transition curve (easing) for a specific key (see the built-in math function [method @GDScript.ease])."] # [doc = ""] # [inline] pub fn track_set_key_transition (& self , track_idx : i64 , key_idx : i64 , transition : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationMethodTable :: get (get_api ()) . track_set_key_transition ; let ret = crate :: icalls :: icallvar__i64_i64_f64 (method_bind , self . this . sys () . as_ptr () , track_idx as _ , key_idx as _ , transition as _) ; } } # [doc = "Sets the value of an existing key."] # [doc = ""] # [inline] pub fn track_set_key_value (& self , track_idx : i64 , key : i64 , value : impl OwnedToVariant) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationMethodTable :: get (get_api ()) . track_set_key_value ; let ret = crate :: icalls :: icallvar__i64_i64_var (method_bind , self . this . sys () . as_ptr () , track_idx as _ , key as _ , value . owned_to_variant ()) ; } } # [doc = "Sets the path of a track. Paths must be valid scene-tree paths to a node and must be specified starting from the parent node of the node that will reproduce the animation. Tracks that control properties or bones must append their name after the path, separated by `\":\"`.\nFor example, `\"character/skeleton:ankle\"` or `\"character/mesh:transform/local\"`."] # [doc = ""] # [inline] pub fn track_set_path (& self , track_idx : i64 , path : impl Into < NodePath >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationMethodTable :: get (get_api ()) . track_set_path ; let ret = crate :: icalls :: icallvar__i64_nodepath (method_bind , self . this . sys () . as_ptr () , track_idx as _ , path . into ()) ; } } # [doc = "Swaps the track `idx`'s index position with the track `with_idx`."] # [doc = ""] # [inline] pub fn track_swap (& self , track_idx : i64 , with_idx : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationMethodTable :: get (get_api ()) . track_swap ; let ret = crate :: icalls :: icallvar__i64_i64 (method_bind , self . this . sys () . as_ptr () , track_idx as _ , with_idx as _) ; } } # [doc = "Insert a transform key for a transform track."] # [doc = ""] # [inline] pub fn transform_track_insert_key (& self , track_idx : i64 , time : f64 , location : Vector3 , rotation : Quat , scale : Vector3) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationMethodTable :: get (get_api ()) . transform_track_insert_key ; let ret = crate :: icalls :: icallvar__i64_f64_vec3_quat_vec3 (method_bind , self . this . sys () . as_ptr () , track_idx as _ , time as _ , location , rotation , scale) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "Returns the interpolated value of a transform track at a given time (in seconds). An array consisting of 3 elements: position ([`Vector3`][Vector3]), rotation ([`Quat`][Quat]) and scale ([`Vector3`][Vector3])."] # [doc = ""] # [inline] pub fn transform_track_interpolate (& self , track_idx : i64 , time_sec : f64) -> VariantArray { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationMethodTable :: get (get_api ()) . transform_track_interpolate ; let ret = crate :: icalls :: icallvar__i64_f64 (method_bind , self . this . sys () . as_ptr () , track_idx as _ , time_sec as _) ; < VariantArray > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns all the key indices of a value track, given a position and delta time."] # [doc = ""] # [inline] pub fn value_track_get_key_indices (& self , track_idx : i64 , time_sec : f64 , delta : f64) -> PoolArray < i32 > { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationMethodTable :: get (get_api ()) . value_track_get_key_indices ; let ret = crate :: icalls :: icallvar__i64_f64_f64 (method_bind , self . this . sys () . as_ptr () , track_idx as _ , time_sec as _ , delta as _) ; < PoolArray < i32 > > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns the update mode of a value track."] # [doc = ""] # [inline] pub fn value_track_get_update_mode (& self , track_idx : i64) -> crate :: generated :: animation :: UpdateMode { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationMethodTable :: get (get_api ()) . value_track_get_update_mode ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , track_idx as _) ; < crate :: generated :: animation :: UpdateMode > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns the interpolated value at the given time (in seconds). The `track_idx` must be the index of a value track."] # [doc = ""] # [inline] pub fn value_track_interpolate (& self , track_idx : i64 , time_sec : f64) -> Variant { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationMethodTable :: get (get_api ()) . value_track_interpolate ; let ret = crate :: icalls :: icallvar__i64_f64 (method_bind , self . this . sys () . as_ptr () , track_idx as _ , time_sec as _) ; < Variant > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Sets the update mode (see [`UpdateMode`][UpdateMode]) of a value track."] # [doc = ""] # [inline] pub fn value_track_set_update_mode (& self , track_idx : i64 , mode : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationMethodTable :: get (get_api ()) . value_track_set_update_mode ; let ret = crate :: icalls :: icallvar__i64_i64 (method_bind , self . this . sys () . as_ptr () , track_idx as _ , mode as _) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for Animation { } unsafe impl GodotObject for Animation { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "Animation" } } impl std :: ops :: Deref for Animation { type Target = crate :: generated :: Resource ; # [inline] fn deref (& self) -> & crate :: generated :: Resource { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for Animation { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: Resource { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: Resource > for Animation { } unsafe impl SubClass < crate :: generated :: Reference > for Animation { } unsafe impl SubClass < crate :: generated :: Object > for Animation { } impl Instanciable for Animation { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { Animation :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AnimationMethodTable { pub class_constructor : sys :: godot_class_constructor , pub add_track : * mut sys :: godot_method_bind , pub animation_track_get_key_animation : * mut sys :: godot_method_bind , pub animation_track_insert_key : * mut sys :: godot_method_bind , pub animation_track_set_key_animation : * mut sys :: godot_method_bind , pub audio_track_get_key_end_offset : * mut sys :: godot_method_bind , pub audio_track_get_key_start_offset : * mut sys :: godot_method_bind , pub audio_track_get_key_stream : * mut sys :: godot_method_bind , pub audio_track_insert_key : * mut sys :: godot_method_bind , pub audio_track_set_key_end_offset : * mut sys :: godot_method_bind , pub audio_track_set_key_start_offset : * mut sys :: godot_method_bind , pub audio_track_set_key_stream : * mut sys :: godot_method_bind , pub bezier_track_get_key_in_handle : * mut sys :: godot_method_bind , pub bezier_track_get_key_out_handle : * mut sys :: godot_method_bind , pub bezier_track_get_key_value : * mut sys :: godot_method_bind , pub bezier_track_insert_key : * mut sys :: godot_method_bind , pub bezier_track_interpolate : * mut sys :: godot_method_bind , pub bezier_track_set_key_in_handle : * mut sys :: godot_method_bind , pub bezier_track_set_key_out_handle : * mut sys :: godot_method_bind , pub bezier_track_set_key_value : * mut sys :: godot_method_bind , pub clear : * mut sys :: godot_method_bind , pub copy_track : * mut sys :: godot_method_bind , pub find_track : * mut sys :: godot_method_bind , pub get_length : * mut sys :: godot_method_bind , pub get_step : * mut sys :: godot_method_bind , pub get_track_count : * mut sys :: godot_method_bind , pub has_loop : * mut sys :: godot_method_bind , pub method_track_get_key_indices : * mut sys :: godot_method_bind , pub method_track_get_name : * mut sys :: godot_method_bind , pub method_track_get_params : * mut sys :: godot_method_bind , pub remove_track : * mut sys :: godot_method_bind , pub set_length : * mut sys :: godot_method_bind , pub set_loop : * mut sys :: godot_method_bind , pub set_step : * mut sys :: godot_method_bind , pub track_find_key : * mut sys :: godot_method_bind , pub track_get_interpolation_loop_wrap : * mut sys :: godot_method_bind , pub track_get_interpolation_type : * mut sys :: godot_method_bind , pub track_get_key_count : * mut sys :: godot_method_bind , pub track_get_key_time : * mut sys :: godot_method_bind , pub track_get_key_transition : * mut sys :: godot_method_bind , pub track_get_key_value : * mut sys :: godot_method_bind , pub track_get_path : * mut sys :: godot_method_bind , pub track_get_type : * mut sys :: godot_method_bind , pub track_insert_key : * mut sys :: godot_method_bind , pub track_is_enabled : * mut sys :: godot_method_bind , pub track_is_imported : * mut sys :: godot_method_bind , pub track_move_down : * mut sys :: godot_method_bind , pub track_move_to : * mut sys :: godot_method_bind , pub track_move_up : * mut sys :: godot_method_bind , pub track_remove_key : * mut sys :: godot_method_bind , pub track_remove_key_at_position : * mut sys :: godot_method_bind , pub track_set_enabled : * mut sys :: godot_method_bind , pub track_set_imported : * mut sys :: godot_method_bind , pub track_set_interpolation_loop_wrap : * mut sys :: godot_method_bind , pub track_set_interpolation_type : * mut sys :: godot_method_bind , pub track_set_key_time : * mut sys :: godot_method_bind , pub track_set_key_transition : * mut sys :: godot_method_bind , pub track_set_key_value : * mut sys :: godot_method_bind , pub track_set_path : * mut sys :: godot_method_bind , pub track_swap : * mut sys :: godot_method_bind , pub transform_track_insert_key : * mut sys :: godot_method_bind , pub transform_track_interpolate : * mut sys :: godot_method_bind , pub value_track_get_key_indices : * mut sys :: godot_method_bind , pub value_track_get_update_mode : * mut sys :: godot_method_bind , pub value_track_interpolate : * mut sys :: godot_method_bind , pub value_track_set_update_mode : * mut sys :: godot_method_bind } impl AnimationMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AnimationMethodTable = AnimationMethodTable { class_constructor : None , add_track : 0 as * mut sys :: godot_method_bind , animation_track_get_key_animation : 0 as * mut sys :: godot_method_bind , animation_track_insert_key : 0 as * mut sys :: godot_method_bind , animation_track_set_key_animation : 0 as * mut sys :: godot_method_bind , audio_track_get_key_end_offset : 0 as * mut sys :: godot_method_bind , audio_track_get_key_start_offset : 0 as * mut sys :: godot_method_bind , audio_track_get_key_stream : 0 as * mut sys :: godot_method_bind , audio_track_insert_key : 0 as * mut sys :: godot_method_bind , audio_track_set_key_end_offset : 0 as * mut sys :: godot_method_bind , audio_track_set_key_start_offset : 0 as * mut sys :: godot_method_bind , audio_track_set_key_stream : 0 as * mut sys :: godot_method_bind , bezier_track_get_key_in_handle : 0 as * mut sys :: godot_method_bind , bezier_track_get_key_out_handle : 0 as * mut sys :: godot_method_bind , bezier_track_get_key_value : 0 as * mut sys :: godot_method_bind , bezier_track_insert_key : 0 as * mut sys :: godot_method_bind , bezier_track_interpolate : 0 as * mut sys :: godot_method_bind , bezier_track_set_key_in_handle : 0 as * mut sys :: godot_method_bind , bezier_track_set_key_out_handle : 0 as * mut sys :: godot_method_bind , bezier_track_set_key_value : 0 as * mut sys :: godot_method_bind , clear : 0 as * mut sys :: godot_method_bind , copy_track : 0 as * mut sys :: godot_method_bind , find_track : 0 as * mut sys :: godot_method_bind , get_length : 0 as * mut sys :: godot_method_bind , get_step : 0 as * mut sys :: godot_method_bind , get_track_count : 0 as * mut sys :: godot_method_bind , has_loop : 0 as * mut sys :: godot_method_bind , method_track_get_key_indices : 0 as * mut sys :: godot_method_bind , method_track_get_name : 0 as * mut sys :: godot_method_bind , method_track_get_params : 0 as * mut sys :: godot_method_bind , remove_track : 0 as * mut sys :: godot_method_bind , set_length : 0 as * mut sys :: godot_method_bind , set_loop : 0 as * mut sys :: godot_method_bind , set_step : 0 as * mut sys :: godot_method_bind , track_find_key : 0 as * mut sys :: godot_method_bind , track_get_interpolation_loop_wrap : 0 as * mut sys :: godot_method_bind , track_get_interpolation_type : 0 as * mut sys :: godot_method_bind , track_get_key_count : 0 as * mut sys :: godot_method_bind , track_get_key_time : 0 as * mut sys :: godot_method_bind , track_get_key_transition : 0 as * mut sys :: godot_method_bind , track_get_key_value : 0 as * mut sys :: godot_method_bind , track_get_path : 0 as * mut sys :: godot_method_bind , track_get_type : 0 as * mut sys :: godot_method_bind , track_insert_key : 0 as * mut sys :: godot_method_bind , track_is_enabled : 0 as * mut sys :: godot_method_bind , track_is_imported : 0 as * mut sys :: godot_method_bind , track_move_down : 0 as * mut sys :: godot_method_bind , track_move_to : 0 as * mut sys :: godot_method_bind , track_move_up : 0 as * mut sys :: godot_method_bind , track_remove_key : 0 as * mut sys :: godot_method_bind , track_remove_key_at_position : 0 as * mut sys :: godot_method_bind , track_set_enabled : 0 as * mut sys :: godot_method_bind , track_set_imported : 0 as * mut sys :: godot_method_bind , track_set_interpolation_loop_wrap : 0 as * mut sys :: godot_method_bind , track_set_interpolation_type : 0 as * mut sys :: godot_method_bind , track_set_key_time : 0 as * mut sys :: godot_method_bind , track_set_key_transition : 0 as * mut sys :: godot_method_bind , track_set_key_value : 0 as * mut sys :: godot_method_bind , track_set_path : 0 as * mut sys :: godot_method_bind , track_swap : 0 as * mut sys :: godot_method_bind , transform_track_insert_key : 0 as * mut sys :: godot_method_bind , transform_track_interpolate : 0 as * mut sys :: godot_method_bind , value_track_get_key_indices : 0 as * mut sys :: godot_method_bind , value_track_get_update_mode : 0 as * mut sys :: godot_method_bind , value_track_interpolate : 0 as * mut sys :: godot_method_bind , value_track_set_update_mode : 0 as * mut sys :: godot_method_bind } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { AnimationMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "Animation\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . add_track = (gd_api . godot_method_bind_get_method) (class_name , "add_track\0" . as_ptr () as * const c_char) ; table . animation_track_get_key_animation = (gd_api . godot_method_bind_get_method) (class_name , "animation_track_get_key_animation\0" . as_ptr () as * const c_char) ; table . animation_track_insert_key = (gd_api . godot_method_bind_get_method) (class_name , "animation_track_insert_key\0" . as_ptr () as * const c_char) ; table . animation_track_set_key_animation = (gd_api . godot_method_bind_get_method) (class_name , "animation_track_set_key_animation\0" . as_ptr () as * const c_char) ; table . audio_track_get_key_end_offset = (gd_api . godot_method_bind_get_method) (class_name , "audio_track_get_key_end_offset\0" . as_ptr () as * const c_char) ; table . audio_track_get_key_start_offset = (gd_api . godot_method_bind_get_method) (class_name , "audio_track_get_key_start_offset\0" . as_ptr () as * const c_char) ; table . audio_track_get_key_stream = (gd_api . godot_method_bind_get_method) (class_name , "audio_track_get_key_stream\0" . as_ptr () as * const c_char) ; table . audio_track_insert_key = (gd_api . godot_method_bind_get_method) (class_name , "audio_track_insert_key\0" . as_ptr () as * const c_char) ; table . audio_track_set_key_end_offset = (gd_api . godot_method_bind_get_method) (class_name , "audio_track_set_key_end_offset\0" . as_ptr () as * const c_char) ; table . audio_track_set_key_start_offset = (gd_api . godot_method_bind_get_method) (class_name , "audio_track_set_key_start_offset\0" . as_ptr () as * const c_char) ; table . audio_track_set_key_stream = (gd_api . godot_method_bind_get_method) (class_name , "audio_track_set_key_stream\0" . as_ptr () as * const c_char) ; table . bezier_track_get_key_in_handle = (gd_api . godot_method_bind_get_method) (class_name , "bezier_track_get_key_in_handle\0" . as_ptr () as * const c_char) ; table . bezier_track_get_key_out_handle = (gd_api . godot_method_bind_get_method) (class_name , "bezier_track_get_key_out_handle\0" . as_ptr () as * const c_char) ; table . bezier_track_get_key_value = (gd_api . godot_method_bind_get_method) (class_name , "bezier_track_get_key_value\0" . as_ptr () as * const c_char) ; table . bezier_track_insert_key = (gd_api . godot_method_bind_get_method) (class_name , "bezier_track_insert_key\0" . as_ptr () as * const c_char) ; table . bezier_track_interpolate = (gd_api . godot_method_bind_get_method) (class_name , "bezier_track_interpolate\0" . as_ptr () as * const c_char) ; table . bezier_track_set_key_in_handle = (gd_api . godot_method_bind_get_method) (class_name , "bezier_track_set_key_in_handle\0" . as_ptr () as * const c_char) ; table . bezier_track_set_key_out_handle = (gd_api . godot_method_bind_get_method) (class_name , "bezier_track_set_key_out_handle\0" . as_ptr () as * const c_char) ; table . bezier_track_set_key_value = (gd_api . godot_method_bind_get_method) (class_name , "bezier_track_set_key_value\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 . copy_track = (gd_api . godot_method_bind_get_method) (class_name , "copy_track\0" . as_ptr () as * const c_char) ; table . find_track = (gd_api . godot_method_bind_get_method) (class_name , "find_track\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_step = (gd_api . godot_method_bind_get_method) (class_name , "get_step\0" . as_ptr () as * const c_char) ; table . get_track_count = (gd_api . godot_method_bind_get_method) (class_name , "get_track_count\0" . as_ptr () as * const c_char) ; table . has_loop = (gd_api . godot_method_bind_get_method) (class_name , "has_loop\0" . as_ptr () as * const c_char) ; table . method_track_get_key_indices = (gd_api . godot_method_bind_get_method) (class_name , "method_track_get_key_indices\0" . as_ptr () as * const c_char) ; table . method_track_get_name = (gd_api . godot_method_bind_get_method) (class_name , "method_track_get_name\0" . as_ptr () as * const c_char) ; table . method_track_get_params = (gd_api . godot_method_bind_get_method) (class_name , "method_track_get_params\0" . as_ptr () as * const c_char) ; table . remove_track = (gd_api . godot_method_bind_get_method) (class_name , "remove_track\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_loop = (gd_api . godot_method_bind_get_method) (class_name , "set_loop\0" . as_ptr () as * const c_char) ; table . set_step = (gd_api . godot_method_bind_get_method) (class_name , "set_step\0" . as_ptr () as * const c_char) ; table . track_find_key = (gd_api . godot_method_bind_get_method) (class_name , "track_find_key\0" . as_ptr () as * const c_char) ; table . track_get_interpolation_loop_wrap = (gd_api . godot_method_bind_get_method) (class_name , "track_get_interpolation_loop_wrap\0" . as_ptr () as * const c_char) ; table . track_get_interpolation_type = (gd_api . godot_method_bind_get_method) (class_name , "track_get_interpolation_type\0" . as_ptr () as * const c_char) ; table . track_get_key_count = (gd_api . godot_method_bind_get_method) (class_name , "track_get_key_count\0" . as_ptr () as * const c_char) ; table . track_get_key_time = (gd_api . godot_method_bind_get_method) (class_name , "track_get_key_time\0" . as_ptr () as * const c_char) ; table . track_get_key_transition = (gd_api . godot_method_bind_get_method) (class_name , "track_get_key_transition\0" . as_ptr () as * const c_char) ; table . track_get_key_value = (gd_api . godot_method_bind_get_method) (class_name , "track_get_key_value\0" . as_ptr () as * const c_char) ; table . track_get_path = (gd_api . godot_method_bind_get_method) (class_name , "track_get_path\0" . as_ptr () as * const c_char) ; table . track_get_type = (gd_api . godot_method_bind_get_method) (class_name , "track_get_type\0" . as_ptr () as * const c_char) ; table . track_insert_key = (gd_api . godot_method_bind_get_method) (class_name , "track_insert_key\0" . as_ptr () as * const c_char) ; table . track_is_enabled = (gd_api . godot_method_bind_get_method) (class_name , "track_is_enabled\0" . as_ptr () as * const c_char) ; table . track_is_imported = (gd_api . godot_method_bind_get_method) (class_name , "track_is_imported\0" . as_ptr () as * const c_char) ; table . track_move_down = (gd_api . godot_method_bind_get_method) (class_name , "track_move_down\0" . as_ptr () as * const c_char) ; table . track_move_to = (gd_api . godot_method_bind_get_method) (class_name , "track_move_to\0" . as_ptr () as * const c_char) ; table . track_move_up = (gd_api . godot_method_bind_get_method) (class_name , "track_move_up\0" . as_ptr () as * const c_char) ; table . track_remove_key = (gd_api . godot_method_bind_get_method) (class_name , "track_remove_key\0" . as_ptr () as * const c_char) ; table . track_remove_key_at_position = (gd_api . godot_method_bind_get_method) (class_name , "track_remove_key_at_position\0" . as_ptr () as * const c_char) ; table . track_set_enabled = (gd_api . godot_method_bind_get_method) (class_name , "track_set_enabled\0" . as_ptr () as * const c_char) ; table . track_set_imported = (gd_api . godot_method_bind_get_method) (class_name , "track_set_imported\0" . as_ptr () as * const c_char) ; table . track_set_interpolation_loop_wrap = (gd_api . godot_method_bind_get_method) (class_name , "track_set_interpolation_loop_wrap\0" . as_ptr () as * const c_char) ; table . track_set_interpolation_type = (gd_api . godot_method_bind_get_method) (class_name , "track_set_interpolation_type\0" . as_ptr () as * const c_char) ; table . track_set_key_time = (gd_api . godot_method_bind_get_method) (class_name , "track_set_key_time\0" . as_ptr () as * const c_char) ; table . track_set_key_transition = (gd_api . godot_method_bind_get_method) (class_name , "track_set_key_transition\0" . as_ptr () as * const c_char) ; table . track_set_key_value = (gd_api . godot_method_bind_get_method) (class_name , "track_set_key_value\0" . as_ptr () as * const c_char) ; table . track_set_path = (gd_api . godot_method_bind_get_method) (class_name , "track_set_path\0" . as_ptr () as * const c_char) ; table . track_swap = (gd_api . godot_method_bind_get_method) (class_name , "track_swap\0" . as_ptr () as * const c_char) ; table . transform_track_insert_key = (gd_api . godot_method_bind_get_method) (class_name , "transform_track_insert_key\0" . as_ptr () as * const c_char) ; table . transform_track_interpolate = (gd_api . godot_method_bind_get_method) (class_name , "transform_track_interpolate\0" . as_ptr () as * const c_char) ; table . value_track_get_key_indices = (gd_api . godot_method_bind_get_method) (class_name , "value_track_get_key_indices\0" . as_ptr () as * const c_char) ; table . value_track_get_update_mode = (gd_api . godot_method_bind_get_method) (class_name , "value_track_get_update_mode\0" . as_ptr () as * const c_char) ; table . value_track_interpolate = (gd_api . godot_method_bind_get_method) (class_name , "value_track_interpolate\0" . as_ptr () as * const c_char) ; table . value_track_set_update_mode = (gd_api . godot_method_bind_get_method) (class_name , "value_track_set_update_mode\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:105:12755 [INFO] [stdout] | [INFO] [stdout] 105 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 105 | # ! [doc = "This module contains types related to the API class [`AnimationNode`][super::AnimationNode]."] pub (crate) mod private { # [doc = "`core class AnimationNode` inherits `Resource` (reference-counted).\n\nThis class has related types in the [`animation_node`][super::animation_node] module."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/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 `Ownership` in these types tracks whether\nownership 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 { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AnimationNode ; # [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 } } impl FromVariant for FilterAction { # [inline] fn from_variant (v : & Variant) -> Result < Self , FromVariantError > { i64 :: from_variant (v) . map (Self :: from) } } # [doc = "Constants"] # [allow (non_upper_case_globals)] impl AnimationNode { pub const FILTER_IGNORE : i64 = 0i64 ; pub const FILTER_PASS : i64 = 1i64 ; pub const FILTER_STOP : i64 = 2i64 ; pub const FILTER_BLEND : i64 = 3i64 ; } 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 , ownership :: 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`][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 :: icallvar__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`][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 :: icallvar__str_f64_f64_bool_f64 (method_bind , self . this . sys () . as_ptr () , animation . into () , time as _ , delta as _ , seeked as _ , blend as _) ; } } # [doc = "Blend an input. This is only useful for nodes created for an [`AnimationNodeBlendTree`][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 [`FilterAction`][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 :: icallvar__i64_f64_bool_f64_i64_bool (method_bind , self . this . sys () . as_ptr () , input_index as _ , time as _ , seek as _ , blend as _ , filter as _ , optimize as _) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Blend another animation node (in case this node contains children animation nodes). This function is only useful if you inherit from [`AnimationRootNode`][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 :: 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 :: icallvar__str_obj_f64_bool_f64_i64_bool (method_bind , self . this . sys () . as_ptr () , name . into () , node . as_arg_ptr () , time as _ , seek as _ , blend as _ , filter as _ , optimize as _) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Amount of inputs in this node, only useful for nodes that go into [`AnimationNodeBlendTree`][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 :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < i64 > :: coerce_from_variant (& ret) } } # [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 :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , input as _) ; < GodotString > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [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 :: icallvar__str (method_bind , self . this . sys () . as_ptr () , name . into ()) ; < Variant > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [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 :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "Returns whether the 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 :: icallvar__nodepath (method_bind , self . this . sys () . as_ptr () , path . into ()) ; < bool > :: coerce_from_variant (& ret) } } # [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 :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , index as _) ; } } # [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 :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , enable as _) ; } } # [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 :: icallvar__nodepath_bool (method_bind , self . this . sys () . as_ptr () , path . into () , enable as _) ; } } # [doc = "Sets a custom parameter. These are used as local memory, 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 :: icallvar__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 Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AnimationNode" } } impl std :: ops :: Deref for AnimationNode { type Target = crate :: generated :: Resource ; # [inline] fn deref (& self) -> & crate :: generated :: Resource { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AnimationNode { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: Resource { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: Resource > for AnimationNode { } unsafe impl SubClass < crate :: generated :: Reference > for AnimationNode { } unsafe impl SubClass < crate :: generated :: Object > for AnimationNode { } impl Instanciable for AnimationNode { # [inline] fn construct () -> Ref < Self , ownership :: 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 } ; &raw 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 = std :: sync :: 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 [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:111:4857 [INFO] [stdout] | [INFO] [stdout] 111 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 111 | # ! [doc = "This module contains types related to the API class [`AnimationNodeAdd2`][super::AnimationNodeAdd2]."] pub (crate) mod private { # [doc = "`core class AnimationNodeAdd2` inherits `AnimationNode` (reference-counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_animationnodeadd2.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\nAnimationNodeAdd2 inherits methods from:\n - [AnimationNode](struct.AnimationNode.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 `Ownership` in these types tracks whether\nownership 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 AnimationNodeAdd2 { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AnimationNodeAdd2 ; impl AnimationNodeAdd2 { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AnimationNodeAdd2MethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "If `true`, sets the `optimization` to `false` when calling [`AnimationNode.blend_input`][AnimationNode::blend_input], forcing the blended animations to update every frame."] # [doc = ""] # [inline] pub fn is_using_sync (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeAdd2MethodTable :: get (get_api ()) . is_using_sync ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "If `true`, sets the `optimization` to `false` when calling [`AnimationNode.blend_input`][AnimationNode::blend_input], forcing the blended animations to update every frame."] # [doc = ""] # [inline] pub fn set_use_sync (& self , enable : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeAdd2MethodTable :: get (get_api ()) . set_use_sync ; let ret = crate :: icalls :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , enable as _) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for AnimationNodeAdd2 { } unsafe impl GodotObject for AnimationNodeAdd2 { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AnimationNodeAdd2" } } impl std :: ops :: Deref for AnimationNodeAdd2 { type Target = crate :: generated :: AnimationNode ; # [inline] fn deref (& self) -> & crate :: generated :: AnimationNode { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AnimationNodeAdd2 { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: AnimationNode { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: AnimationNode > for AnimationNodeAdd2 { } unsafe impl SubClass < crate :: generated :: Resource > for AnimationNodeAdd2 { } unsafe impl SubClass < crate :: generated :: Reference > for AnimationNodeAdd2 { } unsafe impl SubClass < crate :: generated :: Object > for AnimationNodeAdd2 { } impl Instanciable for AnimationNodeAdd2 { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { AnimationNodeAdd2 :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AnimationNodeAdd2MethodTable { pub class_constructor : sys :: godot_class_constructor , pub is_using_sync : * mut sys :: godot_method_bind , pub set_use_sync : * mut sys :: godot_method_bind } impl AnimationNodeAdd2MethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AnimationNodeAdd2MethodTable = AnimationNodeAdd2MethodTable { class_constructor : None , is_using_sync : 0 as * mut sys :: godot_method_bind , set_use_sync : 0 as * mut sys :: godot_method_bind } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { AnimationNodeAdd2MethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AnimationNodeAdd2\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . is_using_sync = (gd_api . godot_method_bind_get_method) (class_name , "is_using_sync\0" . as_ptr () as * const c_char) ; table . set_use_sync = (gd_api . godot_method_bind_get_method) (class_name , "set_use_sync\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:117:4857 [INFO] [stdout] | [INFO] [stdout] 117 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 117 | # ! [doc = "This module contains types related to the API class [`AnimationNodeAdd3`][super::AnimationNodeAdd3]."] pub (crate) mod private { # [doc = "`core class AnimationNodeAdd3` inherits `AnimationNode` (reference-counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_animationnodeadd3.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\nAnimationNodeAdd3 inherits methods from:\n - [AnimationNode](struct.AnimationNode.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 `Ownership` in these types tracks whether\nownership 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 AnimationNodeAdd3 { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AnimationNodeAdd3 ; impl AnimationNodeAdd3 { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AnimationNodeAdd3MethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "If `true`, sets the `optimization` to `false` when calling [`AnimationNode.blend_input`][AnimationNode::blend_input], forcing the blended animations to update every frame."] # [doc = ""] # [inline] pub fn is_using_sync (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeAdd3MethodTable :: get (get_api ()) . is_using_sync ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "If `true`, sets the `optimization` to `false` when calling [`AnimationNode.blend_input`][AnimationNode::blend_input], forcing the blended animations to update every frame."] # [doc = ""] # [inline] pub fn set_use_sync (& self , enable : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeAdd3MethodTable :: get (get_api ()) . set_use_sync ; let ret = crate :: icalls :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , enable as _) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for AnimationNodeAdd3 { } unsafe impl GodotObject for AnimationNodeAdd3 { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AnimationNodeAdd3" } } impl std :: ops :: Deref for AnimationNodeAdd3 { type Target = crate :: generated :: AnimationNode ; # [inline] fn deref (& self) -> & crate :: generated :: AnimationNode { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AnimationNodeAdd3 { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: AnimationNode { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: AnimationNode > for AnimationNodeAdd3 { } unsafe impl SubClass < crate :: generated :: Resource > for AnimationNodeAdd3 { } unsafe impl SubClass < crate :: generated :: Reference > for AnimationNodeAdd3 { } unsafe impl SubClass < crate :: generated :: Object > for AnimationNodeAdd3 { } impl Instanciable for AnimationNodeAdd3 { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { AnimationNodeAdd3 :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AnimationNodeAdd3MethodTable { pub class_constructor : sys :: godot_class_constructor , pub is_using_sync : * mut sys :: godot_method_bind , pub set_use_sync : * mut sys :: godot_method_bind } impl AnimationNodeAdd3MethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AnimationNodeAdd3MethodTable = AnimationNodeAdd3MethodTable { class_constructor : None , is_using_sync : 0 as * mut sys :: godot_method_bind , set_use_sync : 0 as * mut sys :: godot_method_bind } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { AnimationNodeAdd3MethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AnimationNodeAdd3\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . is_using_sync = (gd_api . godot_method_bind_get_method) (class_name , "is_using_sync\0" . as_ptr () as * const c_char) ; table . set_use_sync = (gd_api . godot_method_bind_get_method) (class_name , "set_use_sync\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:123:5135 [INFO] [stdout] | [INFO] [stdout] 123 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 123 | # ! [doc = "This module contains types related to the API class [`AnimationNodeAnimation`][super::AnimationNodeAnimation]."] pub (crate) mod private { # [doc = "`core class AnimationNodeAnimation` inherits `AnimationRootNode` (reference-counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_animationnodeanimation.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\nAnimationNodeAnimation inherits methods from:\n - [AnimationRootNode](struct.AnimationRootNode.html)\n - [AnimationNode](struct.AnimationNode.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 `Ownership` in these types tracks whether\nownership 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 AnimationNodeAnimation { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AnimationNodeAnimation ; impl AnimationNodeAnimation { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AnimationNodeAnimationMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "Animation to use as an output. It is one of the animations provided by [`AnimationTree.anim_player`][AnimationTree::anim_player]."] # [doc = ""] # [inline] pub fn animation (& self) -> GodotString { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeAnimationMethodTable :: get (get_api ()) . get_animation ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < GodotString > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Animation to use as an output. It is one of the animations provided by [`AnimationTree.anim_player`][AnimationTree::anim_player]."] # [doc = ""] # [inline] pub fn set_animation (& self , name : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeAnimationMethodTable :: get (get_api ()) . set_animation ; let ret = crate :: icalls :: icallvar__str (method_bind , self . this . sys () . as_ptr () , name . into ()) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for AnimationNodeAnimation { } unsafe impl GodotObject for AnimationNodeAnimation { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AnimationNodeAnimation" } } impl std :: ops :: Deref for AnimationNodeAnimation { type Target = crate :: generated :: AnimationRootNode ; # [inline] fn deref (& self) -> & crate :: generated :: AnimationRootNode { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AnimationNodeAnimation { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: AnimationRootNode { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: AnimationRootNode > for AnimationNodeAnimation { } unsafe impl SubClass < crate :: generated :: AnimationNode > for AnimationNodeAnimation { } unsafe impl SubClass < crate :: generated :: Resource > for AnimationNodeAnimation { } unsafe impl SubClass < crate :: generated :: Reference > for AnimationNodeAnimation { } unsafe impl SubClass < crate :: generated :: Object > for AnimationNodeAnimation { } impl Instanciable for AnimationNodeAnimation { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { AnimationNodeAnimation :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AnimationNodeAnimationMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_animation : * mut sys :: godot_method_bind , pub set_animation : * mut sys :: godot_method_bind } impl AnimationNodeAnimationMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AnimationNodeAnimationMethodTable = AnimationNodeAnimationMethodTable { class_constructor : None , get_animation : 0 as * mut sys :: godot_method_bind , set_animation : 0 as * mut sys :: godot_method_bind } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { AnimationNodeAnimationMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AnimationNodeAnimation\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_animation = (gd_api . godot_method_bind_get_method) (class_name , "get_animation\0" . as_ptr () as * const c_char) ; table . set_animation = (gd_api . godot_method_bind_get_method) (class_name , "set_animation\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:129:4909 [INFO] [stdout] | [INFO] [stdout] 129 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 129 | # ! [doc = "This module contains types related to the API class [`AnimationNodeBlend2`][super::AnimationNodeBlend2]."] pub (crate) mod private { # [doc = "`core class AnimationNodeBlend2` inherits `AnimationNode` (reference-counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_animationnodeblend2.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\nAnimationNodeBlend2 inherits methods from:\n - [AnimationNode](struct.AnimationNode.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 `Ownership` in these types tracks whether\nownership 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 AnimationNodeBlend2 { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AnimationNodeBlend2 ; impl AnimationNodeBlend2 { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AnimationNodeBlend2MethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "If `true`, sets the `optimization` to `false` when calling [`AnimationNode.blend_input`][AnimationNode::blend_input], forcing the blended animations to update every frame."] # [doc = ""] # [inline] pub fn is_using_sync (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeBlend2MethodTable :: get (get_api ()) . is_using_sync ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "If `true`, sets the `optimization` to `false` when calling [`AnimationNode.blend_input`][AnimationNode::blend_input], forcing the blended animations to update every frame."] # [doc = ""] # [inline] pub fn set_use_sync (& self , enable : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeBlend2MethodTable :: get (get_api ()) . set_use_sync ; let ret = crate :: icalls :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , enable as _) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for AnimationNodeBlend2 { } unsafe impl GodotObject for AnimationNodeBlend2 { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AnimationNodeBlend2" } } impl std :: ops :: Deref for AnimationNodeBlend2 { type Target = crate :: generated :: AnimationNode ; # [inline] fn deref (& self) -> & crate :: generated :: AnimationNode { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AnimationNodeBlend2 { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: AnimationNode { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: AnimationNode > for AnimationNodeBlend2 { } unsafe impl SubClass < crate :: generated :: Resource > for AnimationNodeBlend2 { } unsafe impl SubClass < crate :: generated :: Reference > for AnimationNodeBlend2 { } unsafe impl SubClass < crate :: generated :: Object > for AnimationNodeBlend2 { } impl Instanciable for AnimationNodeBlend2 { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { AnimationNodeBlend2 :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AnimationNodeBlend2MethodTable { pub class_constructor : sys :: godot_class_constructor , pub is_using_sync : * mut sys :: godot_method_bind , pub set_use_sync : * mut sys :: godot_method_bind } impl AnimationNodeBlend2MethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AnimationNodeBlend2MethodTable = AnimationNodeBlend2MethodTable { class_constructor : None , is_using_sync : 0 as * mut sys :: godot_method_bind , set_use_sync : 0 as * mut sys :: godot_method_bind } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { AnimationNodeBlend2MethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AnimationNodeBlend2\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . is_using_sync = (gd_api . godot_method_bind_get_method) (class_name , "is_using_sync\0" . as_ptr () as * const c_char) ; table . set_use_sync = (gd_api . godot_method_bind_get_method) (class_name , "set_use_sync\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:135:4909 [INFO] [stdout] | [INFO] [stdout] 135 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 135 | # ! [doc = "This module contains types related to the API class [`AnimationNodeBlend3`][super::AnimationNodeBlend3]."] pub (crate) mod private { # [doc = "`core class AnimationNodeBlend3` inherits `AnimationNode` (reference-counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_animationnodeblend3.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\nAnimationNodeBlend3 inherits methods from:\n - [AnimationNode](struct.AnimationNode.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 `Ownership` in these types tracks whether\nownership 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 AnimationNodeBlend3 { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AnimationNodeBlend3 ; impl AnimationNodeBlend3 { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AnimationNodeBlend3MethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "If `true`, sets the `optimization` to `false` when calling [`AnimationNode.blend_input`][AnimationNode::blend_input], forcing the blended animations to update every frame."] # [doc = ""] # [inline] pub fn is_using_sync (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeBlend3MethodTable :: get (get_api ()) . is_using_sync ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "If `true`, sets the `optimization` to `false` when calling [`AnimationNode.blend_input`][AnimationNode::blend_input], forcing the blended animations to update every frame."] # [doc = ""] # [inline] pub fn set_use_sync (& self , enable : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeBlend3MethodTable :: get (get_api ()) . set_use_sync ; let ret = crate :: icalls :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , enable as _) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for AnimationNodeBlend3 { } unsafe impl GodotObject for AnimationNodeBlend3 { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AnimationNodeBlend3" } } impl std :: ops :: Deref for AnimationNodeBlend3 { type Target = crate :: generated :: AnimationNode ; # [inline] fn deref (& self) -> & crate :: generated :: AnimationNode { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AnimationNodeBlend3 { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: AnimationNode { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: AnimationNode > for AnimationNodeBlend3 { } unsafe impl SubClass < crate :: generated :: Resource > for AnimationNodeBlend3 { } unsafe impl SubClass < crate :: generated :: Reference > for AnimationNodeBlend3 { } unsafe impl SubClass < crate :: generated :: Object > for AnimationNodeBlend3 { } impl Instanciable for AnimationNodeBlend3 { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { AnimationNodeBlend3 :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AnimationNodeBlend3MethodTable { pub class_constructor : sys :: godot_class_constructor , pub is_using_sync : * mut sys :: godot_method_bind , pub set_use_sync : * mut sys :: godot_method_bind } impl AnimationNodeBlend3MethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AnimationNodeBlend3MethodTable = AnimationNodeBlend3MethodTable { class_constructor : None , is_using_sync : 0 as * mut sys :: godot_method_bind , set_use_sync : 0 as * mut sys :: godot_method_bind } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { AnimationNodeBlend3MethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AnimationNodeBlend3\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . is_using_sync = (gd_api . godot_method_bind_get_method) (class_name , "is_using_sync\0" . as_ptr () as * const c_char) ; table . set_use_sync = (gd_api . godot_method_bind_get_method) (class_name , "set_use_sync\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:141:12779 [INFO] [stdout] | [INFO] [stdout] 141 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 141 | # ! [doc = "This module contains types related to the API class [`AnimationNodeBlendSpace1D`][super::AnimationNodeBlendSpace1D]."] pub (crate) mod private { # [doc = "`core class AnimationNodeBlendSpace1D` inherits `AnimationRootNode` (reference-counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_animationnodeblendspace1d.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\nAnimationNodeBlendSpace1D inherits methods from:\n - [AnimationRootNode](struct.AnimationRootNode.html)\n - [AnimationNode](struct.AnimationNode.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 `Ownership` in these types tracks whether\nownership 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 AnimationNodeBlendSpace1D { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AnimationNodeBlendSpace1D ; impl AnimationNodeBlendSpace1D { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AnimationNodeBlendSpace1DMethodTable :: 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 point that represents a `node` on the virtual axis at a given position set by `pos`. You can insert it at a specific index using the `at_index` argument. If you use the default value for `at_index`, the point is inserted at the end of the blend points array.\n# Default Arguments\n* `at_index` - `-1`"] # [doc = ""] # [inline] pub fn add_blend_point (& self , node : impl AsArg < crate :: generated :: AnimationRootNode > , pos : f64 , at_index : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeBlendSpace1DMethodTable :: get (get_api ()) . add_blend_point ; let ret = crate :: icalls :: icallvar__obj_f64_i64 (method_bind , self . this . sys () . as_ptr () , node . as_arg_ptr () , pos as _ , at_index as _) ; } } # [doc = "Returns the number of points on the blend axis."] # [doc = ""] # [inline] pub fn get_blend_point_count (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeBlendSpace1DMethodTable :: get (get_api ()) . get_blend_point_count ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "Returns the [`AnimationNode`][AnimationNode] referenced by the point at index `point`."] # [doc = ""] # [inline] pub fn blend_point_node (& self , point : i64) -> Option < Ref < crate :: generated :: AnimationRootNode , ownership :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeBlendSpace1DMethodTable :: get (get_api ()) . get_blend_point_node ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , point as _) ; < Option < Ref < crate :: generated :: AnimationRootNode , ownership :: Shared > > > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns the position of the point at index `point`."] # [doc = ""] # [inline] pub fn blend_point_position (& self , point : i64) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeBlendSpace1DMethodTable :: get (get_api ()) . get_blend_point_position ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , point as _) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "The blend space's axis's upper limit for the points' position. See [`add_blend_point`][Self::add_blend_point]."] # [doc = ""] # [inline] pub fn max_space (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeBlendSpace1DMethodTable :: get (get_api ()) . get_max_space ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "The blend space's axis's lower limit for the points' position. See [`add_blend_point`][Self::add_blend_point]."] # [doc = ""] # [inline] pub fn min_space (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeBlendSpace1DMethodTable :: get (get_api ()) . get_min_space ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Position increment to snap to when moving a point on the axis."] # [doc = ""] # [inline] pub fn snap (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeBlendSpace1DMethodTable :: get (get_api ()) . get_snap ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Label of the virtual axis of the blend space."] # [doc = ""] # [inline] pub fn value_label (& self) -> GodotString { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeBlendSpace1DMethodTable :: get (get_api ()) . get_value_label ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < GodotString > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Removes the point at index `point` from the blend axis."] # [doc = ""] # [inline] pub fn remove_blend_point (& self , point : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeBlendSpace1DMethodTable :: get (get_api ()) . remove_blend_point ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , point as _) ; } } # [doc = "Changes the [`AnimationNode`][AnimationNode] referenced by the point at index `point`."] # [doc = ""] # [inline] pub fn set_blend_point_node (& self , point : i64 , node : impl AsArg < crate :: generated :: AnimationRootNode >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeBlendSpace1DMethodTable :: get (get_api ()) . set_blend_point_node ; let ret = crate :: icalls :: icallvar__i64_obj (method_bind , self . this . sys () . as_ptr () , point as _ , node . as_arg_ptr ()) ; } } # [doc = "Updates the position of the point at index `point` on the blend axis."] # [doc = ""] # [inline] pub fn set_blend_point_position (& self , point : i64 , pos : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeBlendSpace1DMethodTable :: get (get_api ()) . set_blend_point_position ; let ret = crate :: icalls :: icallvar__i64_f64 (method_bind , self . this . sys () . as_ptr () , point as _ , pos as _) ; } } # [doc = "The blend space's axis's upper limit for the points' position. See [`add_blend_point`][Self::add_blend_point]."] # [doc = ""] # [inline] pub fn set_max_space (& self , max_space : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeBlendSpace1DMethodTable :: get (get_api ()) . set_max_space ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , max_space as _) ; } } # [doc = "The blend space's axis's lower limit for the points' position. See [`add_blend_point`][Self::add_blend_point]."] # [doc = ""] # [inline] pub fn set_min_space (& self , min_space : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeBlendSpace1DMethodTable :: get (get_api ()) . set_min_space ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , min_space as _) ; } } # [doc = "Position increment to snap to when moving a point on the axis."] # [doc = ""] # [inline] pub fn set_snap (& self , snap : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeBlendSpace1DMethodTable :: get (get_api ()) . set_snap ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , snap as _) ; } } # [doc = "Label of the virtual axis of the blend space."] # [doc = ""] # [inline] pub fn set_value_label (& self , text : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeBlendSpace1DMethodTable :: get (get_api ()) . set_value_label ; let ret = crate :: icalls :: icallvar__str (method_bind , self . this . sys () . as_ptr () , text . into ()) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for AnimationNodeBlendSpace1D { } unsafe impl GodotObject for AnimationNodeBlendSpace1D { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AnimationNodeBlendSpace1D" } } impl std :: ops :: Deref for AnimationNodeBlendSpace1D { type Target = crate :: generated :: AnimationRootNode ; # [inline] fn deref (& self) -> & crate :: generated :: AnimationRootNode { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AnimationNodeBlendSpace1D { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: AnimationRootNode { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: AnimationRootNode > for AnimationNodeBlendSpace1D { } unsafe impl SubClass < crate :: generated :: AnimationNode > for AnimationNodeBlendSpace1D { } unsafe impl SubClass < crate :: generated :: Resource > for AnimationNodeBlendSpace1D { } unsafe impl SubClass < crate :: generated :: Reference > for AnimationNodeBlendSpace1D { } unsafe impl SubClass < crate :: generated :: Object > for AnimationNodeBlendSpace1D { } impl Instanciable for AnimationNodeBlendSpace1D { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { AnimationNodeBlendSpace1D :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AnimationNodeBlendSpace1DMethodTable { pub class_constructor : sys :: godot_class_constructor , pub add_blend_point : * mut sys :: godot_method_bind , pub get_blend_point_count : * mut sys :: godot_method_bind , pub get_blend_point_node : * mut sys :: godot_method_bind , pub get_blend_point_position : * mut sys :: godot_method_bind , pub get_max_space : * mut sys :: godot_method_bind , pub get_min_space : * mut sys :: godot_method_bind , pub get_snap : * mut sys :: godot_method_bind , pub get_value_label : * mut sys :: godot_method_bind , pub remove_blend_point : * mut sys :: godot_method_bind , pub set_blend_point_node : * mut sys :: godot_method_bind , pub set_blend_point_position : * mut sys :: godot_method_bind , pub set_max_space : * mut sys :: godot_method_bind , pub set_min_space : * mut sys :: godot_method_bind , pub set_snap : * mut sys :: godot_method_bind , pub set_value_label : * mut sys :: godot_method_bind } impl AnimationNodeBlendSpace1DMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AnimationNodeBlendSpace1DMethodTable = AnimationNodeBlendSpace1DMethodTable { class_constructor : None , add_blend_point : 0 as * mut sys :: godot_method_bind , get_blend_point_count : 0 as * mut sys :: godot_method_bind , get_blend_point_node : 0 as * mut sys :: godot_method_bind , get_blend_point_position : 0 as * mut sys :: godot_method_bind , get_max_space : 0 as * mut sys :: godot_method_bind , get_min_space : 0 as * mut sys :: godot_method_bind , get_snap : 0 as * mut sys :: godot_method_bind , get_value_label : 0 as * mut sys :: godot_method_bind , remove_blend_point : 0 as * mut sys :: godot_method_bind , set_blend_point_node : 0 as * mut sys :: godot_method_bind , set_blend_point_position : 0 as * mut sys :: godot_method_bind , set_max_space : 0 as * mut sys :: godot_method_bind , set_min_space : 0 as * mut sys :: godot_method_bind , set_snap : 0 as * mut sys :: godot_method_bind , set_value_label : 0 as * mut sys :: godot_method_bind } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { AnimationNodeBlendSpace1DMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AnimationNodeBlendSpace1D\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . add_blend_point = (gd_api . godot_method_bind_get_method) (class_name , "add_blend_point\0" . as_ptr () as * const c_char) ; table . get_blend_point_count = (gd_api . godot_method_bind_get_method) (class_name , "get_blend_point_count\0" . as_ptr () as * const c_char) ; table . get_blend_point_node = (gd_api . godot_method_bind_get_method) (class_name , "get_blend_point_node\0" . as_ptr () as * const c_char) ; table . get_blend_point_position = (gd_api . godot_method_bind_get_method) (class_name , "get_blend_point_position\0" . as_ptr () as * const c_char) ; table . get_max_space = (gd_api . godot_method_bind_get_method) (class_name , "get_max_space\0" . as_ptr () as * const c_char) ; table . get_min_space = (gd_api . godot_method_bind_get_method) (class_name , "get_min_space\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_value_label = (gd_api . godot_method_bind_get_method) (class_name , "get_value_label\0" . as_ptr () as * const c_char) ; table . remove_blend_point = (gd_api . godot_method_bind_get_method) (class_name , "remove_blend_point\0" . as_ptr () as * const c_char) ; table . set_blend_point_node = (gd_api . godot_method_bind_get_method) (class_name , "set_blend_point_node\0" . as_ptr () as * const c_char) ; table . set_blend_point_position = (gd_api . godot_method_bind_get_method) (class_name , "set_blend_point_position\0" . as_ptr () as * const c_char) ; table . set_max_space = (gd_api . godot_method_bind_get_method) (class_name , "set_max_space\0" . as_ptr () as * const c_char) ; table . set_min_space = (gd_api . godot_method_bind_get_method) (class_name , "set_min_space\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_value_label = (gd_api . godot_method_bind_get_method) (class_name , "set_value_label\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:147:19932 [INFO] [stdout] | [INFO] [stdout] 147 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 147 | # ! [doc = "This module contains types related to the API class [`AnimationNodeBlendSpace2D`][super::AnimationNodeBlendSpace2D]."] pub (crate) mod private { # [doc = "`core class AnimationNodeBlendSpace2D` inherits `AnimationRootNode` (reference-counted).\n\nThis class has related types in the [`animation_node_blend_space_2d`][super::animation_node_blend_space_2d] module."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_animationnodeblendspace2d.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\nAnimationNodeBlendSpace2D inherits methods from:\n - [AnimationRootNode](struct.AnimationRootNode.html)\n - [AnimationNode](struct.AnimationNode.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 `Ownership` in these types tracks whether\nownership 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 AnimationNodeBlendSpace2D { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AnimationNodeBlendSpace2D ; # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct BlendMode (pub i64) ; impl BlendMode { pub const INTERPOLATED : BlendMode = BlendMode (0i64) ; pub const DISCRETE : BlendMode = BlendMode (1i64) ; pub const DISCRETE_CARRY : BlendMode = BlendMode (2i64) ; } impl From < i64 > for BlendMode { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < BlendMode > for i64 { # [inline] fn from (v : BlendMode) -> Self { v . 0 } } impl FromVariant for BlendMode { # [inline] fn from_variant (v : & Variant) -> Result < Self , FromVariantError > { i64 :: from_variant (v) . map (Self :: from) } } # [doc = "Constants"] # [allow (non_upper_case_globals)] impl AnimationNodeBlendSpace2D { pub const BLEND_MODE_INTERPOLATED : i64 = 0i64 ; pub const BLEND_MODE_DISCRETE : i64 = 1i64 ; pub const BLEND_MODE_DISCRETE_CARRY : i64 = 2i64 ; } impl AnimationNodeBlendSpace2D { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AnimationNodeBlendSpace2DMethodTable :: 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 point that represents a `node` at the position set by `pos`. You can insert it at a specific index using the `at_index` argument. If you use the default value for `at_index`, the point is inserted at the end of the blend points array.\n# Default Arguments\n* `at_index` - `-1`"] # [doc = ""] # [inline] pub fn add_blend_point (& self , node : impl AsArg < crate :: generated :: AnimationRootNode > , pos : Vector2 , at_index : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeBlendSpace2DMethodTable :: get (get_api ()) . add_blend_point ; let ret = crate :: icalls :: icallvar__obj_vec2_i64 (method_bind , self . this . sys () . as_ptr () , node . as_arg_ptr () , pos , at_index as _) ; } } # [doc = "Creates a new triangle using three points `x`, `y`, and `z`. Triangles can overlap. You can insert the triangle at a specific index using the `at_index` argument. If you use the default value for `at_index`, the point is inserted at the end of the blend points array.\n# Default Arguments\n* `at_index` - `-1`"] # [doc = ""] # [inline] pub fn add_triangle (& self , x : i64 , y : i64 , z : i64 , at_index : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeBlendSpace2DMethodTable :: get (get_api ()) . add_triangle ; let ret = crate :: icalls :: icallvar__i64_i64_i64_i64 (method_bind , self . this . sys () . as_ptr () , x as _ , y as _ , z as _ , at_index as _) ; } } # [doc = "If `true`, the blend space is triangulated automatically. The mesh updates every time you add or remove points with [`add_blend_point`][Self::add_blend_point] and [`remove_blend_point`][Self::remove_blend_point]."] # [doc = ""] # [inline] pub fn auto_triangles (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeBlendSpace2DMethodTable :: get (get_api ()) . get_auto_triangles ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "Controls the interpolation between animations. See [`BlendMode`][BlendMode] constants."] # [doc = ""] # [inline] pub fn blend_mode (& self) -> crate :: generated :: animation_node_blend_space_2d :: BlendMode { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeBlendSpace2DMethodTable :: get (get_api ()) . get_blend_mode ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < crate :: generated :: animation_node_blend_space_2d :: BlendMode > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns the number of points in the blend space."] # [doc = ""] # [inline] pub fn get_blend_point_count (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeBlendSpace2DMethodTable :: get (get_api ()) . get_blend_point_count ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "Returns the [`AnimationRootNode`][AnimationRootNode] referenced by the point at index `point`."] # [doc = ""] # [inline] pub fn blend_point_node (& self , point : i64) -> Option < Ref < crate :: generated :: AnimationRootNode , ownership :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeBlendSpace2DMethodTable :: get (get_api ()) . get_blend_point_node ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , point as _) ; < Option < Ref < crate :: generated :: AnimationRootNode , ownership :: Shared > > > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns the position of the point at index `point`."] # [doc = ""] # [inline] pub fn blend_point_position (& self , point : i64) -> Vector2 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeBlendSpace2DMethodTable :: get (get_api ()) . get_blend_point_position ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , point as _) ; < Vector2 > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "The blend space's X and Y axes' upper limit for the points' position. See [`add_blend_point`][Self::add_blend_point]."] # [doc = ""] # [inline] pub fn max_space (& self) -> Vector2 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeBlendSpace2DMethodTable :: get (get_api ()) . get_max_space ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < Vector2 > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "The blend space's X and Y axes' lower limit for the points' position. See [`add_blend_point`][Self::add_blend_point]."] # [doc = ""] # [inline] pub fn min_space (& self) -> Vector2 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeBlendSpace2DMethodTable :: get (get_api ()) . get_min_space ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < Vector2 > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Position increment to snap to when moving a point."] # [doc = ""] # [inline] pub fn snap (& self) -> Vector2 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeBlendSpace2DMethodTable :: get (get_api ()) . get_snap ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < Vector2 > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns the number of triangles in the blend space."] # [doc = ""] # [inline] pub fn get_triangle_count (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeBlendSpace2DMethodTable :: get (get_api ()) . get_triangle_count ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "Returns the position of the point at index `point` in the triangle of index `triangle`."] # [doc = ""] # [inline] pub fn get_triangle_point (& self , triangle : i64 , point : i64) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeBlendSpace2DMethodTable :: get (get_api ()) . get_triangle_point ; let ret = crate :: icalls :: icallvar__i64_i64 (method_bind , self . this . sys () . as_ptr () , triangle as _ , point as _) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "Name of the blend space's X axis."] # [doc = ""] # [inline] pub fn x_label (& self) -> GodotString { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeBlendSpace2DMethodTable :: get (get_api ()) . get_x_label ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < GodotString > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Name of the blend space's Y axis."] # [doc = ""] # [inline] pub fn y_label (& self) -> GodotString { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeBlendSpace2DMethodTable :: get (get_api ()) . get_y_label ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < GodotString > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Removes the point at index `point` from the blend space."] # [doc = ""] # [inline] pub fn remove_blend_point (& self , point : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeBlendSpace2DMethodTable :: get (get_api ()) . remove_blend_point ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , point as _) ; } } # [doc = "Removes the triangle at index `triangle` from the blend space."] # [doc = ""] # [inline] pub fn remove_triangle (& self , triangle : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeBlendSpace2DMethodTable :: get (get_api ()) . remove_triangle ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , triangle as _) ; } } # [doc = "If `true`, the blend space is triangulated automatically. The mesh updates every time you add or remove points with [`add_blend_point`][Self::add_blend_point] and [`remove_blend_point`][Self::remove_blend_point]."] # [doc = ""] # [inline] pub fn set_auto_triangles (& self , enable : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeBlendSpace2DMethodTable :: get (get_api ()) . set_auto_triangles ; let ret = crate :: icalls :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , enable as _) ; } } # [doc = "Controls the interpolation between animations. See [`BlendMode`][BlendMode] constants."] # [doc = ""] # [inline] pub fn set_blend_mode (& self , mode : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeBlendSpace2DMethodTable :: get (get_api ()) . set_blend_mode ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , mode as _) ; } } # [doc = "Changes the [`AnimationNode`][AnimationNode] referenced by the point at index `point`."] # [doc = ""] # [inline] pub fn set_blend_point_node (& self , point : i64 , node : impl AsArg < crate :: generated :: AnimationRootNode >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeBlendSpace2DMethodTable :: get (get_api ()) . set_blend_point_node ; let ret = crate :: icalls :: icallvar__i64_obj (method_bind , self . this . sys () . as_ptr () , point as _ , node . as_arg_ptr ()) ; } } # [doc = "Updates the position of the point at index `point` on the blend axis."] # [doc = ""] # [inline] pub fn set_blend_point_position (& self , point : i64 , pos : Vector2) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeBlendSpace2DMethodTable :: get (get_api ()) . set_blend_point_position ; let ret = crate :: icalls :: icallvar__i64_vec2 (method_bind , self . this . sys () . as_ptr () , point as _ , pos) ; } } # [doc = "The blend space's X and Y axes' upper limit for the points' position. See [`add_blend_point`][Self::add_blend_point]."] # [doc = ""] # [inline] pub fn set_max_space (& self , max_space : Vector2) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeBlendSpace2DMethodTable :: get (get_api ()) . set_max_space ; let ret = crate :: icalls :: icallvar__vec2 (method_bind , self . this . sys () . as_ptr () , max_space) ; } } # [doc = "The blend space's X and Y axes' lower limit for the points' position. See [`add_blend_point`][Self::add_blend_point]."] # [doc = ""] # [inline] pub fn set_min_space (& self , min_space : Vector2) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeBlendSpace2DMethodTable :: get (get_api ()) . set_min_space ; let ret = crate :: icalls :: icallvar__vec2 (method_bind , self . this . sys () . as_ptr () , min_space) ; } } # [doc = "Position increment to snap to when moving a point."] # [doc = ""] # [inline] pub fn set_snap (& self , snap : Vector2) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeBlendSpace2DMethodTable :: get (get_api ()) . set_snap ; let ret = crate :: icalls :: icallvar__vec2 (method_bind , self . this . sys () . as_ptr () , snap) ; } } # [doc = "Name of the blend space's X axis."] # [doc = ""] # [inline] pub fn set_x_label (& self , text : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeBlendSpace2DMethodTable :: get (get_api ()) . set_x_label ; let ret = crate :: icalls :: icallvar__str (method_bind , self . this . sys () . as_ptr () , text . into ()) ; } } # [doc = "Name of the blend space's Y axis."] # [doc = ""] # [inline] pub fn set_y_label (& self , text : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeBlendSpace2DMethodTable :: get (get_api ()) . set_y_label ; let ret = crate :: icalls :: icallvar__str (method_bind , self . this . sys () . as_ptr () , text . into ()) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for AnimationNodeBlendSpace2D { } unsafe impl GodotObject for AnimationNodeBlendSpace2D { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AnimationNodeBlendSpace2D" } } impl std :: ops :: Deref for AnimationNodeBlendSpace2D { type Target = crate :: generated :: AnimationRootNode ; # [inline] fn deref (& self) -> & crate :: generated :: AnimationRootNode { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AnimationNodeBlendSpace2D { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: AnimationRootNode { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: AnimationRootNode > for AnimationNodeBlendSpace2D { } unsafe impl SubClass < crate :: generated :: AnimationNode > for AnimationNodeBlendSpace2D { } unsafe impl SubClass < crate :: generated :: Resource > for AnimationNodeBlendSpace2D { } unsafe impl SubClass < crate :: generated :: Reference > for AnimationNodeBlendSpace2D { } unsafe impl SubClass < crate :: generated :: Object > for AnimationNodeBlendSpace2D { } impl Instanciable for AnimationNodeBlendSpace2D { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { AnimationNodeBlendSpace2D :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AnimationNodeBlendSpace2DMethodTable { pub class_constructor : sys :: godot_class_constructor , pub add_blend_point : * mut sys :: godot_method_bind , pub add_triangle : * mut sys :: godot_method_bind , pub get_auto_triangles : * mut sys :: godot_method_bind , pub get_blend_mode : * mut sys :: godot_method_bind , pub get_blend_point_count : * mut sys :: godot_method_bind , pub get_blend_point_node : * mut sys :: godot_method_bind , pub get_blend_point_position : * mut sys :: godot_method_bind , pub get_max_space : * mut sys :: godot_method_bind , pub get_min_space : * mut sys :: godot_method_bind , pub get_snap : * mut sys :: godot_method_bind , pub get_triangle_count : * mut sys :: godot_method_bind , pub get_triangle_point : * mut sys :: godot_method_bind , pub get_x_label : * mut sys :: godot_method_bind , pub get_y_label : * mut sys :: godot_method_bind , pub remove_blend_point : * mut sys :: godot_method_bind , pub remove_triangle : * mut sys :: godot_method_bind , pub set_auto_triangles : * mut sys :: godot_method_bind , pub set_blend_mode : * mut sys :: godot_method_bind , pub set_blend_point_node : * mut sys :: godot_method_bind , pub set_blend_point_position : * mut sys :: godot_method_bind , pub set_max_space : * mut sys :: godot_method_bind , pub set_min_space : * mut sys :: godot_method_bind , pub set_snap : * mut sys :: godot_method_bind , pub set_x_label : * mut sys :: godot_method_bind , pub set_y_label : * mut sys :: godot_method_bind } impl AnimationNodeBlendSpace2DMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AnimationNodeBlendSpace2DMethodTable = AnimationNodeBlendSpace2DMethodTable { class_constructor : None , add_blend_point : 0 as * mut sys :: godot_method_bind , add_triangle : 0 as * mut sys :: godot_method_bind , get_auto_triangles : 0 as * mut sys :: godot_method_bind , get_blend_mode : 0 as * mut sys :: godot_method_bind , get_blend_point_count : 0 as * mut sys :: godot_method_bind , get_blend_point_node : 0 as * mut sys :: godot_method_bind , get_blend_point_position : 0 as * mut sys :: godot_method_bind , get_max_space : 0 as * mut sys :: godot_method_bind , get_min_space : 0 as * mut sys :: godot_method_bind , get_snap : 0 as * mut sys :: godot_method_bind , get_triangle_count : 0 as * mut sys :: godot_method_bind , get_triangle_point : 0 as * mut sys :: godot_method_bind , get_x_label : 0 as * mut sys :: godot_method_bind , get_y_label : 0 as * mut sys :: godot_method_bind , remove_blend_point : 0 as * mut sys :: godot_method_bind , remove_triangle : 0 as * mut sys :: godot_method_bind , set_auto_triangles : 0 as * mut sys :: godot_method_bind , set_blend_mode : 0 as * mut sys :: godot_method_bind , set_blend_point_node : 0 as * mut sys :: godot_method_bind , set_blend_point_position : 0 as * mut sys :: godot_method_bind , set_max_space : 0 as * mut sys :: godot_method_bind , set_min_space : 0 as * mut sys :: godot_method_bind , set_snap : 0 as * mut sys :: godot_method_bind , set_x_label : 0 as * mut sys :: godot_method_bind , set_y_label : 0 as * mut sys :: godot_method_bind } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { AnimationNodeBlendSpace2DMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AnimationNodeBlendSpace2D\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . add_blend_point = (gd_api . godot_method_bind_get_method) (class_name , "add_blend_point\0" . as_ptr () as * const c_char) ; table . add_triangle = (gd_api . godot_method_bind_get_method) (class_name , "add_triangle\0" . as_ptr () as * const c_char) ; table . get_auto_triangles = (gd_api . godot_method_bind_get_method) (class_name , "get_auto_triangles\0" . as_ptr () as * const c_char) ; table . get_blend_mode = (gd_api . godot_method_bind_get_method) (class_name , "get_blend_mode\0" . as_ptr () as * const c_char) ; table . get_blend_point_count = (gd_api . godot_method_bind_get_method) (class_name , "get_blend_point_count\0" . as_ptr () as * const c_char) ; table . get_blend_point_node = (gd_api . godot_method_bind_get_method) (class_name , "get_blend_point_node\0" . as_ptr () as * const c_char) ; table . get_blend_point_position = (gd_api . godot_method_bind_get_method) (class_name , "get_blend_point_position\0" . as_ptr () as * const c_char) ; table . get_max_space = (gd_api . godot_method_bind_get_method) (class_name , "get_max_space\0" . as_ptr () as * const c_char) ; table . get_min_space = (gd_api . godot_method_bind_get_method) (class_name , "get_min_space\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_triangle_count = (gd_api . godot_method_bind_get_method) (class_name , "get_triangle_count\0" . as_ptr () as * const c_char) ; table . get_triangle_point = (gd_api . godot_method_bind_get_method) (class_name , "get_triangle_point\0" . as_ptr () as * const c_char) ; table . get_x_label = (gd_api . godot_method_bind_get_method) (class_name , "get_x_label\0" . as_ptr () as * const c_char) ; table . get_y_label = (gd_api . godot_method_bind_get_method) (class_name , "get_y_label\0" . as_ptr () as * const c_char) ; table . remove_blend_point = (gd_api . godot_method_bind_get_method) (class_name , "remove_blend_point\0" . as_ptr () as * const c_char) ; table . remove_triangle = (gd_api . godot_method_bind_get_method) (class_name , "remove_triangle\0" . as_ptr () as * const c_char) ; table . set_auto_triangles = (gd_api . godot_method_bind_get_method) (class_name , "set_auto_triangles\0" . as_ptr () as * const c_char) ; table . set_blend_mode = (gd_api . godot_method_bind_get_method) (class_name , "set_blend_mode\0" . as_ptr () as * const c_char) ; table . set_blend_point_node = (gd_api . godot_method_bind_get_method) (class_name , "set_blend_point_node\0" . as_ptr () as * const c_char) ; table . set_blend_point_position = (gd_api . godot_method_bind_get_method) (class_name , "set_blend_point_position\0" . as_ptr () as * const c_char) ; table . set_max_space = (gd_api . godot_method_bind_get_method) (class_name , "set_max_space\0" . as_ptr () as * const c_char) ; table . set_min_space = (gd_api . godot_method_bind_get_method) (class_name , "set_min_space\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_x_label = (gd_api . godot_method_bind_get_method) (class_name , "set_x_label\0" . as_ptr () as * const c_char) ; table . set_y_label = (gd_api . godot_method_bind_get_method) (class_name , "set_y_label\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:153:10863 [INFO] [stdout] | [INFO] [stdout] 153 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 153 | # ! [doc = "This module contains types related to the API class [`AnimationNodeBlendTree`][super::AnimationNodeBlendTree]."] pub (crate) mod private { # [doc = "`core class AnimationNodeBlendTree` inherits `AnimationRootNode` (reference-counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_animationnodeblendtree.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\nAnimationNodeBlendTree inherits methods from:\n - [AnimationRootNode](struct.AnimationRootNode.html)\n - [AnimationNode](struct.AnimationNode.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 `Ownership` in these types tracks whether\nownership 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 AnimationNodeBlendTree { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AnimationNodeBlendTree ; # [doc = "Constants"] # [allow (non_upper_case_globals)] impl AnimationNodeBlendTree { pub const CONNECTION_OK : i64 = 0i64 ; pub const CONNECTION_ERROR_NO_INPUT : i64 = 1i64 ; pub const CONNECTION_ERROR_NO_INPUT_INDEX : i64 = 2i64 ; pub const CONNECTION_ERROR_NO_OUTPUT : i64 = 3i64 ; pub const CONNECTION_ERROR_SAME_NODE : i64 = 4i64 ; pub const CONNECTION_ERROR_CONNECTION_EXISTS : i64 = 5i64 ; } impl AnimationNodeBlendTree { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AnimationNodeBlendTreeMethodTable :: 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 [`AnimationNode`][AnimationNode] at the given `position`. The `name` is used to identify the created sub-node later.\n# Default Arguments\n* `position` - `Vector2( 0, 0 )`"] # [doc = ""] # [inline] pub fn add_node (& self , name : impl Into < GodotString > , node : impl AsArg < crate :: generated :: AnimationNode > , position : Vector2) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeBlendTreeMethodTable :: get (get_api ()) . add_node ; let ret = crate :: icalls :: icallvar__str_obj_vec2 (method_bind , self . this . sys () . as_ptr () , name . into () , node . as_arg_ptr () , position) ; } } # [doc = "Connects the output of an [`AnimationNode`][AnimationNode] as input for another [`AnimationNode`][AnimationNode], at the input port specified by `input_index`."] # [doc = ""] # [inline] pub fn connect_node (& self , input_node : impl Into < GodotString > , input_index : i64 , output_node : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeBlendTreeMethodTable :: get (get_api ()) . connect_node ; let ret = crate :: icalls :: icallvar__str_i64_str (method_bind , self . this . sys () . as_ptr () , input_node . into () , input_index as _ , output_node . into ()) ; } } # [doc = "Disconnects the node connected to the specified input."] # [doc = ""] # [inline] pub fn disconnect_node (& self , input_node : impl Into < GodotString > , input_index : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeBlendTreeMethodTable :: get (get_api ()) . disconnect_node ; let ret = crate :: icalls :: icallvar__str_i64 (method_bind , self . this . sys () . as_ptr () , input_node . into () , input_index as _) ; } } # [doc = "The global offset of all sub-nodes."] # [doc = ""] # [inline] pub fn graph_offset (& self) -> Vector2 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeBlendTreeMethodTable :: get (get_api ()) . get_graph_offset ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < Vector2 > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns the sub-node with the specified `name`."] # [doc = ""] # [inline] pub fn get_node (& self , name : impl Into < GodotString >) -> Option < Ref < crate :: generated :: AnimationNode , ownership :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeBlendTreeMethodTable :: get (get_api ()) . get_node ; let ret = crate :: icalls :: icallvar__str (method_bind , self . this . sys () . as_ptr () , name . into ()) ; < Option < Ref < crate :: generated :: AnimationNode , ownership :: Shared > > > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns the position of the sub-node with the specified `name`."] # [doc = ""] # [inline] pub fn get_node_position (& self , name : impl Into < GodotString >) -> Vector2 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeBlendTreeMethodTable :: get (get_api ()) . get_node_position ; let ret = crate :: icalls :: icallvar__str (method_bind , self . this . sys () . as_ptr () , name . into ()) ; < Vector2 > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns `true` if a sub-node with specified `name` exists."] # [doc = ""] # [inline] pub fn has_node (& self , name : impl Into < GodotString >) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeBlendTreeMethodTable :: get (get_api ()) . has_node ; let ret = crate :: icalls :: icallvar__str (method_bind , self . this . sys () . as_ptr () , name . into ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "Removes a sub-node."] # [doc = ""] # [inline] pub fn remove_node (& self , name : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeBlendTreeMethodTable :: get (get_api ()) . remove_node ; let ret = crate :: icalls :: icallvar__str (method_bind , self . this . sys () . as_ptr () , name . into ()) ; } } # [doc = "Changes the name of a sub-node."] # [doc = ""] # [inline] pub fn rename_node (& self , name : impl Into < GodotString > , new_name : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeBlendTreeMethodTable :: get (get_api ()) . rename_node ; let ret = crate :: icalls :: icallvar__str_str (method_bind , self . this . sys () . as_ptr () , name . into () , new_name . into ()) ; } } # [doc = "The global offset of all sub-nodes."] # [doc = ""] # [inline] pub fn set_graph_offset (& self , offset : Vector2) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeBlendTreeMethodTable :: get (get_api ()) . set_graph_offset ; let ret = crate :: icalls :: icallvar__vec2 (method_bind , self . this . sys () . as_ptr () , offset) ; } } # [doc = "Modifies the position of a sub-node."] # [doc = ""] # [inline] pub fn set_node_position (& self , name : impl Into < GodotString > , position : Vector2) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeBlendTreeMethodTable :: get (get_api ()) . set_node_position ; let ret = crate :: icalls :: icallvar__str_vec2 (method_bind , self . this . sys () . as_ptr () , name . into () , position) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for AnimationNodeBlendTree { } unsafe impl GodotObject for AnimationNodeBlendTree { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AnimationNodeBlendTree" } } impl std :: ops :: Deref for AnimationNodeBlendTree { type Target = crate :: generated :: AnimationRootNode ; # [inline] fn deref (& self) -> & crate :: generated :: AnimationRootNode { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AnimationNodeBlendTree { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: AnimationRootNode { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: AnimationRootNode > for AnimationNodeBlendTree { } unsafe impl SubClass < crate :: generated :: AnimationNode > for AnimationNodeBlendTree { } unsafe impl SubClass < crate :: generated :: Resource > for AnimationNodeBlendTree { } unsafe impl SubClass < crate :: generated :: Reference > for AnimationNodeBlendTree { } unsafe impl SubClass < crate :: generated :: Object > for AnimationNodeBlendTree { } impl Instanciable for AnimationNodeBlendTree { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { AnimationNodeBlendTree :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AnimationNodeBlendTreeMethodTable { pub class_constructor : sys :: godot_class_constructor , pub add_node : * mut sys :: godot_method_bind , pub connect_node : * mut sys :: godot_method_bind , pub disconnect_node : * 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_position : * mut sys :: godot_method_bind , pub has_node : * mut sys :: godot_method_bind , pub remove_node : * mut sys :: godot_method_bind , pub rename_node : * mut sys :: godot_method_bind , pub set_graph_offset : * mut sys :: godot_method_bind , pub set_node_position : * mut sys :: godot_method_bind } impl AnimationNodeBlendTreeMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AnimationNodeBlendTreeMethodTable = AnimationNodeBlendTreeMethodTable { class_constructor : None , add_node : 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_graph_offset : 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 , has_node : 0 as * mut sys :: godot_method_bind , remove_node : 0 as * mut sys :: godot_method_bind , rename_node : 0 as * mut sys :: godot_method_bind , set_graph_offset : 0 as * mut sys :: godot_method_bind , set_node_position : 0 as * mut sys :: godot_method_bind } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { AnimationNodeBlendTreeMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AnimationNodeBlendTree\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 . 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_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_position = (gd_api . godot_method_bind_get_method) (class_name , "get_node_position\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 . remove_node = (gd_api . godot_method_bind_get_method) (class_name , "remove_node\0" . as_ptr () as * const c_char) ; table . rename_node = (gd_api . godot_method_bind_get_method) (class_name , "rename_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_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 [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:159:11696 [INFO] [stdout] | [INFO] [stdout] 159 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 159 | # ! [doc = "This module contains types related to the API class [`AnimationNodeOneShot`][super::AnimationNodeOneShot]."] pub (crate) mod private { # [doc = "`core class AnimationNodeOneShot` inherits `AnimationNode` (reference-counted).\n\nThis class has related types in the [`animation_node_one_shot`][super::animation_node_one_shot] module."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_animationnodeoneshot.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\nAnimationNodeOneShot inherits methods from:\n - [AnimationNode](struct.AnimationNode.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 `Ownership` in these types tracks whether\nownership 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 AnimationNodeOneShot { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AnimationNodeOneShot ; # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct MixMode (pub i64) ; impl MixMode { pub const BLEND : MixMode = MixMode (0i64) ; pub const ADD : MixMode = MixMode (1i64) ; } impl From < i64 > for MixMode { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < MixMode > for i64 { # [inline] fn from (v : MixMode) -> Self { v . 0 } } impl FromVariant for MixMode { # [inline] fn from_variant (v : & Variant) -> Result < Self , FromVariantError > { i64 :: from_variant (v) . map (Self :: from) } } # [doc = "Constants"] # [allow (non_upper_case_globals)] impl AnimationNodeOneShot { pub const MIX_MODE_BLEND : i64 = 0i64 ; pub const MIX_MODE_ADD : i64 = 1i64 ; } impl AnimationNodeOneShot { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AnimationNodeOneShotMethodTable :: 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 delay after which the automatic restart is triggered, in seconds."] # [doc = ""] # [inline] pub fn autorestart_delay (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeOneShotMethodTable :: get (get_api ()) . get_autorestart_delay ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "If [`autorestart`][Self::autorestart] is `true`, a random additional delay (in seconds) between 0 and this value will be added to [`autorestart_delay`][Self::autorestart_delay]."] # [doc = ""] # [inline] pub fn autorestart_random_delay (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeOneShotMethodTable :: get (get_api ()) . get_autorestart_random_delay ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = ""] # [doc = ""] # [inline] pub fn fadein_time (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeOneShotMethodTable :: get (get_api ()) . get_fadein_time ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = ""] # [doc = ""] # [inline] pub fn fadeout_time (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeOneShotMethodTable :: get (get_api ()) . get_fadeout_time ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = ""] # [doc = ""] # [inline] pub fn mix_mode (& self) -> crate :: generated :: animation_node_one_shot :: MixMode { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeOneShotMethodTable :: get (get_api ()) . get_mix_mode ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < crate :: generated :: animation_node_one_shot :: MixMode > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "If `true`, the sub-animation will restart automatically after finishing."] # [doc = ""] # [inline] pub fn has_autorestart (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeOneShotMethodTable :: get (get_api ()) . has_autorestart ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = ""] # [doc = ""] # [inline] pub fn is_using_sync (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeOneShotMethodTable :: get (get_api ()) . is_using_sync ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "If `true`, the sub-animation will restart automatically after finishing."] # [doc = ""] # [inline] pub fn set_autorestart (& self , enable : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeOneShotMethodTable :: get (get_api ()) . set_autorestart ; let ret = crate :: icalls :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , enable as _) ; } } # [doc = "The delay after which the automatic restart is triggered, in seconds."] # [doc = ""] # [inline] pub fn set_autorestart_delay (& self , enable : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeOneShotMethodTable :: get (get_api ()) . set_autorestart_delay ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , enable as _) ; } } # [doc = "If [`autorestart`][Self::autorestart] is `true`, a random additional delay (in seconds) between 0 and this value will be added to [`autorestart_delay`][Self::autorestart_delay]."] # [doc = ""] # [inline] pub fn set_autorestart_random_delay (& self , enable : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeOneShotMethodTable :: get (get_api ()) . set_autorestart_random_delay ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , enable as _) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn set_fadein_time (& self , time : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeOneShotMethodTable :: get (get_api ()) . set_fadein_time ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , time as _) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn set_fadeout_time (& self , time : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeOneShotMethodTable :: get (get_api ()) . set_fadeout_time ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , time as _) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn set_mix_mode (& self , mode : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeOneShotMethodTable :: get (get_api ()) . set_mix_mode ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , mode as _) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn set_use_sync (& self , enable : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeOneShotMethodTable :: get (get_api ()) . set_use_sync ; let ret = crate :: icalls :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , enable as _) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for AnimationNodeOneShot { } unsafe impl GodotObject for AnimationNodeOneShot { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AnimationNodeOneShot" } } impl std :: ops :: Deref for AnimationNodeOneShot { type Target = crate :: generated :: AnimationNode ; # [inline] fn deref (& self) -> & crate :: generated :: AnimationNode { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AnimationNodeOneShot { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: AnimationNode { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: AnimationNode > for AnimationNodeOneShot { } unsafe impl SubClass < crate :: generated :: Resource > for AnimationNodeOneShot { } unsafe impl SubClass < crate :: generated :: Reference > for AnimationNodeOneShot { } unsafe impl SubClass < crate :: generated :: Object > for AnimationNodeOneShot { } impl Instanciable for AnimationNodeOneShot { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { AnimationNodeOneShot :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AnimationNodeOneShotMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_autorestart_delay : * mut sys :: godot_method_bind , pub get_autorestart_random_delay : * mut sys :: godot_method_bind , pub get_fadein_time : * mut sys :: godot_method_bind , pub get_fadeout_time : * mut sys :: godot_method_bind , pub get_mix_mode : * mut sys :: godot_method_bind , pub has_autorestart : * mut sys :: godot_method_bind , pub is_using_sync : * mut sys :: godot_method_bind , pub set_autorestart : * mut sys :: godot_method_bind , pub set_autorestart_delay : * mut sys :: godot_method_bind , pub set_autorestart_random_delay : * mut sys :: godot_method_bind , pub set_fadein_time : * mut sys :: godot_method_bind , pub set_fadeout_time : * mut sys :: godot_method_bind , pub set_mix_mode : * mut sys :: godot_method_bind , pub set_use_sync : * mut sys :: godot_method_bind } impl AnimationNodeOneShotMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AnimationNodeOneShotMethodTable = AnimationNodeOneShotMethodTable { class_constructor : None , get_autorestart_delay : 0 as * mut sys :: godot_method_bind , get_autorestart_random_delay : 0 as * mut sys :: godot_method_bind , get_fadein_time : 0 as * mut sys :: godot_method_bind , get_fadeout_time : 0 as * mut sys :: godot_method_bind , get_mix_mode : 0 as * mut sys :: godot_method_bind , has_autorestart : 0 as * mut sys :: godot_method_bind , is_using_sync : 0 as * mut sys :: godot_method_bind , set_autorestart : 0 as * mut sys :: godot_method_bind , set_autorestart_delay : 0 as * mut sys :: godot_method_bind , set_autorestart_random_delay : 0 as * mut sys :: godot_method_bind , set_fadein_time : 0 as * mut sys :: godot_method_bind , set_fadeout_time : 0 as * mut sys :: godot_method_bind , set_mix_mode : 0 as * mut sys :: godot_method_bind , set_use_sync : 0 as * mut sys :: godot_method_bind } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { AnimationNodeOneShotMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AnimationNodeOneShot\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_autorestart_delay = (gd_api . godot_method_bind_get_method) (class_name , "get_autorestart_delay\0" . as_ptr () as * const c_char) ; table . get_autorestart_random_delay = (gd_api . godot_method_bind_get_method) (class_name , "get_autorestart_random_delay\0" . as_ptr () as * const c_char) ; table . get_fadein_time = (gd_api . godot_method_bind_get_method) (class_name , "get_fadein_time\0" . as_ptr () as * const c_char) ; table . get_fadeout_time = (gd_api . godot_method_bind_get_method) (class_name , "get_fadeout_time\0" . as_ptr () as * const c_char) ; table . get_mix_mode = (gd_api . godot_method_bind_get_method) (class_name , "get_mix_mode\0" . as_ptr () as * const c_char) ; table . has_autorestart = (gd_api . godot_method_bind_get_method) (class_name , "has_autorestart\0" . as_ptr () as * const c_char) ; table . is_using_sync = (gd_api . godot_method_bind_get_method) (class_name , "is_using_sync\0" . as_ptr () as * const c_char) ; table . set_autorestart = (gd_api . godot_method_bind_get_method) (class_name , "set_autorestart\0" . as_ptr () as * const c_char) ; table . set_autorestart_delay = (gd_api . godot_method_bind_get_method) (class_name , "set_autorestart_delay\0" . as_ptr () as * const c_char) ; table . set_autorestart_random_delay = (gd_api . godot_method_bind_get_method) (class_name , "set_autorestart_random_delay\0" . as_ptr () as * const c_char) ; table . set_fadein_time = (gd_api . godot_method_bind_get_method) (class_name , "set_fadein_time\0" . as_ptr () as * const c_char) ; table . set_fadeout_time = (gd_api . godot_method_bind_get_method) (class_name , "set_fadeout_time\0" . as_ptr () as * const c_char) ; table . set_mix_mode = (gd_api . godot_method_bind_get_method) (class_name , "set_mix_mode\0" . as_ptr () as * const c_char) ; table . set_use_sync = (gd_api . godot_method_bind_get_method) (class_name , "set_use_sync\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:165:3688 [INFO] [stdout] | [INFO] [stdout] 165 | ...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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 165 | # ! [doc = "This module contains types related to the API class [`AnimationNodeOutput`][super::AnimationNodeOutput]."] pub (crate) mod private { # [doc = "`core class AnimationNodeOutput` inherits `AnimationNode` (reference-counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_animationnodeoutput.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\nAnimationNodeOutput inherits methods from:\n - [AnimationNode](struct.AnimationNode.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 `Ownership` in these types tracks whether\nownership 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 AnimationNodeOutput { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AnimationNodeOutput ; impl AnimationNodeOutput { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AnimationNodeOutputMethodTable :: 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 AnimationNodeOutput { } unsafe impl GodotObject for AnimationNodeOutput { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AnimationNodeOutput" } } impl std :: ops :: Deref for AnimationNodeOutput { type Target = crate :: generated :: AnimationNode ; # [inline] fn deref (& self) -> & crate :: generated :: AnimationNode { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AnimationNodeOutput { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: AnimationNode { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: AnimationNode > for AnimationNodeOutput { } unsafe impl SubClass < crate :: generated :: Resource > for AnimationNodeOutput { } unsafe impl SubClass < crate :: generated :: Reference > for AnimationNodeOutput { } unsafe impl SubClass < crate :: generated :: Object > for AnimationNodeOutput { } impl Instanciable for AnimationNodeOutput { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { AnimationNodeOutput :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AnimationNodeOutputMethodTable { pub class_constructor : sys :: godot_class_constructor , } impl AnimationNodeOutputMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AnimationNodeOutputMethodTable = AnimationNodeOutputMethodTable { class_constructor : None , } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { AnimationNodeOutputMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AnimationNodeOutput\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 [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:171:17461 [INFO] [stdout] | [INFO] [stdout] 171 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 171 | # ! [doc = "This module contains types related to the API class [`AnimationNodeStateMachine`][super::AnimationNodeStateMachine]."] pub (crate) mod private { # [doc = "`core class AnimationNodeStateMachine` inherits `AnimationRootNode` (reference-counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_animationnodestatemachine.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\nAnimationNodeStateMachine inherits methods from:\n - [AnimationRootNode](struct.AnimationRootNode.html)\n - [AnimationNode](struct.AnimationNode.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 `Ownership` in these types tracks whether\nownership 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 AnimationNodeStateMachine { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AnimationNodeStateMachine ; impl AnimationNodeStateMachine { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AnimationNodeStateMachineMethodTable :: 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 node to the graph. The `position` is used for display in the editor.\n# Default Arguments\n* `position` - `Vector2( 0, 0 )`"] # [doc = ""] # [inline] pub fn add_node (& self , name : impl Into < GodotString > , node : impl AsArg < crate :: generated :: AnimationNode > , position : Vector2) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeStateMachineMethodTable :: get (get_api ()) . add_node ; let ret = crate :: icalls :: icallvar__str_obj_vec2 (method_bind , self . this . sys () . as_ptr () , name . into () , node . as_arg_ptr () , position) ; } } # [doc = "Adds a transition between the given nodes."] # [doc = ""] # [inline] pub fn add_transition (& self , from : impl Into < GodotString > , to : impl Into < GodotString > , transition : impl AsArg < crate :: generated :: AnimationNodeStateMachineTransition >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeStateMachineMethodTable :: get (get_api ()) . add_transition ; let ret = crate :: icalls :: icallvar__str_str_obj (method_bind , self . this . sys () . as_ptr () , from . into () , to . into () , transition . as_arg_ptr ()) ; } } # [doc = "Returns the graph's end node."] # [doc = ""] # [inline] pub fn get_end_node (& self) -> GodotString { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeStateMachineMethodTable :: get (get_api ()) . get_end_node ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < GodotString > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns the draw offset of the graph. Used for display in the editor."] # [doc = ""] # [inline] pub fn get_graph_offset (& self) -> Vector2 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeStateMachineMethodTable :: get (get_api ()) . get_graph_offset ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < Vector2 > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns the animation node with the given name."] # [doc = ""] # [inline] pub fn get_node (& self , name : impl Into < GodotString >) -> Option < Ref < crate :: generated :: AnimationNode , ownership :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeStateMachineMethodTable :: get (get_api ()) . get_node ; let ret = crate :: icalls :: icallvar__str (method_bind , self . this . sys () . as_ptr () , name . into ()) ; < Option < Ref < crate :: generated :: AnimationNode , ownership :: Shared > > > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns the given animation node's name."] # [doc = ""] # [inline] pub fn get_node_name (& self , node : impl AsArg < crate :: generated :: AnimationNode >) -> GodotString { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeStateMachineMethodTable :: get (get_api ()) . get_node_name ; let ret = crate :: icalls :: icallvar__obj (method_bind , self . this . sys () . as_ptr () , node . as_arg_ptr ()) ; < GodotString > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns the given node's coordinates. Used for display in the editor."] # [doc = ""] # [inline] pub fn get_node_position (& self , name : impl Into < GodotString >) -> Vector2 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeStateMachineMethodTable :: get (get_api ()) . get_node_position ; let ret = crate :: icalls :: icallvar__str (method_bind , self . this . sys () . as_ptr () , name . into ()) ; < Vector2 > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns the graph's end node."] # [doc = ""] # [inline] pub fn get_start_node (& self) -> GodotString { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeStateMachineMethodTable :: get (get_api ()) . get_start_node ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < GodotString > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns the given transition."] # [doc = ""] # [inline] pub fn get_transition (& self , idx : i64) -> Option < Ref < crate :: generated :: AnimationNodeStateMachineTransition , ownership :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeStateMachineMethodTable :: get (get_api ()) . get_transition ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , idx as _) ; < Option < Ref < crate :: generated :: AnimationNodeStateMachineTransition , ownership :: Shared > > > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns the number of connections in the graph."] # [doc = ""] # [inline] pub fn get_transition_count (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeStateMachineMethodTable :: get (get_api ()) . get_transition_count ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "Returns the given transition's start node."] # [doc = ""] # [inline] pub fn get_transition_from (& self , idx : i64) -> GodotString { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeStateMachineMethodTable :: get (get_api ()) . get_transition_from ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , idx as _) ; < GodotString > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns the given transition's end node."] # [doc = ""] # [inline] pub fn get_transition_to (& self , idx : i64) -> GodotString { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeStateMachineMethodTable :: get (get_api ()) . get_transition_to ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , idx as _) ; < GodotString > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns `true` if the graph contains the given node."] # [doc = ""] # [inline] pub fn has_node (& self , name : impl Into < GodotString >) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeStateMachineMethodTable :: get (get_api ()) . has_node ; let ret = crate :: icalls :: icallvar__str (method_bind , self . this . sys () . as_ptr () , name . into ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "Returns `true` if there is a transition between the given nodes."] # [doc = ""] # [inline] pub fn has_transition (& self , from : impl Into < GodotString > , to : impl Into < GodotString >) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeStateMachineMethodTable :: get (get_api ()) . has_transition ; let ret = crate :: icalls :: icallvar__str_str (method_bind , self . this . sys () . as_ptr () , from . into () , to . into ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "Deletes the given node from the graph."] # [doc = ""] # [inline] pub fn remove_node (& self , name : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeStateMachineMethodTable :: get (get_api ()) . remove_node ; let ret = crate :: icalls :: icallvar__str (method_bind , self . this . sys () . as_ptr () , name . into ()) ; } } # [doc = "Deletes the transition between the two specified nodes."] # [doc = ""] # [inline] pub fn remove_transition (& self , from : impl Into < GodotString > , to : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeStateMachineMethodTable :: get (get_api ()) . remove_transition ; let ret = crate :: icalls :: icallvar__str_str (method_bind , self . this . sys () . as_ptr () , from . into () , to . into ()) ; } } # [doc = "Deletes the given transition by index."] # [doc = ""] # [inline] pub fn remove_transition_by_index (& self , idx : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeStateMachineMethodTable :: get (get_api ()) . remove_transition_by_index ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , idx as _) ; } } # [doc = "Renames the given node."] # [doc = ""] # [inline] pub fn rename_node (& self , name : impl Into < GodotString > , new_name : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeStateMachineMethodTable :: get (get_api ()) . rename_node ; let ret = crate :: icalls :: icallvar__str_str (method_bind , self . this . sys () . as_ptr () , name . into () , new_name . into ()) ; } } # [doc = "Replaces the node and keeps its transitions unchanged."] # [doc = ""] # [inline] pub fn replace_node (& self , name : impl Into < GodotString > , node : impl AsArg < crate :: generated :: AnimationNode >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeStateMachineMethodTable :: get (get_api ()) . replace_node ; let ret = crate :: icalls :: icallvar__str_obj (method_bind , self . this . sys () . as_ptr () , name . into () , node . as_arg_ptr ()) ; } } # [doc = "Sets the given node as the graph end point."] # [doc = ""] # [inline] pub fn set_end_node (& self , name : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeStateMachineMethodTable :: get (get_api ()) . set_end_node ; let ret = crate :: icalls :: icallvar__str (method_bind , self . this . sys () . as_ptr () , name . into ()) ; } } # [doc = "Sets the draw offset of the graph. Used for display in the editor."] # [doc = ""] # [inline] pub fn set_graph_offset (& self , offset : Vector2) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeStateMachineMethodTable :: get (get_api ()) . set_graph_offset ; let ret = crate :: icalls :: icallvar__vec2 (method_bind , self . this . sys () . as_ptr () , offset) ; } } # [doc = "Sets the node's coordinates. Used for display in the editor."] # [doc = ""] # [inline] pub fn set_node_position (& self , name : impl Into < GodotString > , position : Vector2) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeStateMachineMethodTable :: get (get_api ()) . set_node_position ; let ret = crate :: icalls :: icallvar__str_vec2 (method_bind , self . this . sys () . as_ptr () , name . into () , position) ; } } # [doc = "Sets the given node as the graph start point."] # [doc = ""] # [inline] pub fn set_start_node (& self , name : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeStateMachineMethodTable :: get (get_api ()) . set_start_node ; let ret = crate :: icalls :: icallvar__str (method_bind , self . this . sys () . as_ptr () , name . into ()) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for AnimationNodeStateMachine { } unsafe impl GodotObject for AnimationNodeStateMachine { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AnimationNodeStateMachine" } } impl std :: ops :: Deref for AnimationNodeStateMachine { type Target = crate :: generated :: AnimationRootNode ; # [inline] fn deref (& self) -> & crate :: generated :: AnimationRootNode { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AnimationNodeStateMachine { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: AnimationRootNode { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: AnimationRootNode > for AnimationNodeStateMachine { } unsafe impl SubClass < crate :: generated :: AnimationNode > for AnimationNodeStateMachine { } unsafe impl SubClass < crate :: generated :: Resource > for AnimationNodeStateMachine { } unsafe impl SubClass < crate :: generated :: Reference > for AnimationNodeStateMachine { } unsafe impl SubClass < crate :: generated :: Object > for AnimationNodeStateMachine { } impl Instanciable for AnimationNodeStateMachine { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { AnimationNodeStateMachine :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AnimationNodeStateMachineMethodTable { pub class_constructor : sys :: godot_class_constructor , pub add_node : * mut sys :: godot_method_bind , pub add_transition : * mut sys :: godot_method_bind , pub get_end_node : * 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_name : * mut sys :: godot_method_bind , pub get_node_position : * mut sys :: godot_method_bind , pub get_start_node : * mut sys :: godot_method_bind , pub get_transition : * mut sys :: godot_method_bind , pub get_transition_count : * mut sys :: godot_method_bind , pub get_transition_from : * mut sys :: godot_method_bind , pub get_transition_to : * mut sys :: godot_method_bind , pub has_node : * mut sys :: godot_method_bind , pub has_transition : * mut sys :: godot_method_bind , pub remove_node : * mut sys :: godot_method_bind , pub remove_transition : * mut sys :: godot_method_bind , pub remove_transition_by_index : * mut sys :: godot_method_bind , pub rename_node : * mut sys :: godot_method_bind , pub replace_node : * mut sys :: godot_method_bind , pub set_end_node : * mut sys :: godot_method_bind , pub set_graph_offset : * mut sys :: godot_method_bind , pub set_node_position : * mut sys :: godot_method_bind , pub set_start_node : * mut sys :: godot_method_bind } impl AnimationNodeStateMachineMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AnimationNodeStateMachineMethodTable = AnimationNodeStateMachineMethodTable { class_constructor : None , add_node : 0 as * mut sys :: godot_method_bind , add_transition : 0 as * mut sys :: godot_method_bind , get_end_node : 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_name : 0 as * mut sys :: godot_method_bind , get_node_position : 0 as * mut sys :: godot_method_bind , get_start_node : 0 as * mut sys :: godot_method_bind , get_transition : 0 as * mut sys :: godot_method_bind , get_transition_count : 0 as * mut sys :: godot_method_bind , get_transition_from : 0 as * mut sys :: godot_method_bind , get_transition_to : 0 as * mut sys :: godot_method_bind , has_node : 0 as * mut sys :: godot_method_bind , has_transition : 0 as * mut sys :: godot_method_bind , remove_node : 0 as * mut sys :: godot_method_bind , remove_transition : 0 as * mut sys :: godot_method_bind , remove_transition_by_index : 0 as * mut sys :: godot_method_bind , rename_node : 0 as * mut sys :: godot_method_bind , replace_node : 0 as * mut sys :: godot_method_bind , set_end_node : 0 as * mut sys :: godot_method_bind , set_graph_offset : 0 as * mut sys :: godot_method_bind , set_node_position : 0 as * mut sys :: godot_method_bind , set_start_node : 0 as * mut sys :: godot_method_bind } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { AnimationNodeStateMachineMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AnimationNodeStateMachine\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 . add_transition = (gd_api . godot_method_bind_get_method) (class_name , "add_transition\0" . as_ptr () as * const c_char) ; table . get_end_node = (gd_api . godot_method_bind_get_method) (class_name , "get_end_node\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_name = (gd_api . godot_method_bind_get_method) (class_name , "get_node_name\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_start_node = (gd_api . godot_method_bind_get_method) (class_name , "get_start_node\0" . as_ptr () as * const c_char) ; table . get_transition = (gd_api . godot_method_bind_get_method) (class_name , "get_transition\0" . as_ptr () as * const c_char) ; table . get_transition_count = (gd_api . godot_method_bind_get_method) (class_name , "get_transition_count\0" . as_ptr () as * const c_char) ; table . get_transition_from = (gd_api . godot_method_bind_get_method) (class_name , "get_transition_from\0" . as_ptr () as * const c_char) ; table . get_transition_to = (gd_api . godot_method_bind_get_method) (class_name , "get_transition_to\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_transition = (gd_api . godot_method_bind_get_method) (class_name , "has_transition\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_transition = (gd_api . godot_method_bind_get_method) (class_name , "remove_transition\0" . as_ptr () as * const c_char) ; table . remove_transition_by_index = (gd_api . godot_method_bind_get_method) (class_name , "remove_transition_by_index\0" . as_ptr () as * const c_char) ; table . rename_node = (gd_api . godot_method_bind_get_method) (class_name , "rename_node\0" . as_ptr () as * const c_char) ; table . replace_node = (gd_api . godot_method_bind_get_method) (class_name , "replace_node\0" . as_ptr () as * const c_char) ; table . set_end_node = (gd_api . godot_method_bind_get_method) (class_name , "set_end_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_node_position = (gd_api . godot_method_bind_get_method) (class_name , "set_node_position\0" . as_ptr () as * const c_char) ; table . set_start_node = (gd_api . godot_method_bind_get_method) (class_name , "set_start_node\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:177:8002 [INFO] [stdout] | [INFO] [stdout] 177 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 177 | # ! [doc = "This module contains types related to the API class [`AnimationNodeStateMachinePlayback`][super::AnimationNodeStateMachinePlayback]."] pub (crate) mod private { # [doc = "`core class AnimationNodeStateMachinePlayback` inherits `Resource` (reference-counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_animationnodestatemachineplayback.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\nAnimationNodeStateMachinePlayback 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 `Ownership` in these types tracks whether\nownership 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 AnimationNodeStateMachinePlayback { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AnimationNodeStateMachinePlayback ; impl AnimationNodeStateMachinePlayback { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AnimationNodeStateMachinePlaybackMethodTable :: 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 get_current_length (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeStateMachinePlaybackMethodTable :: get (get_api ()) . get_current_length ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Returns the currently playing animation state."] # [doc = ""] # [inline] pub fn get_current_node (& self) -> GodotString { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeStateMachinePlaybackMethodTable :: get (get_api ()) . get_current_node ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < GodotString > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns the playback position within the current animation state."] # [doc = ""] # [inline] pub fn get_current_play_position (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeStateMachinePlaybackMethodTable :: get (get_api ()) . get_current_play_position ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Returns the current travel path as computed internally by the A* algorithm."] # [doc = ""] # [inline] pub fn get_travel_path (& self) -> PoolArray < GodotString > { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeStateMachinePlaybackMethodTable :: get (get_api ()) . get_travel_path ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < PoolArray < GodotString > > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns `true` if an animation is playing."] # [doc = ""] # [inline] pub fn is_playing (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeStateMachinePlaybackMethodTable :: get (get_api ()) . is_playing ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "Starts playing the given animation."] # [doc = ""] # [inline] pub fn start (& self , node : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeStateMachinePlaybackMethodTable :: get (get_api ()) . start ; let ret = crate :: icalls :: icallvar__str (method_bind , self . this . sys () . as_ptr () , node . into ()) ; } } # [doc = "Stops the currently playing animation."] # [doc = ""] # [inline] pub fn stop (& self) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeStateMachinePlaybackMethodTable :: get (get_api ()) . stop ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; } } # [doc = "Transitions from the current state to another one, following the shortest path."] # [doc = ""] # [inline] pub fn travel (& self , to_node : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeStateMachinePlaybackMethodTable :: get (get_api ()) . travel ; let ret = crate :: icalls :: icallvar__str (method_bind , self . this . sys () . as_ptr () , to_node . into ()) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for AnimationNodeStateMachinePlayback { } unsafe impl GodotObject for AnimationNodeStateMachinePlayback { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AnimationNodeStateMachinePlayback" } } impl std :: ops :: Deref for AnimationNodeStateMachinePlayback { type Target = crate :: generated :: Resource ; # [inline] fn deref (& self) -> & crate :: generated :: Resource { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AnimationNodeStateMachinePlayback { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: Resource { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: Resource > for AnimationNodeStateMachinePlayback { } unsafe impl SubClass < crate :: generated :: Reference > for AnimationNodeStateMachinePlayback { } unsafe impl SubClass < crate :: generated :: Object > for AnimationNodeStateMachinePlayback { } impl Instanciable for AnimationNodeStateMachinePlayback { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { AnimationNodeStateMachinePlayback :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AnimationNodeStateMachinePlaybackMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_current_length : * mut sys :: godot_method_bind , pub get_current_node : * mut sys :: godot_method_bind , pub get_current_play_position : * mut sys :: godot_method_bind , pub get_travel_path : * mut sys :: godot_method_bind , pub is_playing : * mut sys :: godot_method_bind , pub start : * mut sys :: godot_method_bind , pub stop : * mut sys :: godot_method_bind , pub travel : * mut sys :: godot_method_bind } impl AnimationNodeStateMachinePlaybackMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AnimationNodeStateMachinePlaybackMethodTable = AnimationNodeStateMachinePlaybackMethodTable { class_constructor : None , get_current_length : 0 as * mut sys :: godot_method_bind , get_current_node : 0 as * mut sys :: godot_method_bind , get_current_play_position : 0 as * mut sys :: godot_method_bind , get_travel_path : 0 as * mut sys :: godot_method_bind , is_playing : 0 as * mut sys :: godot_method_bind , start : 0 as * mut sys :: godot_method_bind , stop : 0 as * mut sys :: godot_method_bind , travel : 0 as * mut sys :: godot_method_bind } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { AnimationNodeStateMachinePlaybackMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AnimationNodeStateMachinePlayback\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_current_length = (gd_api . godot_method_bind_get_method) (class_name , "get_current_length\0" . as_ptr () as * const c_char) ; table . get_current_node = (gd_api . godot_method_bind_get_method) (class_name , "get_current_node\0" . as_ptr () as * const c_char) ; table . get_current_play_position = (gd_api . godot_method_bind_get_method) (class_name , "get_current_play_position\0" . as_ptr () as * const c_char) ; table . get_travel_path = (gd_api . godot_method_bind_get_method) (class_name , "get_travel_path\0" . as_ptr () as * const c_char) ; table . is_playing = (gd_api . godot_method_bind_get_method) (class_name , "is_playing\0" . as_ptr () as * const c_char) ; table . start = (gd_api . godot_method_bind_get_method) (class_name , "start\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 . travel = (gd_api . godot_method_bind_get_method) (class_name , "travel\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:183:13225 [INFO] [stdout] | [INFO] [stdout] 183 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 183 | # ! [doc = "This module contains types related to the API class [`AnimationNodeStateMachineTransition`][super::AnimationNodeStateMachineTransition]."] pub (crate) mod private { # [doc = "`core class AnimationNodeStateMachineTransition` inherits `Resource` (reference-counted).\n\nThis class has related types in the [`animation_node_state_machine_transition`][super::animation_node_state_machine_transition] module."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_animationnodestatemachinetransition.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\nAnimationNodeStateMachineTransition 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 `Ownership` in these types tracks whether\nownership 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 AnimationNodeStateMachineTransition { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AnimationNodeStateMachineTransition ; # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct SwitchMode (pub i64) ; impl SwitchMode { pub const IMMEDIATE : SwitchMode = SwitchMode (0i64) ; pub const SYNC : SwitchMode = SwitchMode (1i64) ; pub const AT_END : SwitchMode = SwitchMode (2i64) ; } impl From < i64 > for SwitchMode { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < SwitchMode > for i64 { # [inline] fn from (v : SwitchMode) -> Self { v . 0 } } impl FromVariant for SwitchMode { # [inline] fn from_variant (v : & Variant) -> Result < Self , FromVariantError > { i64 :: from_variant (v) . map (Self :: from) } } # [doc = "Constants"] # [allow (non_upper_case_globals)] impl AnimationNodeStateMachineTransition { pub const SWITCH_MODE_IMMEDIATE : i64 = 0i64 ; pub const SWITCH_MODE_SYNC : i64 = 1i64 ; pub const SWITCH_MODE_AT_END : i64 = 2i64 ; } impl AnimationNodeStateMachineTransition { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AnimationNodeStateMachineTransitionMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "_Sample code is GDScript unless otherwise noted._\n\nTurn on auto advance when this condition is set. The provided name will become a boolean parameter on the [`AnimationTree`][AnimationTree] that can be controlled from code (see [Using AnimationTree](https://docs.godotengine.org/en/3.5.1/tutorials/animation/animation_tree.html#controlling-from-code)). For example, if [`AnimationTree.tree_root`][AnimationTree::tree_root] is an [`AnimationNodeStateMachine`][AnimationNodeStateMachine] and [`advance_condition`][Self::advance_condition] is set to `\"idle\"`:\n```gdscript\n$animation_tree[\"parameters/conditions/idle\"] = is_on_floor and (linear_velocity.x == 0)\n```"] # [doc = ""] # [inline] pub fn advance_condition (& self) -> GodotString { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeStateMachineTransitionMethodTable :: get (get_api ()) . get_advance_condition ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < GodotString > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Lower priority transitions are preferred when travelling through the tree via [`AnimationNodeStateMachinePlayback.travel`][AnimationNodeStateMachinePlayback::travel] or [`auto_advance`][Self::auto_advance]."] # [doc = ""] # [inline] pub fn priority (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeStateMachineTransitionMethodTable :: get (get_api ()) . get_priority ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "The transition type."] # [doc = ""] # [inline] pub fn switch_mode (& self) -> crate :: generated :: animation_node_state_machine_transition :: SwitchMode { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeStateMachineTransitionMethodTable :: get (get_api ()) . get_switch_mode ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < crate :: generated :: animation_node_state_machine_transition :: SwitchMode > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "The time to cross-fade between this state and the next."] # [doc = ""] # [inline] pub fn xfade_time (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeStateMachineTransitionMethodTable :: get (get_api ()) . get_xfade_time ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Turn on the transition automatically when this state is reached. This works best with [`SWITCH_MODE_AT_END`][Self::SWITCH_MODE_AT_END]."] # [doc = ""] # [inline] pub fn has_auto_advance (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeStateMachineTransitionMethodTable :: get (get_api ()) . has_auto_advance ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "Don't use this transition during [`AnimationNodeStateMachinePlayback.travel`][AnimationNodeStateMachinePlayback::travel] or [`auto_advance`][Self::auto_advance]."] # [doc = ""] # [inline] pub fn is_disabled (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeStateMachineTransitionMethodTable :: get (get_api ()) . is_disabled ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "_Sample code is GDScript unless otherwise noted._\n\nTurn on auto advance when this condition is set. The provided name will become a boolean parameter on the [`AnimationTree`][AnimationTree] that can be controlled from code (see [Using AnimationTree](https://docs.godotengine.org/en/3.5.1/tutorials/animation/animation_tree.html#controlling-from-code)). For example, if [`AnimationTree.tree_root`][AnimationTree::tree_root] is an [`AnimationNodeStateMachine`][AnimationNodeStateMachine] and [`advance_condition`][Self::advance_condition] is set to `\"idle\"`:\n```gdscript\n$animation_tree[\"parameters/conditions/idle\"] = is_on_floor and (linear_velocity.x == 0)\n```"] # [doc = ""] # [inline] pub fn set_advance_condition (& self , name : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeStateMachineTransitionMethodTable :: get (get_api ()) . set_advance_condition ; let ret = crate :: icalls :: icallvar__str (method_bind , self . this . sys () . as_ptr () , name . into ()) ; } } # [doc = "Turn on the transition automatically when this state is reached. This works best with [`SWITCH_MODE_AT_END`][Self::SWITCH_MODE_AT_END]."] # [doc = ""] # [inline] pub fn set_auto_advance (& self , auto_advance : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeStateMachineTransitionMethodTable :: get (get_api ()) . set_auto_advance ; let ret = crate :: icalls :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , auto_advance as _) ; } } # [doc = "Don't use this transition during [`AnimationNodeStateMachinePlayback.travel`][AnimationNodeStateMachinePlayback::travel] or [`auto_advance`][Self::auto_advance]."] # [doc = ""] # [inline] pub fn set_disabled (& self , disabled : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeStateMachineTransitionMethodTable :: get (get_api ()) . set_disabled ; let ret = crate :: icalls :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , disabled as _) ; } } # [doc = "Lower priority transitions are preferred when travelling through the tree via [`AnimationNodeStateMachinePlayback.travel`][AnimationNodeStateMachinePlayback::travel] or [`auto_advance`][Self::auto_advance]."] # [doc = ""] # [inline] pub fn set_priority (& self , priority : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeStateMachineTransitionMethodTable :: get (get_api ()) . set_priority ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , priority as _) ; } } # [doc = "The transition type."] # [doc = ""] # [inline] pub fn set_switch_mode (& self , mode : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeStateMachineTransitionMethodTable :: get (get_api ()) . set_switch_mode ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , mode as _) ; } } # [doc = "The time to cross-fade between this state and the next."] # [doc = ""] # [inline] pub fn set_xfade_time (& self , secs : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeStateMachineTransitionMethodTable :: get (get_api ()) . set_xfade_time ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , secs as _) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for AnimationNodeStateMachineTransition { } unsafe impl GodotObject for AnimationNodeStateMachineTransition { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AnimationNodeStateMachineTransition" } } impl std :: ops :: Deref for AnimationNodeStateMachineTransition { type Target = crate :: generated :: Resource ; # [inline] fn deref (& self) -> & crate :: generated :: Resource { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AnimationNodeStateMachineTransition { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: Resource { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: Resource > for AnimationNodeStateMachineTransition { } unsafe impl SubClass < crate :: generated :: Reference > for AnimationNodeStateMachineTransition { } unsafe impl SubClass < crate :: generated :: Object > for AnimationNodeStateMachineTransition { } impl Instanciable for AnimationNodeStateMachineTransition { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { AnimationNodeStateMachineTransition :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AnimationNodeStateMachineTransitionMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_advance_condition : * mut sys :: godot_method_bind , pub get_priority : * mut sys :: godot_method_bind , pub get_switch_mode : * mut sys :: godot_method_bind , pub get_xfade_time : * mut sys :: godot_method_bind , pub has_auto_advance : * mut sys :: godot_method_bind , pub is_disabled : * mut sys :: godot_method_bind , pub set_advance_condition : * mut sys :: godot_method_bind , pub set_auto_advance : * mut sys :: godot_method_bind , pub set_disabled : * mut sys :: godot_method_bind , pub set_priority : * mut sys :: godot_method_bind , pub set_switch_mode : * mut sys :: godot_method_bind , pub set_xfade_time : * mut sys :: godot_method_bind } impl AnimationNodeStateMachineTransitionMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AnimationNodeStateMachineTransitionMethodTable = AnimationNodeStateMachineTransitionMethodTable { class_constructor : None , get_advance_condition : 0 as * mut sys :: godot_method_bind , get_priority : 0 as * mut sys :: godot_method_bind , get_switch_mode : 0 as * mut sys :: godot_method_bind , get_xfade_time : 0 as * mut sys :: godot_method_bind , has_auto_advance : 0 as * mut sys :: godot_method_bind , is_disabled : 0 as * mut sys :: godot_method_bind , set_advance_condition : 0 as * mut sys :: godot_method_bind , set_auto_advance : 0 as * mut sys :: godot_method_bind , set_disabled : 0 as * mut sys :: godot_method_bind , set_priority : 0 as * mut sys :: godot_method_bind , set_switch_mode : 0 as * mut sys :: godot_method_bind , set_xfade_time : 0 as * mut sys :: godot_method_bind } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { AnimationNodeStateMachineTransitionMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AnimationNodeStateMachineTransition\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_advance_condition = (gd_api . godot_method_bind_get_method) (class_name , "get_advance_condition\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_switch_mode = (gd_api . godot_method_bind_get_method) (class_name , "get_switch_mode\0" . as_ptr () as * const c_char) ; table . get_xfade_time = (gd_api . godot_method_bind_get_method) (class_name , "get_xfade_time\0" . as_ptr () as * const c_char) ; table . has_auto_advance = (gd_api . godot_method_bind_get_method) (class_name , "has_auto_advance\0" . as_ptr () as * const c_char) ; table . is_disabled = (gd_api . godot_method_bind_get_method) (class_name , "is_disabled\0" . as_ptr () as * const c_char) ; table . set_advance_condition = (gd_api . godot_method_bind_get_method) (class_name , "set_advance_condition\0" . as_ptr () as * const c_char) ; table . set_auto_advance = (gd_api . godot_method_bind_get_method) (class_name , "set_auto_advance\0" . as_ptr () as * const c_char) ; table . set_disabled = (gd_api . godot_method_bind_get_method) (class_name , "set_disabled\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_switch_mode = (gd_api . godot_method_bind_get_method) (class_name , "set_switch_mode\0" . as_ptr () as * const c_char) ; table . set_xfade_time = (gd_api . godot_method_bind_get_method) (class_name , "set_xfade_time\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:189:3760 [INFO] [stdout] | [INFO] [stdout] 189 | ...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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 189 | # ! [doc = "This module contains types related to the API class [`AnimationNodeTimeScale`][super::AnimationNodeTimeScale]."] pub (crate) mod private { # [doc = "`core class AnimationNodeTimeScale` inherits `AnimationNode` (reference-counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_animationnodetimescale.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\nAnimationNodeTimeScale inherits methods from:\n - [AnimationNode](struct.AnimationNode.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 `Ownership` in these types tracks whether\nownership 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 AnimationNodeTimeScale { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AnimationNodeTimeScale ; impl AnimationNodeTimeScale { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AnimationNodeTimeScaleMethodTable :: 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 AnimationNodeTimeScale { } unsafe impl GodotObject for AnimationNodeTimeScale { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AnimationNodeTimeScale" } } impl std :: ops :: Deref for AnimationNodeTimeScale { type Target = crate :: generated :: AnimationNode ; # [inline] fn deref (& self) -> & crate :: generated :: AnimationNode { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AnimationNodeTimeScale { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: AnimationNode { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: AnimationNode > for AnimationNodeTimeScale { } unsafe impl SubClass < crate :: generated :: Resource > for AnimationNodeTimeScale { } unsafe impl SubClass < crate :: generated :: Reference > for AnimationNodeTimeScale { } unsafe impl SubClass < crate :: generated :: Object > for AnimationNodeTimeScale { } impl Instanciable for AnimationNodeTimeScale { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { AnimationNodeTimeScale :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AnimationNodeTimeScaleMethodTable { pub class_constructor : sys :: godot_class_constructor , } impl AnimationNodeTimeScaleMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AnimationNodeTimeScaleMethodTable = AnimationNodeTimeScaleMethodTable { class_constructor : None , } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { AnimationNodeTimeScaleMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AnimationNodeTimeScale\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 [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:195:3736 [INFO] [stdout] | [INFO] [stdout] 195 | ...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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 195 | # ! [doc = "This module contains types related to the API class [`AnimationNodeTimeSeek`][super::AnimationNodeTimeSeek]."] pub (crate) mod private { # [doc = "`core class AnimationNodeTimeSeek` inherits `AnimationNode` (reference-counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_animationnodetimeseek.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\nAnimationNodeTimeSeek inherits methods from:\n - [AnimationNode](struct.AnimationNode.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 `Ownership` in these types tracks whether\nownership 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 AnimationNodeTimeSeek { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AnimationNodeTimeSeek ; impl AnimationNodeTimeSeek { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AnimationNodeTimeSeekMethodTable :: 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 AnimationNodeTimeSeek { } unsafe impl GodotObject for AnimationNodeTimeSeek { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AnimationNodeTimeSeek" } } impl std :: ops :: Deref for AnimationNodeTimeSeek { type Target = crate :: generated :: AnimationNode ; # [inline] fn deref (& self) -> & crate :: generated :: AnimationNode { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AnimationNodeTimeSeek { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: AnimationNode { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: AnimationNode > for AnimationNodeTimeSeek { } unsafe impl SubClass < crate :: generated :: Resource > for AnimationNodeTimeSeek { } unsafe impl SubClass < crate :: generated :: Reference > for AnimationNodeTimeSeek { } unsafe impl SubClass < crate :: generated :: Object > for AnimationNodeTimeSeek { } impl Instanciable for AnimationNodeTimeSeek { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { AnimationNodeTimeSeek :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AnimationNodeTimeSeekMethodTable { pub class_constructor : sys :: godot_class_constructor , } impl AnimationNodeTimeSeekMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AnimationNodeTimeSeekMethodTable = AnimationNodeTimeSeekMethodTable { class_constructor : None , } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { AnimationNodeTimeSeekMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AnimationNodeTimeSeek\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 [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:201:8015 [INFO] [stdout] | [INFO] [stdout] 201 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 201 | # ! [doc = "This module contains types related to the API class [`AnimationNodeTransition`][super::AnimationNodeTransition]."] pub (crate) mod private { # [doc = "`core class AnimationNodeTransition` inherits `AnimationNode` (reference-counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_animationnodetransition.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\nAnimationNodeTransition inherits methods from:\n - [AnimationNode](struct.AnimationNode.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 `Ownership` in these types tracks whether\nownership 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 AnimationNodeTransition { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AnimationNodeTransition ; impl AnimationNodeTransition { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AnimationNodeTransitionMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "Cross-fading time (in seconds) between each animation connected to the inputs."] # [doc = ""] # [inline] pub fn cross_fade_time (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeTransitionMethodTable :: get (get_api ()) . get_cross_fade_time ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "The number of available input ports for this node."] # [doc = ""] # [inline] pub fn enabled_inputs (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeTransitionMethodTable :: get (get_api ()) . get_enabled_inputs ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = ""] # [doc = ""] # [inline] pub fn input_caption (& self , input : i64) -> GodotString { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeTransitionMethodTable :: get (get_api ()) . get_input_caption ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , input as _) ; < GodotString > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = ""] # [doc = ""] # [inline] pub fn is_input_set_as_auto_advance (& self , input : i64) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeTransitionMethodTable :: get (get_api ()) . is_input_set_as_auto_advance ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , input as _) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "Cross-fading time (in seconds) between each animation connected to the inputs."] # [doc = ""] # [inline] pub fn set_cross_fade_time (& self , time : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeTransitionMethodTable :: get (get_api ()) . set_cross_fade_time ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , time as _) ; } } # [doc = "The number of available input ports for this node."] # [doc = ""] # [inline] pub fn set_enabled_inputs (& self , amount : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeTransitionMethodTable :: get (get_api ()) . set_enabled_inputs ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , amount as _) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn set_input_as_auto_advance (& self , input : i64 , enable : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeTransitionMethodTable :: get (get_api ()) . set_input_as_auto_advance ; let ret = crate :: icalls :: icallvar__i64_bool (method_bind , self . this . sys () . as_ptr () , input as _ , enable as _) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn set_input_caption (& self , input : i64 , caption : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationNodeTransitionMethodTable :: get (get_api ()) . set_input_caption ; let ret = crate :: icalls :: icallvar__i64_str (method_bind , self . this . sys () . as_ptr () , input as _ , caption . into ()) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for AnimationNodeTransition { } unsafe impl GodotObject for AnimationNodeTransition { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AnimationNodeTransition" } } impl std :: ops :: Deref for AnimationNodeTransition { type Target = crate :: generated :: AnimationNode ; # [inline] fn deref (& self) -> & crate :: generated :: AnimationNode { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AnimationNodeTransition { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: AnimationNode { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: AnimationNode > for AnimationNodeTransition { } unsafe impl SubClass < crate :: generated :: Resource > for AnimationNodeTransition { } unsafe impl SubClass < crate :: generated :: Reference > for AnimationNodeTransition { } unsafe impl SubClass < crate :: generated :: Object > for AnimationNodeTransition { } impl Instanciable for AnimationNodeTransition { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { AnimationNodeTransition :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AnimationNodeTransitionMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_cross_fade_time : * mut sys :: godot_method_bind , pub get_enabled_inputs : * mut sys :: godot_method_bind , pub get_input_caption : * mut sys :: godot_method_bind , pub is_input_set_as_auto_advance : * mut sys :: godot_method_bind , pub set_cross_fade_time : * mut sys :: godot_method_bind , pub set_enabled_inputs : * mut sys :: godot_method_bind , pub set_input_as_auto_advance : * mut sys :: godot_method_bind , pub set_input_caption : * mut sys :: godot_method_bind } impl AnimationNodeTransitionMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AnimationNodeTransitionMethodTable = AnimationNodeTransitionMethodTable { class_constructor : None , get_cross_fade_time : 0 as * mut sys :: godot_method_bind , get_enabled_inputs : 0 as * mut sys :: godot_method_bind , get_input_caption : 0 as * mut sys :: godot_method_bind , is_input_set_as_auto_advance : 0 as * mut sys :: godot_method_bind , set_cross_fade_time : 0 as * mut sys :: godot_method_bind , set_enabled_inputs : 0 as * mut sys :: godot_method_bind , set_input_as_auto_advance : 0 as * mut sys :: godot_method_bind , set_input_caption : 0 as * mut sys :: godot_method_bind } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { AnimationNodeTransitionMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AnimationNodeTransition\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_cross_fade_time = (gd_api . godot_method_bind_get_method) (class_name , "get_cross_fade_time\0" . as_ptr () as * const c_char) ; table . get_enabled_inputs = (gd_api . godot_method_bind_get_method) (class_name , "get_enabled_inputs\0" . as_ptr () as * const c_char) ; table . get_input_caption = (gd_api . godot_method_bind_get_method) (class_name , "get_input_caption\0" . as_ptr () as * const c_char) ; table . is_input_set_as_auto_advance = (gd_api . godot_method_bind_get_method) (class_name , "is_input_set_as_auto_advance\0" . as_ptr () as * const c_char) ; table . set_cross_fade_time = (gd_api . godot_method_bind_get_method) (class_name , "set_cross_fade_time\0" . as_ptr () as * const c_char) ; table . set_enabled_inputs = (gd_api . godot_method_bind_get_method) (class_name , "set_enabled_inputs\0" . as_ptr () as * const c_char) ; table . set_input_as_auto_advance = (gd_api . godot_method_bind_get_method) (class_name , "set_input_as_auto_advance\0" . as_ptr () as * const c_char) ; table . set_input_caption = (gd_api . godot_method_bind_get_method) (class_name , "set_input_caption\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:207:35443 [INFO] [stdout] | [INFO] [stdout] 207 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 207 | # ! [doc = "This module contains types related to the API class [`AnimationPlayer`][super::AnimationPlayer]."] pub (crate) mod private { # [doc = "`core class AnimationPlayer` inherits `Node` (manually managed).\n\nThis class has related types in the [`animation_player`][super::animation_player] module."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_animationplayer.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`AnimationPlayer` 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\nAnimationPlayer inherits methods from:\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 `Ownership` in these types tracks whether\nownership 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 AnimationPlayer { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AnimationPlayer ; # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct AnimationMethodCallMode (pub i64) ; impl AnimationMethodCallMode { pub const DEFERRED : AnimationMethodCallMode = AnimationMethodCallMode (0i64) ; pub const IMMEDIATE : AnimationMethodCallMode = AnimationMethodCallMode (1i64) ; } impl From < i64 > for AnimationMethodCallMode { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < AnimationMethodCallMode > for i64 { # [inline] fn from (v : AnimationMethodCallMode) -> Self { v . 0 } } impl FromVariant for AnimationMethodCallMode { # [inline] fn from_variant (v : & Variant) -> Result < Self , FromVariantError > { i64 :: from_variant (v) . map (Self :: from) } } # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct AnimationProcessMode (pub i64) ; impl AnimationProcessMode { pub const PHYSICS : AnimationProcessMode = AnimationProcessMode (0i64) ; pub const IDLE : AnimationProcessMode = AnimationProcessMode (1i64) ; pub const MANUAL : AnimationProcessMode = AnimationProcessMode (2i64) ; } impl From < i64 > for AnimationProcessMode { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < AnimationProcessMode > for i64 { # [inline] fn from (v : AnimationProcessMode) -> Self { v . 0 } } impl FromVariant for AnimationProcessMode { # [inline] fn from_variant (v : & Variant) -> Result < Self , FromVariantError > { i64 :: from_variant (v) . map (Self :: from) } } # [doc = "Constants"] # [allow (non_upper_case_globals)] impl AnimationPlayer { pub const ANIMATION_METHOD_CALL_DEFERRED : i64 = 0i64 ; pub const ANIMATION_PROCESS_PHYSICS : i64 = 0i64 ; pub const ANIMATION_METHOD_CALL_IMMEDIATE : i64 = 1i64 ; pub const ANIMATION_PROCESS_IDLE : i64 = 1i64 ; pub const ANIMATION_PROCESS_MANUAL : i64 = 2i64 ; } impl AnimationPlayer { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AnimationPlayerMethodTable :: 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 `animation` to the player accessible with the key `name`."] # [doc = ""] # [inline] pub fn add_animation (& self , name : impl Into < GodotString > , animation : impl AsArg < crate :: generated :: Animation >) -> GodotResult { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationPlayerMethodTable :: get (get_api ()) . add_animation ; let ret = crate :: icalls :: icallvar__str_obj (method_bind , self . this . sys () . as_ptr () , name . into () , animation . as_arg_ptr ()) ; GodotError :: result_from_sys (sys :: godot_error :: from_variant (& ret) . expect ("Unexpected variant type")) } } # [doc = "Shifts position in the animation timeline and immediately updates the animation. `delta` is the time in seconds to shift. Events between the current frame and `delta` are handled."] # [doc = ""] # [inline] pub fn advance (& self , delta : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationPlayerMethodTable :: get (get_api ()) . advance ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , delta as _) ; } } # [doc = "Returns the name of the next animation in the queue."] # [doc = ""] # [inline] pub fn animation_get_next (& self , anim_from : impl Into < GodotString >) -> GodotString { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationPlayerMethodTable :: get (get_api ()) . animation_get_next ; let ret = crate :: icalls :: icallvar__str (method_bind , self . this . sys () . as_ptr () , anim_from . into ()) ; < GodotString > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Triggers the `anim_to` animation when the `anim_from` animation completes."] # [doc = ""] # [inline] pub fn animation_set_next (& self , anim_from : impl Into < GodotString > , anim_to : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationPlayerMethodTable :: get (get_api ()) . animation_set_next ; let ret = crate :: icalls :: icallvar__str_str (method_bind , self . this . sys () . as_ptr () , anim_from . into () , anim_to . into ()) ; } } # [doc = "[`AnimationPlayer`][AnimationPlayer] caches animated nodes. It may not notice if a node disappears; [`clear_caches`][Self::clear_caches] forces it to update the cache again."] # [doc = ""] # [inline] pub fn clear_caches (& self) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationPlayerMethodTable :: get (get_api ()) . clear_caches ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; } } # [doc = "Clears all queued, unplayed animations."] # [doc = ""] # [inline] pub fn clear_queue (& self) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationPlayerMethodTable :: get (get_api ()) . clear_queue ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; } } # [doc = "Returns the name of `animation` or an empty string if not found."] # [doc = ""] # [inline] pub fn find_animation (& self , animation : impl AsArg < crate :: generated :: Animation >) -> GodotString { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationPlayerMethodTable :: get (get_api ()) . find_animation ; let ret = crate :: icalls :: icallvar__obj (method_bind , self . this . sys () . as_ptr () , animation . as_arg_ptr ()) ; < GodotString > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns the [`Animation`][Animation] with the key `name`. If the animation does not exist, `null` is returned and an error is logged."] # [doc = ""] # [inline] pub fn get_animation (& self , name : impl Into < GodotString >) -> Option < Ref < crate :: generated :: Animation , ownership :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationPlayerMethodTable :: get (get_api ()) . get_animation ; let ret = crate :: icalls :: icallvar__str (method_bind , self . this . sys () . as_ptr () , name . into ()) ; < Option < Ref < crate :: generated :: Animation , ownership :: Shared > > > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns the list of stored animation names."] # [doc = ""] # [inline] pub fn get_animation_list (& self) -> PoolArray < GodotString > { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationPlayerMethodTable :: get (get_api ()) . get_animation_list ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < PoolArray < GodotString > > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "The process notification in which to update animations."] # [doc = ""] # [inline] pub fn animation_process_mode (& self) -> crate :: generated :: animation_player :: AnimationProcessMode { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationPlayerMethodTable :: get (get_api ()) . get_animation_process_mode ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < crate :: generated :: animation_player :: AnimationProcessMode > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "If playing, the current animation; otherwise, the animation last played. When set, would change the animation, but would not play it unless currently playing. See also [`current_animation`][Self::current_animation]."] # [doc = ""] # [inline] pub fn assigned_animation (& self) -> GodotString { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationPlayerMethodTable :: get (get_api ()) . get_assigned_animation ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < GodotString > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "The name of the animation to play when the scene loads."] # [doc = ""] # [inline] pub fn autoplay (& self) -> GodotString { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationPlayerMethodTable :: get (get_api ()) . get_autoplay ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < GodotString > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Gets the blend time (in seconds) between two animations, referenced by their names."] # [doc = ""] # [inline] pub fn get_blend_time (& self , anim_from : impl Into < GodotString > , anim_to : impl Into < GodotString >) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationPlayerMethodTable :: get (get_api ()) . get_blend_time ; let ret = crate :: icalls :: icallvar__str_str (method_bind , self . this . sys () . as_ptr () , anim_from . into () , anim_to . into ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "The name of the currently playing animation. If no animation is playing, the property's value is an empty string. Changing this value does not restart the animation. See [`play`][Self::play] for more information on playing animations.\n**Note:** While this property appears in the inspector, it's not meant to be edited, and it's not saved in the scene. This property is mainly used to get the currently playing animation, and internally for animation playback tracks. For more information, see [`Animation`][Animation]."] # [doc = ""] # [inline] pub fn current_animation (& self) -> GodotString { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationPlayerMethodTable :: get (get_api ()) . get_current_animation ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < GodotString > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "The length (in seconds) of the currently being played animation."] # [doc = ""] # [inline] pub fn current_animation_length (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationPlayerMethodTable :: get (get_api ()) . get_current_animation_length ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "The position (in seconds) of the currently playing animation."] # [doc = ""] # [inline] pub fn current_animation_position (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationPlayerMethodTable :: get (get_api ()) . get_current_animation_position ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "The default time in which to blend animations. Ranges from 0 to 4096 with 0.01 precision."] # [doc = ""] # [inline] pub fn default_blend_time (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationPlayerMethodTable :: get (get_api ()) . get_default_blend_time ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "The call mode to use for Call Method tracks."] # [doc = ""] # [inline] pub fn method_call_mode (& self) -> crate :: generated :: animation_player :: AnimationMethodCallMode { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationPlayerMethodTable :: get (get_api ()) . get_method_call_mode ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < crate :: generated :: animation_player :: AnimationMethodCallMode > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Gets the actual playing speed of current animation or 0 if not playing. This speed is the [`playback_speed`][Self::playback_speed] property multiplied by `custom_speed` argument specified when calling the [`play`][Self::play] method."] # [doc = ""] # [inline] pub fn get_playing_speed (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationPlayerMethodTable :: get (get_api ()) . get_playing_speed ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Returns a list of the animation names that are currently queued to play."] # [doc = ""] # [inline] pub fn get_queue (& self) -> PoolArray < GodotString > { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationPlayerMethodTable :: get (get_api ()) . get_queue ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < PoolArray < GodotString > > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "The node from which node path references will travel."] # [doc = ""] # [inline] pub fn root (& self) -> NodePath { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationPlayerMethodTable :: get (get_api ()) . get_root ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < NodePath > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "The speed scaling ratio. For instance, if this value is 1, then the animation plays at normal speed. If it's 0.5, then it plays at half speed. If it's 2, then it plays at double speed."] # [doc = ""] # [inline] pub fn speed_scale (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationPlayerMethodTable :: get (get_api ()) . get_speed_scale ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Returns `true` if the [`AnimationPlayer`][AnimationPlayer] stores an [`Animation`][Animation] with key `name`."] # [doc = ""] # [inline] pub fn has_animation (& self , name : impl Into < GodotString >) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationPlayerMethodTable :: get (get_api ()) . has_animation ; let ret = crate :: icalls :: icallvar__str (method_bind , self . this . sys () . as_ptr () , name . into ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "If `true`, updates animations in response to process-related notifications."] # [doc = ""] # [inline] pub fn is_active (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationPlayerMethodTable :: get (get_api ()) . is_active ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "Returns `true` if playing an animation."] # [doc = ""] # [inline] pub fn is_playing (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationPlayerMethodTable :: get (get_api ()) . is_playing ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "This is used by the editor. If set to `true`, the scene will be saved with the effects of the reset animation applied (as if it had been seeked to time 0), then reverted after saving.\nIn other words, the saved scene file will contain the \"default pose\", as defined by the reset animation, if any, with the editor keeping the values that the nodes had before saving."] # [doc = ""] # [inline] pub fn is_reset_on_save_enabled (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationPlayerMethodTable :: get (get_api ()) . is_reset_on_save_enabled ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "Plays the animation with key `name`. Custom blend times and speed can be set. If `custom_speed` is negative and `from_end` is `true`, the animation will play backwards (which is equivalent to calling [`play_backwards`][Self::play_backwards]).\nThe [`AnimationPlayer`][AnimationPlayer] keeps track of its current or last played animation with [`assigned_animation`][Self::assigned_animation]. If this method is called with that same animation `name`, or with no `name` parameter, the assigned animation will resume playing if it was paused, or restart if it was stopped (see [`stop`][Self::stop] for both pause and stop). If the animation was already playing, it will keep playing.\n**Note:** The animation will be updated the next time the [`AnimationPlayer`][AnimationPlayer] is processed. If other variables are updated at the same time this is called, they may be updated too early. To perform the update immediately, call `advance(0)`.\n# Default Arguments\n* `name` - `\"\"`\n* `custom_blend` - `-1`\n* `custom_speed` - `1.0`\n* `from_end` - `false`"] # [doc = ""] # [inline] pub fn play (& self , name : impl Into < GodotString > , custom_blend : f64 , custom_speed : f64 , from_end : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationPlayerMethodTable :: get (get_api ()) . play ; let ret = crate :: icalls :: icallvar__str_f64_f64_bool (method_bind , self . this . sys () . as_ptr () , name . into () , custom_blend as _ , custom_speed as _ , from_end as _) ; } } # [doc = "Plays the animation with key `name` in reverse.\nThis method is a shorthand for [`play`][Self::play] with `custom_speed = -1.0` and `from_end = true`, so see its description for more information.\n# Default Arguments\n* `name` - `\"\"`\n* `custom_blend` - `-1`"] # [doc = ""] # [inline] pub fn play_backwards (& self , name : impl Into < GodotString > , custom_blend : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationPlayerMethodTable :: get (get_api ()) . play_backwards ; let ret = crate :: icalls :: icallvar__str_f64 (method_bind , self . this . sys () . as_ptr () , name . into () , custom_blend as _) ; } } # [doc = "Queues an animation for playback once the current one is done.\n**Note:** If a looped animation is currently playing, the queued animation will never play unless the looped animation is stopped somehow."] # [doc = ""] # [inline] pub fn queue (& self , name : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationPlayerMethodTable :: get (get_api ()) . queue ; let ret = crate :: icalls :: icallvar__str (method_bind , self . this . sys () . as_ptr () , name . into ()) ; } } # [doc = "Removes the animation with key `name`."] # [doc = ""] # [inline] pub fn remove_animation (& self , name : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationPlayerMethodTable :: get (get_api ()) . remove_animation ; let ret = crate :: icalls :: icallvar__str (method_bind , self . this . sys () . as_ptr () , name . into ()) ; } } # [doc = "Renames an existing animation with key `name` to `newname`."] # [doc = ""] # [inline] pub fn rename_animation (& self , name : impl Into < GodotString > , newname : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationPlayerMethodTable :: get (get_api ()) . rename_animation ; let ret = crate :: icalls :: icallvar__str_str (method_bind , self . this . sys () . as_ptr () , name . into () , newname . into ()) ; } } # [doc = "Seeks the animation to the `seconds` point in time (in seconds). If `update` is `true`, the animation updates too, otherwise it updates at process time. Events between the current frame and `seconds` are skipped.\n**Note:** Seeking to the end of the animation doesn't emit `animation_finished`. If you want to skip animation and emit the signal, use [`advance`][Self::advance].\n# Default Arguments\n* `update` - `false`"] # [doc = ""] # [inline] pub fn seek (& self , seconds : f64 , update : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationPlayerMethodTable :: get (get_api ()) . seek ; let ret = crate :: icalls :: icallvar__f64_bool (method_bind , self . this . sys () . as_ptr () , seconds as _ , update as _) ; } } # [doc = "If `true`, updates animations in response to process-related notifications."] # [doc = ""] # [inline] pub fn set_active (& self , active : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationPlayerMethodTable :: get (get_api ()) . set_active ; let ret = crate :: icalls :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , active as _) ; } } # [doc = "The process notification in which to update animations."] # [doc = ""] # [inline] pub fn set_animation_process_mode (& self , mode : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationPlayerMethodTable :: get (get_api ()) . set_animation_process_mode ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , mode as _) ; } } # [doc = "If playing, the current animation; otherwise, the animation last played. When set, would change the animation, but would not play it unless currently playing. See also [`current_animation`][Self::current_animation]."] # [doc = ""] # [inline] pub fn set_assigned_animation (& self , anim : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationPlayerMethodTable :: get (get_api ()) . set_assigned_animation ; let ret = crate :: icalls :: icallvar__str (method_bind , self . this . sys () . as_ptr () , anim . into ()) ; } } # [doc = "The name of the animation to play when the scene loads."] # [doc = ""] # [inline] pub fn set_autoplay (& self , name : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationPlayerMethodTable :: get (get_api ()) . set_autoplay ; let ret = crate :: icalls :: icallvar__str (method_bind , self . this . sys () . as_ptr () , name . into ()) ; } } # [doc = "Specifies a blend time (in seconds) between two animations, referenced by their names."] # [doc = ""] # [inline] pub fn set_blend_time (& self , anim_from : impl Into < GodotString > , anim_to : impl Into < GodotString > , sec : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationPlayerMethodTable :: get (get_api ()) . set_blend_time ; let ret = crate :: icalls :: icallvar__str_str_f64 (method_bind , self . this . sys () . as_ptr () , anim_from . into () , anim_to . into () , sec as _) ; } } # [doc = "The name of the currently playing animation. If no animation is playing, the property's value is an empty string. Changing this value does not restart the animation. See [`play`][Self::play] for more information on playing animations.\n**Note:** While this property appears in the inspector, it's not meant to be edited, and it's not saved in the scene. This property is mainly used to get the currently playing animation, and internally for animation playback tracks. For more information, see [`Animation`][Animation]."] # [doc = ""] # [inline] pub fn set_current_animation (& self , anim : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationPlayerMethodTable :: get (get_api ()) . set_current_animation ; let ret = crate :: icalls :: icallvar__str (method_bind , self . this . sys () . as_ptr () , anim . into ()) ; } } # [doc = "The default time in which to blend animations. Ranges from 0 to 4096 with 0.01 precision."] # [doc = ""] # [inline] pub fn set_default_blend_time (& self , sec : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationPlayerMethodTable :: get (get_api ()) . set_default_blend_time ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , sec as _) ; } } # [doc = "The call mode to use for Call Method tracks."] # [doc = ""] # [inline] pub fn set_method_call_mode (& self , mode : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationPlayerMethodTable :: get (get_api ()) . set_method_call_mode ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , mode as _) ; } } # [doc = "This is used by the editor. If set to `true`, the scene will be saved with the effects of the reset animation applied (as if it had been seeked to time 0), then reverted after saving.\nIn other words, the saved scene file will contain the \"default pose\", as defined by the reset animation, if any, with the editor keeping the values that the nodes had before saving."] # [doc = ""] # [inline] pub fn set_reset_on_save_enabled (& self , enabled : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationPlayerMethodTable :: get (get_api ()) . set_reset_on_save_enabled ; let ret = crate :: icalls :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , enabled as _) ; } } # [doc = "The node from which node path references will travel."] # [doc = ""] # [inline] pub fn set_root (& self , path : impl Into < NodePath >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationPlayerMethodTable :: get (get_api ()) . set_root ; let ret = crate :: icalls :: icallvar__nodepath (method_bind , self . this . sys () . as_ptr () , path . into ()) ; } } # [doc = "The speed scaling ratio. For instance, if this value is 1, then the animation plays at normal speed. If it's 0.5, then it plays at half speed. If it's 2, then it plays at double speed."] # [doc = ""] # [inline] pub fn set_speed_scale (& self , speed : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationPlayerMethodTable :: get (get_api ()) . set_speed_scale ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , speed as _) ; } } # [doc = "Stops or pauses the currently playing animation. If `reset` is `true`, the animation position is reset to `0` and the playback speed is reset to `1.0`.\nIf `reset` is `false`, the [`current_animation_position`][Self::current_animation_position] will be kept and calling [`play`][Self::play] or [`play_backwards`][Self::play_backwards] without arguments or with the same animation name as [`assigned_animation`][Self::assigned_animation] will resume the animation.\n# Default Arguments\n* `reset` - `true`"] # [doc = ""] # [inline] pub fn stop (& self , reset : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationPlayerMethodTable :: get (get_api ()) . stop ; let ret = crate :: icalls :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , reset as _) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for AnimationPlayer { } unsafe impl GodotObject for AnimationPlayer { type Memory = memory :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "AnimationPlayer" } } impl QueueFree for AnimationPlayer { # [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 :: icallvar_ (method_bind , obj) ; } } impl std :: ops :: Deref for AnimationPlayer { type Target = crate :: generated :: Node ; # [inline] fn deref (& self) -> & crate :: generated :: Node { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AnimationPlayer { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: Node { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: Node > for AnimationPlayer { } unsafe impl SubClass < crate :: generated :: Object > for AnimationPlayer { } impl Instanciable for AnimationPlayer { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { AnimationPlayer :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AnimationPlayerMethodTable { pub class_constructor : sys :: godot_class_constructor , pub add_animation : * mut sys :: godot_method_bind , pub advance : * mut sys :: godot_method_bind , pub animation_get_next : * mut sys :: godot_method_bind , pub animation_set_next : * mut sys :: godot_method_bind , pub clear_caches : * mut sys :: godot_method_bind , pub clear_queue : * mut sys :: godot_method_bind , pub find_animation : * mut sys :: godot_method_bind , pub get_animation : * mut sys :: godot_method_bind , pub get_animation_list : * mut sys :: godot_method_bind , pub get_animation_process_mode : * mut sys :: godot_method_bind , pub get_assigned_animation : * mut sys :: godot_method_bind , pub get_autoplay : * mut sys :: godot_method_bind , pub get_blend_time : * mut sys :: godot_method_bind , pub get_current_animation : * mut sys :: godot_method_bind , pub get_current_animation_length : * mut sys :: godot_method_bind , pub get_current_animation_position : * mut sys :: godot_method_bind , pub get_default_blend_time : * mut sys :: godot_method_bind , pub get_method_call_mode : * mut sys :: godot_method_bind , pub get_playing_speed : * mut sys :: godot_method_bind , pub get_queue : * mut sys :: godot_method_bind , pub get_root : * mut sys :: godot_method_bind , pub get_speed_scale : * mut sys :: godot_method_bind , pub has_animation : * mut sys :: godot_method_bind , pub is_active : * mut sys :: godot_method_bind , pub is_playing : * mut sys :: godot_method_bind , pub is_reset_on_save_enabled : * mut sys :: godot_method_bind , pub play : * mut sys :: godot_method_bind , pub play_backwards : * mut sys :: godot_method_bind , pub queue : * mut sys :: godot_method_bind , pub remove_animation : * mut sys :: godot_method_bind , pub rename_animation : * mut sys :: godot_method_bind , pub seek : * mut sys :: godot_method_bind , pub set_active : * mut sys :: godot_method_bind , pub set_animation_process_mode : * mut sys :: godot_method_bind , pub set_assigned_animation : * mut sys :: godot_method_bind , pub set_autoplay : * mut sys :: godot_method_bind , pub set_blend_time : * mut sys :: godot_method_bind , pub set_current_animation : * mut sys :: godot_method_bind , pub set_default_blend_time : * mut sys :: godot_method_bind , pub set_method_call_mode : * mut sys :: godot_method_bind , pub set_reset_on_save_enabled : * mut sys :: godot_method_bind , pub set_root : * mut sys :: godot_method_bind , pub set_speed_scale : * mut sys :: godot_method_bind , pub stop : * mut sys :: godot_method_bind } impl AnimationPlayerMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AnimationPlayerMethodTable = AnimationPlayerMethodTable { class_constructor : None , add_animation : 0 as * mut sys :: godot_method_bind , advance : 0 as * mut sys :: godot_method_bind , animation_get_next : 0 as * mut sys :: godot_method_bind , animation_set_next : 0 as * mut sys :: godot_method_bind , clear_caches : 0 as * mut sys :: godot_method_bind , clear_queue : 0 as * mut sys :: godot_method_bind , find_animation : 0 as * mut sys :: godot_method_bind , get_animation : 0 as * mut sys :: godot_method_bind , get_animation_list : 0 as * mut sys :: godot_method_bind , get_animation_process_mode : 0 as * mut sys :: godot_method_bind , get_assigned_animation : 0 as * mut sys :: godot_method_bind , get_autoplay : 0 as * mut sys :: godot_method_bind , get_blend_time : 0 as * mut sys :: godot_method_bind , get_current_animation : 0 as * mut sys :: godot_method_bind , get_current_animation_length : 0 as * mut sys :: godot_method_bind , get_current_animation_position : 0 as * mut sys :: godot_method_bind , get_default_blend_time : 0 as * mut sys :: godot_method_bind , get_method_call_mode : 0 as * mut sys :: godot_method_bind , get_playing_speed : 0 as * mut sys :: godot_method_bind , get_queue : 0 as * mut sys :: godot_method_bind , get_root : 0 as * mut sys :: godot_method_bind , get_speed_scale : 0 as * mut sys :: godot_method_bind , has_animation : 0 as * mut sys :: godot_method_bind , is_active : 0 as * mut sys :: godot_method_bind , is_playing : 0 as * mut sys :: godot_method_bind , is_reset_on_save_enabled : 0 as * mut sys :: godot_method_bind , play : 0 as * mut sys :: godot_method_bind , play_backwards : 0 as * mut sys :: godot_method_bind , queue : 0 as * mut sys :: godot_method_bind , remove_animation : 0 as * mut sys :: godot_method_bind , rename_animation : 0 as * mut sys :: godot_method_bind , seek : 0 as * mut sys :: godot_method_bind , set_active : 0 as * mut sys :: godot_method_bind , set_animation_process_mode : 0 as * mut sys :: godot_method_bind , set_assigned_animation : 0 as * mut sys :: godot_method_bind , set_autoplay : 0 as * mut sys :: godot_method_bind , set_blend_time : 0 as * mut sys :: godot_method_bind , set_current_animation : 0 as * mut sys :: godot_method_bind , set_default_blend_time : 0 as * mut sys :: godot_method_bind , set_method_call_mode : 0 as * mut sys :: godot_method_bind , set_reset_on_save_enabled : 0 as * mut sys :: godot_method_bind , set_root : 0 as * mut sys :: godot_method_bind , set_speed_scale : 0 as * mut sys :: godot_method_bind , stop : 0 as * mut sys :: godot_method_bind } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { AnimationPlayerMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AnimationPlayer\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 . advance = (gd_api . godot_method_bind_get_method) (class_name , "advance\0" . as_ptr () as * const c_char) ; table . animation_get_next = (gd_api . godot_method_bind_get_method) (class_name , "animation_get_next\0" . as_ptr () as * const c_char) ; table . animation_set_next = (gd_api . godot_method_bind_get_method) (class_name , "animation_set_next\0" . as_ptr () as * const c_char) ; table . clear_caches = (gd_api . godot_method_bind_get_method) (class_name , "clear_caches\0" . as_ptr () as * const c_char) ; table . clear_queue = (gd_api . godot_method_bind_get_method) (class_name , "clear_queue\0" . as_ptr () as * const c_char) ; table . find_animation = (gd_api . godot_method_bind_get_method) (class_name , "find_animation\0" . as_ptr () as * const c_char) ; table . get_animation = (gd_api . godot_method_bind_get_method) (class_name , "get_animation\0" . as_ptr () as * const c_char) ; table . get_animation_list = (gd_api . godot_method_bind_get_method) (class_name , "get_animation_list\0" . as_ptr () as * const c_char) ; table . get_animation_process_mode = (gd_api . godot_method_bind_get_method) (class_name , "get_animation_process_mode\0" . as_ptr () as * const c_char) ; table . get_assigned_animation = (gd_api . godot_method_bind_get_method) (class_name , "get_assigned_animation\0" . as_ptr () as * const c_char) ; table . get_autoplay = (gd_api . godot_method_bind_get_method) (class_name , "get_autoplay\0" . as_ptr () as * const c_char) ; table . get_blend_time = (gd_api . godot_method_bind_get_method) (class_name , "get_blend_time\0" . as_ptr () as * const c_char) ; table . get_current_animation = (gd_api . godot_method_bind_get_method) (class_name , "get_current_animation\0" . as_ptr () as * const c_char) ; table . get_current_animation_length = (gd_api . godot_method_bind_get_method) (class_name , "get_current_animation_length\0" . as_ptr () as * const c_char) ; table . get_current_animation_position = (gd_api . godot_method_bind_get_method) (class_name , "get_current_animation_position\0" . as_ptr () as * const c_char) ; table . get_default_blend_time = (gd_api . godot_method_bind_get_method) (class_name , "get_default_blend_time\0" . as_ptr () as * const c_char) ; table . get_method_call_mode = (gd_api . godot_method_bind_get_method) (class_name , "get_method_call_mode\0" . as_ptr () as * const c_char) ; table . get_playing_speed = (gd_api . godot_method_bind_get_method) (class_name , "get_playing_speed\0" . as_ptr () as * const c_char) ; table . get_queue = (gd_api . godot_method_bind_get_method) (class_name , "get_queue\0" . as_ptr () as * const c_char) ; table . get_root = (gd_api . godot_method_bind_get_method) (class_name , "get_root\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 . has_animation = (gd_api . godot_method_bind_get_method) (class_name , "has_animation\0" . as_ptr () as * const c_char) ; table . is_active = (gd_api . godot_method_bind_get_method) (class_name , "is_active\0" . as_ptr () as * const c_char) ; table . is_playing = (gd_api . godot_method_bind_get_method) (class_name , "is_playing\0" . as_ptr () as * const c_char) ; table . is_reset_on_save_enabled = (gd_api . godot_method_bind_get_method) (class_name , "is_reset_on_save_enabled\0" . as_ptr () as * const c_char) ; table . play = (gd_api . godot_method_bind_get_method) (class_name , "play\0" . as_ptr () as * const c_char) ; table . play_backwards = (gd_api . godot_method_bind_get_method) (class_name , "play_backwards\0" . as_ptr () as * const c_char) ; table . queue = (gd_api . godot_method_bind_get_method) (class_name , "queue\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 . rename_animation = (gd_api . godot_method_bind_get_method) (class_name , "rename_animation\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_active = (gd_api . godot_method_bind_get_method) (class_name , "set_active\0" . as_ptr () as * const c_char) ; table . set_animation_process_mode = (gd_api . godot_method_bind_get_method) (class_name , "set_animation_process_mode\0" . as_ptr () as * const c_char) ; table . set_assigned_animation = (gd_api . godot_method_bind_get_method) (class_name , "set_assigned_animation\0" . as_ptr () as * const c_char) ; table . set_autoplay = (gd_api . godot_method_bind_get_method) (class_name , "set_autoplay\0" . as_ptr () as * const c_char) ; table . set_blend_time = (gd_api . godot_method_bind_get_method) (class_name , "set_blend_time\0" . as_ptr () as * const c_char) ; table . set_current_animation = (gd_api . godot_method_bind_get_method) (class_name , "set_current_animation\0" . as_ptr () as * const c_char) ; table . set_default_blend_time = (gd_api . godot_method_bind_get_method) (class_name , "set_default_blend_time\0" . as_ptr () as * const c_char) ; table . set_method_call_mode = (gd_api . godot_method_bind_get_method) (class_name , "set_method_call_mode\0" . as_ptr () as * const c_char) ; table . set_reset_on_save_enabled = (gd_api . godot_method_bind_get_method) (class_name , "set_reset_on_save_enabled\0" . as_ptr () as * const c_char) ; table . set_root = (gd_api . godot_method_bind_get_method) (class_name , "set_root\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 . stop = (gd_api . godot_method_bind_get_method) (class_name , "stop\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:213:3640 [INFO] [stdout] | [INFO] [stdout] 213 | ...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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 213 | # ! [doc = "This module contains types related to the API class [`AnimationRootNode`][super::AnimationRootNode]."] pub (crate) mod private { # [doc = "`core class AnimationRootNode` inherits `AnimationNode` (reference-counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_animationrootnode.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\nAnimationRootNode inherits methods from:\n - [AnimationNode](struct.AnimationNode.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 `Ownership` in these types tracks whether\nownership 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 AnimationRootNode { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AnimationRootNode ; impl AnimationRootNode { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AnimationRootNodeMethodTable :: 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 AnimationRootNode { } unsafe impl GodotObject for AnimationRootNode { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AnimationRootNode" } } impl std :: ops :: Deref for AnimationRootNode { type Target = crate :: generated :: AnimationNode ; # [inline] fn deref (& self) -> & crate :: generated :: AnimationNode { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AnimationRootNode { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: AnimationNode { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: AnimationNode > for AnimationRootNode { } unsafe impl SubClass < crate :: generated :: Resource > for AnimationRootNode { } unsafe impl SubClass < crate :: generated :: Reference > for AnimationRootNode { } unsafe impl SubClass < crate :: generated :: Object > for AnimationRootNode { } impl Instanciable for AnimationRootNode { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { AnimationRootNode :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AnimationRootNodeMethodTable { pub class_constructor : sys :: godot_class_constructor , } impl AnimationRootNodeMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AnimationRootNodeMethodTable = AnimationRootNodeMethodTable { class_constructor : None , } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { AnimationRootNodeMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AnimationRootNode\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 [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:225:14351 [INFO] [stdout] | [INFO] [stdout] 225 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 225 | # ! [doc = "This module contains types related to the API class [`AnimationTree`][super::AnimationTree]."] pub (crate) mod private { # [doc = "`core class AnimationTree` inherits `Node` (manually managed).\n\nThis class has related types in the [`animation_tree`][super::animation_tree] module."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_animationtree.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`AnimationTree` 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\nAnimationTree inherits methods from:\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 `Ownership` in these types tracks whether\nownership 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 AnimationTree { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AnimationTree ; # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct AnimationProcessMode (pub i64) ; impl AnimationProcessMode { pub const PHYSICS : AnimationProcessMode = AnimationProcessMode (0i64) ; pub const IDLE : AnimationProcessMode = AnimationProcessMode (1i64) ; pub const MANUAL : AnimationProcessMode = AnimationProcessMode (2i64) ; } impl From < i64 > for AnimationProcessMode { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < AnimationProcessMode > for i64 { # [inline] fn from (v : AnimationProcessMode) -> Self { v . 0 } } impl FromVariant for AnimationProcessMode { # [inline] fn from_variant (v : & Variant) -> Result < Self , FromVariantError > { i64 :: from_variant (v) . map (Self :: from) } } # [doc = "Constants"] # [allow (non_upper_case_globals)] impl AnimationTree { pub const ANIMATION_PROCESS_PHYSICS : i64 = 0i64 ; pub const ANIMATION_PROCESS_IDLE : i64 = 1i64 ; pub const ANIMATION_PROCESS_MANUAL : i64 = 2i64 ; } impl AnimationTree { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AnimationTreeMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "Manually advance the animations by the specified time (in seconds)."] # [doc = ""] # [inline] pub fn advance (& self , delta : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreeMethodTable :: get (get_api ()) . advance ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , delta as _) ; } } # [doc = "The path to the [`AnimationPlayer`][AnimationPlayer] used for animating."] # [doc = ""] # [inline] pub fn animation_player (& self) -> NodePath { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreeMethodTable :: get (get_api ()) . get_animation_player ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < NodePath > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "The process mode of this [`AnimationTree`][AnimationTree]. See [`AnimationProcessMode`][AnimationProcessMode] for available modes."] # [doc = ""] # [inline] pub fn process_mode (& self) -> crate :: generated :: animation_tree :: AnimationProcessMode { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreeMethodTable :: get (get_api ()) . get_process_mode ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < crate :: generated :: animation_tree :: AnimationProcessMode > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "The path to the Animation track used for root motion. Paths must be valid scene-tree paths to a node, and must be specified starting from the parent node of the node that will reproduce the animation. To specify a track that controls properties or bones, append its name after the path, separated by `\":\"`. For example, `\"character/skeleton:ankle\"` or `\"character/mesh:transform/local\"`.\nIf the track has type [`Animation.TYPE_TRANSFORM`][Animation::TYPE_TRANSFORM], the transformation will be cancelled visually, and the animation will appear to stay in place. See also [`get_root_motion_transform`][Self::get_root_motion_transform] and [`RootMotionView`][RootMotionView]."] # [doc = ""] # [inline] pub fn root_motion_track (& self) -> NodePath { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreeMethodTable :: get (get_api ()) . get_root_motion_track ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < NodePath > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Retrieve the motion of the [`root_motion_track`][Self::root_motion_track] as a [`Transform`][Transform] that can be used elsewhere. If [`root_motion_track`][Self::root_motion_track] is not a path to a track of type [`Animation.TYPE_TRANSFORM`][Animation::TYPE_TRANSFORM], returns an identity transformation. See also [`root_motion_track`][Self::root_motion_track] and [`RootMotionView`][RootMotionView]."] # [doc = ""] # [inline] pub fn get_root_motion_transform (& self) -> Transform { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreeMethodTable :: get (get_api ()) . get_root_motion_transform ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < Transform > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "The root animation node of this [`AnimationTree`][AnimationTree]. See [`AnimationNode`][AnimationNode]."] # [doc = ""] # [inline] pub fn tree_root (& self) -> Option < Ref < crate :: generated :: AnimationNode , ownership :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreeMethodTable :: get (get_api ()) . get_tree_root ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < Option < Ref < crate :: generated :: AnimationNode , ownership :: Shared > > > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "If `true`, the [`AnimationTree`][AnimationTree] will be processing."] # [doc = ""] # [inline] pub fn is_active (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreeMethodTable :: get (get_api ()) . is_active ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = ""] # [doc = ""] # [inline] pub fn rename_parameter (& self , old_name : impl Into < GodotString > , new_name : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreeMethodTable :: get (get_api ()) . rename_parameter ; let ret = crate :: icalls :: icallvar__str_str (method_bind , self . this . sys () . as_ptr () , old_name . into () , new_name . into ()) ; } } # [doc = "If `true`, the [`AnimationTree`][AnimationTree] will be processing."] # [doc = ""] # [inline] pub fn set_active (& self , active : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreeMethodTable :: get (get_api ()) . set_active ; let ret = crate :: icalls :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , active as _) ; } } # [doc = "The path to the [`AnimationPlayer`][AnimationPlayer] used for animating."] # [doc = ""] # [inline] pub fn set_animation_player (& self , root : impl Into < NodePath >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreeMethodTable :: get (get_api ()) . set_animation_player ; let ret = crate :: icalls :: icallvar__nodepath (method_bind , self . this . sys () . as_ptr () , root . into ()) ; } } # [doc = "The process mode of this [`AnimationTree`][AnimationTree]. See [`AnimationProcessMode`][AnimationProcessMode] for available modes."] # [doc = ""] # [inline] pub fn set_process_mode (& self , mode : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreeMethodTable :: get (get_api ()) . set_process_mode ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , mode as _) ; } } # [doc = "The path to the Animation track used for root motion. Paths must be valid scene-tree paths to a node, and must be specified starting from the parent node of the node that will reproduce the animation. To specify a track that controls properties or bones, append its name after the path, separated by `\":\"`. For example, `\"character/skeleton:ankle\"` or `\"character/mesh:transform/local\"`.\nIf the track has type [`Animation.TYPE_TRANSFORM`][Animation::TYPE_TRANSFORM], the transformation will be cancelled visually, and the animation will appear to stay in place. See also [`get_root_motion_transform`][Self::get_root_motion_transform] and [`RootMotionView`][RootMotionView]."] # [doc = ""] # [inline] pub fn set_root_motion_track (& self , path : impl Into < NodePath >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreeMethodTable :: get (get_api ()) . set_root_motion_track ; let ret = crate :: icalls :: icallvar__nodepath (method_bind , self . this . sys () . as_ptr () , path . into ()) ; } } # [doc = "The root animation node of this [`AnimationTree`][AnimationTree]. See [`AnimationNode`][AnimationNode]."] # [doc = ""] # [inline] pub fn set_tree_root (& self , root : impl AsArg < crate :: generated :: AnimationNode >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreeMethodTable :: get (get_api ()) . set_tree_root ; let ret = crate :: icalls :: icallvar__obj (method_bind , self . this . sys () . as_ptr () , root . as_arg_ptr ()) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for AnimationTree { } unsafe impl GodotObject for AnimationTree { type Memory = memory :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "AnimationTree" } } impl QueueFree for AnimationTree { # [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 :: icallvar_ (method_bind , obj) ; } } impl std :: ops :: Deref for AnimationTree { type Target = crate :: generated :: Node ; # [inline] fn deref (& self) -> & crate :: generated :: Node { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AnimationTree { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: Node { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: Node > for AnimationTree { } unsafe impl SubClass < crate :: generated :: Object > for AnimationTree { } impl Instanciable for AnimationTree { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { AnimationTree :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AnimationTreeMethodTable { pub class_constructor : sys :: godot_class_constructor , pub advance : * mut sys :: godot_method_bind , pub get_animation_player : * mut sys :: godot_method_bind , pub get_process_mode : * mut sys :: godot_method_bind , pub get_root_motion_track : * mut sys :: godot_method_bind , pub get_root_motion_transform : * mut sys :: godot_method_bind , pub get_tree_root : * mut sys :: godot_method_bind , pub is_active : * mut sys :: godot_method_bind , pub rename_parameter : * mut sys :: godot_method_bind , pub set_active : * mut sys :: godot_method_bind , pub set_animation_player : * mut sys :: godot_method_bind , pub set_process_mode : * mut sys :: godot_method_bind , pub set_root_motion_track : * mut sys :: godot_method_bind , pub set_tree_root : * mut sys :: godot_method_bind } impl AnimationTreeMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AnimationTreeMethodTable = AnimationTreeMethodTable { class_constructor : None , advance : 0 as * mut sys :: godot_method_bind , get_animation_player : 0 as * mut sys :: godot_method_bind , get_process_mode : 0 as * mut sys :: godot_method_bind , get_root_motion_track : 0 as * mut sys :: godot_method_bind , get_root_motion_transform : 0 as * mut sys :: godot_method_bind , get_tree_root : 0 as * mut sys :: godot_method_bind , is_active : 0 as * mut sys :: godot_method_bind , rename_parameter : 0 as * mut sys :: godot_method_bind , set_active : 0 as * mut sys :: godot_method_bind , set_animation_player : 0 as * mut sys :: godot_method_bind , set_process_mode : 0 as * mut sys :: godot_method_bind , set_root_motion_track : 0 as * mut sys :: godot_method_bind , set_tree_root : 0 as * mut sys :: godot_method_bind } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { AnimationTreeMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AnimationTree\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . advance = (gd_api . godot_method_bind_get_method) (class_name , "advance\0" . as_ptr () as * const c_char) ; table . get_animation_player = (gd_api . godot_method_bind_get_method) (class_name , "get_animation_player\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_root_motion_track = (gd_api . godot_method_bind_get_method) (class_name , "get_root_motion_track\0" . as_ptr () as * const c_char) ; table . get_root_motion_transform = (gd_api . godot_method_bind_get_method) (class_name , "get_root_motion_transform\0" . as_ptr () as * const c_char) ; table . get_tree_root = (gd_api . godot_method_bind_get_method) (class_name , "get_tree_root\0" . as_ptr () as * const c_char) ; table . is_active = (gd_api . godot_method_bind_get_method) (class_name , "is_active\0" . as_ptr () as * const c_char) ; table . rename_parameter = (gd_api . godot_method_bind_get_method) (class_name , "rename_parameter\0" . as_ptr () as * const c_char) ; table . set_active = (gd_api . godot_method_bind_get_method) (class_name , "set_active\0" . as_ptr () as * const c_char) ; table . set_animation_player = (gd_api . godot_method_bind_get_method) (class_name , "set_animation_player\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_root_motion_track = (gd_api . godot_method_bind_get_method) (class_name , "set_root_motion_track\0" . as_ptr () as * const c_char) ; table . set_tree_root = (gd_api . godot_method_bind_get_method) (class_name , "set_tree_root\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:231:49123 [INFO] [stdout] | [INFO] [stdout] 231 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 231 | # ! [doc = "This module contains types related to the API class [`AnimationTreePlayer`][super::AnimationTreePlayer]."] pub (crate) mod private { # [doc = "`core class AnimationTreePlayer` inherits `Node` (manually managed).\n\nThis class has related types in the [`animation_tree_player`][super::animation_tree_player] module."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_animationtreeplayer.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`AnimationTreePlayer` 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\nAnimationTreePlayer inherits methods from:\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 `Ownership` in these types tracks whether\nownership 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 AnimationTreePlayer { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AnimationTreePlayer ; # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct AnimationProcessMode (pub i64) ; impl AnimationProcessMode { pub const PHYSICS : AnimationProcessMode = AnimationProcessMode (0i64) ; pub const IDLE : AnimationProcessMode = AnimationProcessMode (1i64) ; } impl From < i64 > for AnimationProcessMode { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < AnimationProcessMode > for i64 { # [inline] fn from (v : AnimationProcessMode) -> Self { v . 0 } } impl FromVariant for AnimationProcessMode { # [inline] fn from_variant (v : & Variant) -> Result < Self , FromVariantError > { i64 :: from_variant (v) . map (Self :: from) } } # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct NodeType (pub i64) ; impl NodeType { pub const OUTPUT : NodeType = NodeType (0i64) ; pub const ANIMATION : NodeType = NodeType (1i64) ; pub const ONESHOT : NodeType = NodeType (2i64) ; pub const MIX : NodeType = NodeType (3i64) ; pub const BLEND2 : NodeType = NodeType (4i64) ; pub const BLEND3 : NodeType = NodeType (5i64) ; pub const BLEND4 : NodeType = NodeType (6i64) ; pub const TIMESCALE : NodeType = NodeType (7i64) ; pub const TIMESEEK : NodeType = NodeType (8i64) ; pub const TRANSITION : NodeType = NodeType (9i64) ; } impl From < i64 > for NodeType { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < NodeType > for i64 { # [inline] fn from (v : NodeType) -> Self { v . 0 } } impl FromVariant for NodeType { # [inline] fn from_variant (v : & Variant) -> Result < Self , FromVariantError > { i64 :: from_variant (v) . map (Self :: from) } } # [doc = "Constants"] # [allow (non_upper_case_globals)] impl AnimationTreePlayer { pub const ANIMATION_PROCESS_PHYSICS : i64 = 0i64 ; pub const NODE_OUTPUT : i64 = 0i64 ; pub const ANIMATION_PROCESS_IDLE : i64 = 1i64 ; pub const NODE_ANIMATION : i64 = 1i64 ; pub const NODE_ONESHOT : i64 = 2i64 ; pub const NODE_MIX : i64 = 3i64 ; pub const NODE_BLEND2 : i64 = 4i64 ; pub const NODE_BLEND3 : i64 = 5i64 ; pub const NODE_BLEND4 : i64 = 6i64 ; pub const NODE_TIMESCALE : i64 = 7i64 ; pub const NODE_TIMESEEK : i64 = 8i64 ; pub const NODE_TRANSITION : i64 = 9i64 ; } impl AnimationTreePlayer { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AnimationTreePlayerMethodTable :: 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 `type` node to the graph with name `id`."] # [doc = ""] # [inline] pub fn add_node (& self , type_ : i64 , id : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreePlayerMethodTable :: get (get_api ()) . add_node ; let ret = crate :: icalls :: icallvar__i64_str (method_bind , self . this . sys () . as_ptr () , type_ as _ , id . into ()) ; } } # [doc = "Shifts position in the animation timeline. `delta` is the time in seconds to shift. Events between the current frame and `delta` are handled."] # [doc = ""] # [inline] pub fn advance (& self , delta : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreePlayerMethodTable :: get (get_api ()) . advance ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , delta as _) ; } } # [doc = "Returns the [`AnimationPlayer`][AnimationPlayer]'s [`Animation`][Animation] bound to the [`AnimationTreePlayer`][AnimationTreePlayer]'s animation node with name `id`."] # [doc = ""] # [inline] pub fn animation_node_get_animation (& self , id : impl Into < GodotString >) -> Option < Ref < crate :: generated :: Animation , ownership :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreePlayerMethodTable :: get (get_api ()) . animation_node_get_animation ; let ret = crate :: icalls :: icallvar__str (method_bind , self . this . sys () . as_ptr () , id . into ()) ; < Option < Ref < crate :: generated :: Animation , ownership :: Shared > > > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns the name of the [`master_player`][Self::master_player]'s [`Animation`][Animation] bound to this animation node."] # [doc = ""] # [inline] pub fn animation_node_get_master_animation (& self , id : impl Into < GodotString >) -> GodotString { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreePlayerMethodTable :: get (get_api ()) . animation_node_get_master_animation ; let ret = crate :: icalls :: icallvar__str (method_bind , self . this . sys () . as_ptr () , id . into ()) ; < GodotString > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns the absolute playback timestamp of the animation node with name `id`."] # [doc = ""] # [inline] pub fn animation_node_get_position (& self , id : impl Into < GodotString >) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreePlayerMethodTable :: get (get_api ()) . animation_node_get_position ; let ret = crate :: icalls :: icallvar__str (method_bind , self . this . sys () . as_ptr () , id . into ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Binds a new [`Animation`][Animation] from the [`master_player`][Self::master_player] to the [`AnimationTreePlayer`][AnimationTreePlayer]'s animation node with name `id`."] # [doc = ""] # [inline] pub fn animation_node_set_animation (& self , id : impl Into < GodotString > , animation : impl AsArg < crate :: generated :: Animation >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreePlayerMethodTable :: get (get_api ()) . animation_node_set_animation ; let ret = crate :: icalls :: icallvar__str_obj (method_bind , self . this . sys () . as_ptr () , id . into () , animation . as_arg_ptr ()) ; } } # [doc = "If `enable` is `true`, the animation node with ID `id` turns off the track modifying the property at `path`. The modified node's children continue to animate."] # [doc = ""] # [inline] pub fn animation_node_set_filter_path (& self , id : impl Into < GodotString > , path : impl Into < NodePath > , enable : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreePlayerMethodTable :: get (get_api ()) . animation_node_set_filter_path ; let ret = crate :: icalls :: icallvar__str_nodepath_bool (method_bind , self . this . sys () . as_ptr () , id . into () , path . into () , enable as _) ; } } # [doc = "Binds the [`Animation`][Animation] named `source` from [`master_player`][Self::master_player] to the animation node `id`. Recalculates caches."] # [doc = ""] # [inline] pub fn animation_node_set_master_animation (& self , id : impl Into < GodotString > , source : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreePlayerMethodTable :: get (get_api ()) . animation_node_set_master_animation ; let ret = crate :: icalls :: icallvar__str_str (method_bind , self . this . sys () . as_ptr () , id . into () , source . into ()) ; } } # [doc = "Returns whether node `id` and `dst_id` are connected at the specified slot."] # [doc = ""] # [inline] pub fn are_nodes_connected (& self , id : impl Into < GodotString > , dst_id : impl Into < GodotString > , dst_input_idx : i64) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreePlayerMethodTable :: get (get_api ()) . are_nodes_connected ; let ret = crate :: icalls :: icallvar__str_str_i64 (method_bind , self . this . sys () . as_ptr () , id . into () , dst_id . into () , dst_input_idx as _) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "Returns the blend amount of a Blend2 node given its name."] # [doc = ""] # [inline] pub fn blend2_node_get_amount (& self , id : impl Into < GodotString >) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreePlayerMethodTable :: get (get_api ()) . blend2_node_get_amount ; let ret = crate :: icalls :: icallvar__str (method_bind , self . this . sys () . as_ptr () , id . into ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Sets the blend amount of a Blend2 node given its name and value.\nA Blend2 node blends two animations (A and B) with the amount between 0 and 1.\nAt 0, output is input A. Towards 1, the influence of A gets lessened, the influence of B gets raised. At 1, output is input B."] # [doc = ""] # [inline] pub fn blend2_node_set_amount (& self , id : impl Into < GodotString > , blend : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreePlayerMethodTable :: get (get_api ()) . blend2_node_set_amount ; let ret = crate :: icalls :: icallvar__str_f64 (method_bind , self . this . sys () . as_ptr () , id . into () , blend as _) ; } } # [doc = "If `enable` is `true`, the Blend2 node with name `id` turns off the track modifying the property at `path`. The modified node's children continue to animate."] # [doc = ""] # [inline] pub fn blend2_node_set_filter_path (& self , id : impl Into < GodotString > , path : impl Into < NodePath > , enable : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreePlayerMethodTable :: get (get_api ()) . blend2_node_set_filter_path ; let ret = crate :: icalls :: icallvar__str_nodepath_bool (method_bind , self . this . sys () . as_ptr () , id . into () , path . into () , enable as _) ; } } # [doc = "Returns the blend amount of a Blend3 node given its name."] # [doc = ""] # [inline] pub fn blend3_node_get_amount (& self , id : impl Into < GodotString >) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreePlayerMethodTable :: get (get_api ()) . blend3_node_get_amount ; let ret = crate :: icalls :: icallvar__str (method_bind , self . this . sys () . as_ptr () , id . into ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Sets the blend amount of a Blend3 node given its name and value.\nA Blend3 Node blends three animations (A, B-, B+) with the amount between -1 and 1.\nAt -1, output is input B-. From -1 to 0, the influence of B- gets lessened, the influence of A gets raised and the influence of B+ is 0. At 0, output is input A. From 0 to 1, the influence of A gets lessened, the influence of B+ gets raised and the influence of B+ is 0. At 1, output is input B+."] # [doc = ""] # [inline] pub fn blend3_node_set_amount (& self , id : impl Into < GodotString > , blend : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreePlayerMethodTable :: get (get_api ()) . blend3_node_set_amount ; let ret = crate :: icalls :: icallvar__str_f64 (method_bind , self . this . sys () . as_ptr () , id . into () , blend as _) ; } } # [doc = "Returns the blend amount of a Blend4 node given its name."] # [doc = ""] # [inline] pub fn blend4_node_get_amount (& self , id : impl Into < GodotString >) -> Vector2 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreePlayerMethodTable :: get (get_api ()) . blend4_node_get_amount ; let ret = crate :: icalls :: icallvar__str (method_bind , self . this . sys () . as_ptr () , id . into ()) ; < Vector2 > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Sets the blend amount of a Blend4 node given its name and value.\nA Blend4 Node blends two pairs of animations.\nThe two pairs are blended like Blend2 and then added together."] # [doc = ""] # [inline] pub fn blend4_node_set_amount (& self , id : impl Into < GodotString > , blend : Vector2) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreePlayerMethodTable :: get (get_api ()) . blend4_node_set_amount ; let ret = crate :: icalls :: icallvar__str_vec2 (method_bind , self . this . sys () . as_ptr () , id . into () , blend) ; } } # [doc = "Connects node `id` to `dst_id` at the specified input slot."] # [doc = ""] # [inline] pub fn connect_nodes (& self , id : impl Into < GodotString > , dst_id : impl Into < GodotString > , dst_input_idx : i64) -> GodotResult { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreePlayerMethodTable :: get (get_api ()) . connect_nodes ; let ret = crate :: icalls :: icallvar__str_str_i64 (method_bind , self . this . sys () . as_ptr () , id . into () , dst_id . into () , dst_input_idx as _) ; GodotError :: result_from_sys (sys :: godot_error :: from_variant (& ret) . expect ("Unexpected variant type")) } } # [doc = "Disconnects nodes connected to `id` at the specified input slot."] # [doc = ""] # [inline] pub fn disconnect_nodes (& self , id : impl Into < GodotString > , dst_input_idx : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreePlayerMethodTable :: get (get_api ()) . disconnect_nodes ; let ret = crate :: icalls :: icallvar__str_i64 (method_bind , self . this . sys () . as_ptr () , id . into () , dst_input_idx as _) ; } } # [doc = "The thread in which to update animations."] # [doc = ""] # [inline] pub fn animation_process_mode (& self) -> crate :: generated :: animation_tree_player :: AnimationProcessMode { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreePlayerMethodTable :: get (get_api ()) . get_animation_process_mode ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < crate :: generated :: animation_tree_player :: AnimationProcessMode > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "The node from which to relatively access other nodes.\nIt accesses the bones, so it should point to the same node the [`AnimationPlayer`][AnimationPlayer] would point its Root Node at."] # [doc = ""] # [inline] pub fn base_path (& self) -> NodePath { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreePlayerMethodTable :: get (get_api ()) . get_base_path ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < NodePath > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "The path to the [`AnimationPlayer`][AnimationPlayer] from which this [`AnimationTreePlayer`][AnimationTreePlayer] binds animations to animation nodes.\nOnce set, [`Animation`][Animation] nodes can be added to the [`AnimationTreePlayer`][AnimationTreePlayer]."] # [doc = ""] # [inline] pub fn master_player (& self) -> NodePath { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreePlayerMethodTable :: get (get_api ()) . get_master_player ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < NodePath > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns a [`PoolStringArray`][PoolArray] containing the name of all nodes."] # [doc = ""] # [inline] pub fn get_node_list (& self) -> PoolArray < GodotString > { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreePlayerMethodTable :: get (get_api ()) . get_node_list ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < PoolArray < GodotString > > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "If `true`, the [`AnimationTreePlayer`][AnimationTreePlayer] is able to play animations."] # [doc = ""] # [inline] pub fn is_active (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreePlayerMethodTable :: get (get_api ()) . is_active ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "Returns the mix amount of a Mix node given its name."] # [doc = ""] # [inline] pub fn mix_node_get_amount (& self , id : impl Into < GodotString >) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreePlayerMethodTable :: get (get_api ()) . mix_node_get_amount ; let ret = crate :: icalls :: icallvar__str (method_bind , self . this . sys () . as_ptr () , id . into ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Sets the mix amount of a Mix node given its name and value.\nA Mix node adds input b to input a by the amount given by ratio."] # [doc = ""] # [inline] pub fn mix_node_set_amount (& self , id : impl Into < GodotString > , ratio : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreePlayerMethodTable :: get (get_api ()) . mix_node_set_amount ; let ret = crate :: icalls :: icallvar__str_f64 (method_bind , self . this . sys () . as_ptr () , id . into () , ratio as _) ; } } # [doc = "Check if a node exists (by name)."] # [doc = ""] # [inline] pub fn node_exists (& self , node : impl Into < GodotString >) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreePlayerMethodTable :: get (get_api ()) . node_exists ; let ret = crate :: icalls :: icallvar__str (method_bind , self . this . sys () . as_ptr () , node . into ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "Returns the input count for a given node. Different types of nodes have different amount of inputs."] # [doc = ""] # [inline] pub fn node_get_input_count (& self , id : impl Into < GodotString >) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreePlayerMethodTable :: get (get_api ()) . node_get_input_count ; let ret = crate :: icalls :: icallvar__str (method_bind , self . this . sys () . as_ptr () , id . into ()) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "Returns the input source for a given node input."] # [doc = ""] # [inline] pub fn node_get_input_source (& self , id : impl Into < GodotString > , idx : i64) -> GodotString { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreePlayerMethodTable :: get (get_api ()) . node_get_input_source ; let ret = crate :: icalls :: icallvar__str_i64 (method_bind , self . this . sys () . as_ptr () , id . into () , idx as _) ; < GodotString > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns position of a node in the graph given its name."] # [doc = ""] # [inline] pub fn node_get_position (& self , id : impl Into < GodotString >) -> Vector2 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreePlayerMethodTable :: get (get_api ()) . node_get_position ; let ret = crate :: icalls :: icallvar__str (method_bind , self . this . sys () . as_ptr () , id . into ()) ; < Vector2 > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Gets the node type, will return from [`NodeType`][NodeType] enum."] # [doc = ""] # [inline] pub fn node_get_type (& self , id : impl Into < GodotString >) -> crate :: generated :: animation_tree_player :: NodeType { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreePlayerMethodTable :: get (get_api ()) . node_get_type ; let ret = crate :: icalls :: icallvar__str (method_bind , self . this . sys () . as_ptr () , id . into ()) ; < crate :: generated :: animation_tree_player :: NodeType > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Renames a node in the graph."] # [doc = ""] # [inline] pub fn node_rename (& self , node : impl Into < GodotString > , new_name : impl Into < GodotString >) -> GodotResult { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreePlayerMethodTable :: get (get_api ()) . node_rename ; let ret = crate :: icalls :: icallvar__str_str (method_bind , self . this . sys () . as_ptr () , node . into () , new_name . into ()) ; GodotError :: result_from_sys (sys :: godot_error :: from_variant (& ret) . expect ("Unexpected variant type")) } } # [doc = "Sets the position of a node in the graph given its name and position."] # [doc = ""] # [inline] pub fn node_set_position (& self , id : impl Into < GodotString > , screen_position : Vector2) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreePlayerMethodTable :: get (get_api ()) . node_set_position ; let ret = crate :: icalls :: icallvar__str_vec2 (method_bind , self . this . sys () . as_ptr () , id . into () , screen_position) ; } } # [doc = "Returns the autostart delay of a OneShot node given its name."] # [doc = ""] # [inline] pub fn oneshot_node_get_autorestart_delay (& self , id : impl Into < GodotString >) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreePlayerMethodTable :: get (get_api ()) . oneshot_node_get_autorestart_delay ; let ret = crate :: icalls :: icallvar__str (method_bind , self . this . sys () . as_ptr () , id . into ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Returns the autostart random delay of a OneShot node given its name."] # [doc = ""] # [inline] pub fn oneshot_node_get_autorestart_random_delay (& self , id : impl Into < GodotString >) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreePlayerMethodTable :: get (get_api ()) . oneshot_node_get_autorestart_random_delay ; let ret = crate :: icalls :: icallvar__str (method_bind , self . this . sys () . as_ptr () , id . into ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Returns the fade in time of a OneShot node given its name."] # [doc = ""] # [inline] pub fn oneshot_node_get_fadein_time (& self , id : impl Into < GodotString >) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreePlayerMethodTable :: get (get_api ()) . oneshot_node_get_fadein_time ; let ret = crate :: icalls :: icallvar__str (method_bind , self . this . sys () . as_ptr () , id . into ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Returns the fade out time of a OneShot node given its name."] # [doc = ""] # [inline] pub fn oneshot_node_get_fadeout_time (& self , id : impl Into < GodotString >) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreePlayerMethodTable :: get (get_api ()) . oneshot_node_get_fadeout_time ; let ret = crate :: icalls :: icallvar__str (method_bind , self . this . sys () . as_ptr () , id . into ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Returns whether a OneShot node will auto restart given its name."] # [doc = ""] # [inline] pub fn oneshot_node_has_autorestart (& self , id : impl Into < GodotString >) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreePlayerMethodTable :: get (get_api ()) . oneshot_node_has_autorestart ; let ret = crate :: icalls :: icallvar__str (method_bind , self . this . sys () . as_ptr () , id . into ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "Returns whether a OneShot node is active given its name."] # [doc = ""] # [inline] pub fn oneshot_node_is_active (& self , id : impl Into < GodotString >) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreePlayerMethodTable :: get (get_api ()) . oneshot_node_is_active ; let ret = crate :: icalls :: icallvar__str (method_bind , self . this . sys () . as_ptr () , id . into ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "Sets the autorestart property of a OneShot node given its name and value."] # [doc = ""] # [inline] pub fn oneshot_node_set_autorestart (& self , id : impl Into < GodotString > , enable : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreePlayerMethodTable :: get (get_api ()) . oneshot_node_set_autorestart ; let ret = crate :: icalls :: icallvar__str_bool (method_bind , self . this . sys () . as_ptr () , id . into () , enable as _) ; } } # [doc = "Sets the autorestart delay of a OneShot node given its name and value in seconds."] # [doc = ""] # [inline] pub fn oneshot_node_set_autorestart_delay (& self , id : impl Into < GodotString > , delay_sec : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreePlayerMethodTable :: get (get_api ()) . oneshot_node_set_autorestart_delay ; let ret = crate :: icalls :: icallvar__str_f64 (method_bind , self . this . sys () . as_ptr () , id . into () , delay_sec as _) ; } } # [doc = "Sets the autorestart random delay of a OneShot node given its name and value in seconds."] # [doc = ""] # [inline] pub fn oneshot_node_set_autorestart_random_delay (& self , id : impl Into < GodotString > , rand_sec : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreePlayerMethodTable :: get (get_api ()) . oneshot_node_set_autorestart_random_delay ; let ret = crate :: icalls :: icallvar__str_f64 (method_bind , self . this . sys () . as_ptr () , id . into () , rand_sec as _) ; } } # [doc = "Sets the fade in time of a OneShot node given its name and value in seconds."] # [doc = ""] # [inline] pub fn oneshot_node_set_fadein_time (& self , id : impl Into < GodotString > , time_sec : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreePlayerMethodTable :: get (get_api ()) . oneshot_node_set_fadein_time ; let ret = crate :: icalls :: icallvar__str_f64 (method_bind , self . this . sys () . as_ptr () , id . into () , time_sec as _) ; } } # [doc = "Sets the fade out time of a OneShot node given its name and value in seconds."] # [doc = ""] # [inline] pub fn oneshot_node_set_fadeout_time (& self , id : impl Into < GodotString > , time_sec : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreePlayerMethodTable :: get (get_api ()) . oneshot_node_set_fadeout_time ; let ret = crate :: icalls :: icallvar__str_f64 (method_bind , self . this . sys () . as_ptr () , id . into () , time_sec as _) ; } } # [doc = "If `enable` is `true`, the OneShot node with ID `id` turns off the track modifying the property at `path`. The modified node's children continue to animate."] # [doc = ""] # [inline] pub fn oneshot_node_set_filter_path (& self , id : impl Into < GodotString > , path : impl Into < NodePath > , enable : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreePlayerMethodTable :: get (get_api ()) . oneshot_node_set_filter_path ; let ret = crate :: icalls :: icallvar__str_nodepath_bool (method_bind , self . this . sys () . as_ptr () , id . into () , path . into () , enable as _) ; } } # [doc = "Starts a OneShot node given its name."] # [doc = ""] # [inline] pub fn oneshot_node_start (& self , id : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreePlayerMethodTable :: get (get_api ()) . oneshot_node_start ; let ret = crate :: icalls :: icallvar__str (method_bind , self . this . sys () . as_ptr () , id . into ()) ; } } # [doc = "Stops the OneShot node with name `id`."] # [doc = ""] # [inline] pub fn oneshot_node_stop (& self , id : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreePlayerMethodTable :: get (get_api ()) . oneshot_node_stop ; let ret = crate :: icalls :: icallvar__str (method_bind , self . this . sys () . as_ptr () , id . into ()) ; } } # [doc = "Manually recalculates the cache of track information generated from animation nodes. Needed when external sources modify the animation nodes' state."] # [doc = ""] # [inline] pub fn recompute_caches (& self) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreePlayerMethodTable :: get (get_api ()) . recompute_caches ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; } } # [doc = "Removes the animation node with name `id`."] # [doc = ""] # [inline] pub fn remove_node (& self , id : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreePlayerMethodTable :: get (get_api ()) . remove_node ; let ret = crate :: icalls :: icallvar__str (method_bind , self . this . sys () . as_ptr () , id . into ()) ; } } # [doc = "Resets this [`AnimationTreePlayer`][AnimationTreePlayer]."] # [doc = ""] # [inline] pub fn reset (& self) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreePlayerMethodTable :: get (get_api ()) . reset ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; } } # [doc = "If `true`, the [`AnimationTreePlayer`][AnimationTreePlayer] is able to play animations."] # [doc = ""] # [inline] pub fn set_active (& self , enabled : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreePlayerMethodTable :: get (get_api ()) . set_active ; let ret = crate :: icalls :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , enabled as _) ; } } # [doc = "The thread in which to update animations."] # [doc = ""] # [inline] pub fn set_animation_process_mode (& self , mode : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreePlayerMethodTable :: get (get_api ()) . set_animation_process_mode ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , mode as _) ; } } # [doc = "The node from which to relatively access other nodes.\nIt accesses the bones, so it should point to the same node the [`AnimationPlayer`][AnimationPlayer] would point its Root Node at."] # [doc = ""] # [inline] pub fn set_base_path (& self , path : impl Into < NodePath >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreePlayerMethodTable :: get (get_api ()) . set_base_path ; let ret = crate :: icalls :: icallvar__nodepath (method_bind , self . this . sys () . as_ptr () , path . into ()) ; } } # [doc = "The path to the [`AnimationPlayer`][AnimationPlayer] from which this [`AnimationTreePlayer`][AnimationTreePlayer] binds animations to animation nodes.\nOnce set, [`Animation`][Animation] nodes can be added to the [`AnimationTreePlayer`][AnimationTreePlayer]."] # [doc = ""] # [inline] pub fn set_master_player (& self , nodepath : impl Into < NodePath >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreePlayerMethodTable :: get (get_api ()) . set_master_player ; let ret = crate :: icalls :: icallvar__nodepath (method_bind , self . this . sys () . as_ptr () , nodepath . into ()) ; } } # [doc = "Returns the time scale value of the TimeScale node with name `id`."] # [doc = ""] # [inline] pub fn timescale_node_get_scale (& self , id : impl Into < GodotString >) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreePlayerMethodTable :: get (get_api ()) . timescale_node_get_scale ; let ret = crate :: icalls :: icallvar__str (method_bind , self . this . sys () . as_ptr () , id . into ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Sets the time scale of the TimeScale node with name `id` to `scale`.\nThe TimeScale node is used to speed [`Animation`][Animation]s up if the scale is above 1 or slow them down if it is below 1.\nIf applied after a blend or mix, affects all input animations to that blend or mix."] # [doc = ""] # [inline] pub fn timescale_node_set_scale (& self , id : impl Into < GodotString > , scale : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreePlayerMethodTable :: get (get_api ()) . timescale_node_set_scale ; let ret = crate :: icalls :: icallvar__str_f64 (method_bind , self . this . sys () . as_ptr () , id . into () , scale as _) ; } } # [doc = "Sets the time seek value of the TimeSeek node with name `id` to `seconds`.\nThis functions as a seek in the [`Animation`][Animation] or the blend or mix of [`Animation`][Animation]s input in it."] # [doc = ""] # [inline] pub fn timeseek_node_seek (& self , id : impl Into < GodotString > , seconds : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreePlayerMethodTable :: get (get_api ()) . timeseek_node_seek ; let ret = crate :: icalls :: icallvar__str_f64 (method_bind , self . this . sys () . as_ptr () , id . into () , seconds as _) ; } } # [doc = "Deletes the input at `input_idx` for the transition node with name `id`."] # [doc = ""] # [inline] pub fn transition_node_delete_input (& self , id : impl Into < GodotString > , input_idx : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreePlayerMethodTable :: get (get_api ()) . transition_node_delete_input ; let ret = crate :: icalls :: icallvar__str_i64 (method_bind , self . this . sys () . as_ptr () , id . into () , input_idx as _) ; } } # [doc = "Returns the index of the currently evaluated input for the transition node with name `id`."] # [doc = ""] # [inline] pub fn transition_node_get_current (& self , id : impl Into < GodotString >) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreePlayerMethodTable :: get (get_api ()) . transition_node_get_current ; let ret = crate :: icalls :: icallvar__str (method_bind , self . this . sys () . as_ptr () , id . into ()) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "Returns the number of inputs for the transition node with name `id`. You can add inputs by right-clicking on the transition node."] # [doc = ""] # [inline] pub fn transition_node_get_input_count (& self , id : impl Into < GodotString >) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreePlayerMethodTable :: get (get_api ()) . transition_node_get_input_count ; let ret = crate :: icalls :: icallvar__str (method_bind , self . this . sys () . as_ptr () , id . into ()) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "Returns the cross fade time for the transition node with name `id`."] # [doc = ""] # [inline] pub fn transition_node_get_xfade_time (& self , id : impl Into < GodotString >) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreePlayerMethodTable :: get (get_api ()) . transition_node_get_xfade_time ; let ret = crate :: icalls :: icallvar__str (method_bind , self . this . sys () . as_ptr () , id . into ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Returns `true` if the input at `input_idx` on the transition node with name `id` is set to automatically advance to the next input upon completion."] # [doc = ""] # [inline] pub fn transition_node_has_input_auto_advance (& self , id : impl Into < GodotString > , input_idx : i64) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreePlayerMethodTable :: get (get_api ()) . transition_node_has_input_auto_advance ; let ret = crate :: icalls :: icallvar__str_i64 (method_bind , self . this . sys () . as_ptr () , id . into () , input_idx as _) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "The transition node with name `id` sets its current input at `input_idx`."] # [doc = ""] # [inline] pub fn transition_node_set_current (& self , id : impl Into < GodotString > , input_idx : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreePlayerMethodTable :: get (get_api ()) . transition_node_set_current ; let ret = crate :: icalls :: icallvar__str_i64 (method_bind , self . this . sys () . as_ptr () , id . into () , input_idx as _) ; } } # [doc = "The transition node with name `id` advances to its next input automatically when the input at `input_idx` completes."] # [doc = ""] # [inline] pub fn transition_node_set_input_auto_advance (& self , id : impl Into < GodotString > , input_idx : i64 , enable : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreePlayerMethodTable :: get (get_api ()) . transition_node_set_input_auto_advance ; let ret = crate :: icalls :: icallvar__str_i64_bool (method_bind , self . this . sys () . as_ptr () , id . into () , input_idx as _ , enable as _) ; } } # [doc = "Resizes the number of inputs available for the transition node with name `id`."] # [doc = ""] # [inline] pub fn transition_node_set_input_count (& self , id : impl Into < GodotString > , count : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreePlayerMethodTable :: get (get_api ()) . transition_node_set_input_count ; let ret = crate :: icalls :: icallvar__str_i64 (method_bind , self . this . sys () . as_ptr () , id . into () , count as _) ; } } # [doc = "The transition node with name `id` sets its cross fade time to `time_sec`."] # [doc = ""] # [inline] pub fn transition_node_set_xfade_time (& self , id : impl Into < GodotString > , time_sec : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AnimationTreePlayerMethodTable :: get (get_api ()) . transition_node_set_xfade_time ; let ret = crate :: icalls :: icallvar__str_f64 (method_bind , self . this . sys () . as_ptr () , id . into () , time_sec as _) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for AnimationTreePlayer { } unsafe impl GodotObject for AnimationTreePlayer { type Memory = memory :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "AnimationTreePlayer" } } impl QueueFree for AnimationTreePlayer { # [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 :: icallvar_ (method_bind , obj) ; } } impl std :: ops :: Deref for AnimationTreePlayer { type Target = crate :: generated :: Node ; # [inline] fn deref (& self) -> & crate :: generated :: Node { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AnimationTreePlayer { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: Node { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: Node > for AnimationTreePlayer { } unsafe impl SubClass < crate :: generated :: Object > for AnimationTreePlayer { } impl Instanciable for AnimationTreePlayer { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { AnimationTreePlayer :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AnimationTreePlayerMethodTable { pub class_constructor : sys :: godot_class_constructor , pub add_node : * mut sys :: godot_method_bind , pub advance : * mut sys :: godot_method_bind , pub animation_node_get_animation : * mut sys :: godot_method_bind , pub animation_node_get_master_animation : * mut sys :: godot_method_bind , pub animation_node_get_position : * mut sys :: godot_method_bind , pub animation_node_set_animation : * mut sys :: godot_method_bind , pub animation_node_set_filter_path : * mut sys :: godot_method_bind , pub animation_node_set_master_animation : * mut sys :: godot_method_bind , pub are_nodes_connected : * mut sys :: godot_method_bind , pub blend2_node_get_amount : * mut sys :: godot_method_bind , pub blend2_node_set_amount : * mut sys :: godot_method_bind , pub blend2_node_set_filter_path : * mut sys :: godot_method_bind , pub blend3_node_get_amount : * mut sys :: godot_method_bind , pub blend3_node_set_amount : * mut sys :: godot_method_bind , pub blend4_node_get_amount : * mut sys :: godot_method_bind , pub blend4_node_set_amount : * mut sys :: godot_method_bind , pub connect_nodes : * mut sys :: godot_method_bind , pub disconnect_nodes : * mut sys :: godot_method_bind , pub get_animation_process_mode : * mut sys :: godot_method_bind , pub get_base_path : * mut sys :: godot_method_bind , pub get_master_player : * mut sys :: godot_method_bind , pub get_node_list : * mut sys :: godot_method_bind , pub is_active : * mut sys :: godot_method_bind , pub mix_node_get_amount : * mut sys :: godot_method_bind , pub mix_node_set_amount : * mut sys :: godot_method_bind , pub node_exists : * mut sys :: godot_method_bind , pub node_get_input_count : * mut sys :: godot_method_bind , pub node_get_input_source : * mut sys :: godot_method_bind , pub node_get_position : * mut sys :: godot_method_bind , pub node_get_type : * mut sys :: godot_method_bind , pub node_rename : * mut sys :: godot_method_bind , pub node_set_position : * mut sys :: godot_method_bind , pub oneshot_node_get_autorestart_delay : * mut sys :: godot_method_bind , pub oneshot_node_get_autorestart_random_delay : * mut sys :: godot_method_bind , pub oneshot_node_get_fadein_time : * mut sys :: godot_method_bind , pub oneshot_node_get_fadeout_time : * mut sys :: godot_method_bind , pub oneshot_node_has_autorestart : * mut sys :: godot_method_bind , pub oneshot_node_is_active : * mut sys :: godot_method_bind , pub oneshot_node_set_autorestart : * mut sys :: godot_method_bind , pub oneshot_node_set_autorestart_delay : * mut sys :: godot_method_bind , pub oneshot_node_set_autorestart_random_delay : * mut sys :: godot_method_bind , pub oneshot_node_set_fadein_time : * mut sys :: godot_method_bind , pub oneshot_node_set_fadeout_time : * mut sys :: godot_method_bind , pub oneshot_node_set_filter_path : * mut sys :: godot_method_bind , pub oneshot_node_start : * mut sys :: godot_method_bind , pub oneshot_node_stop : * mut sys :: godot_method_bind , pub recompute_caches : * mut sys :: godot_method_bind , pub remove_node : * mut sys :: godot_method_bind , pub reset : * mut sys :: godot_method_bind , pub set_active : * mut sys :: godot_method_bind , pub set_animation_process_mode : * mut sys :: godot_method_bind , pub set_base_path : * mut sys :: godot_method_bind , pub set_master_player : * mut sys :: godot_method_bind , pub timescale_node_get_scale : * mut sys :: godot_method_bind , pub timescale_node_set_scale : * mut sys :: godot_method_bind , pub timeseek_node_seek : * mut sys :: godot_method_bind , pub transition_node_delete_input : * mut sys :: godot_method_bind , pub transition_node_get_current : * mut sys :: godot_method_bind , pub transition_node_get_input_count : * mut sys :: godot_method_bind , pub transition_node_get_xfade_time : * mut sys :: godot_method_bind , pub transition_node_has_input_auto_advance : * mut sys :: godot_method_bind , pub transition_node_set_current : * mut sys :: godot_method_bind , pub transition_node_set_input_auto_advance : * mut sys :: godot_method_bind , pub transition_node_set_input_count : * mut sys :: godot_method_bind , pub transition_node_set_xfade_time : * mut sys :: godot_method_bind } impl AnimationTreePlayerMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AnimationTreePlayerMethodTable = AnimationTreePlayerMethodTable { class_constructor : None , add_node : 0 as * mut sys :: godot_method_bind , advance : 0 as * mut sys :: godot_method_bind , animation_node_get_animation : 0 as * mut sys :: godot_method_bind , animation_node_get_master_animation : 0 as * mut sys :: godot_method_bind , animation_node_get_position : 0 as * mut sys :: godot_method_bind , animation_node_set_animation : 0 as * mut sys :: godot_method_bind , animation_node_set_filter_path : 0 as * mut sys :: godot_method_bind , animation_node_set_master_animation : 0 as * mut sys :: godot_method_bind , are_nodes_connected : 0 as * mut sys :: godot_method_bind , blend2_node_get_amount : 0 as * mut sys :: godot_method_bind , blend2_node_set_amount : 0 as * mut sys :: godot_method_bind , blend2_node_set_filter_path : 0 as * mut sys :: godot_method_bind , blend3_node_get_amount : 0 as * mut sys :: godot_method_bind , blend3_node_set_amount : 0 as * mut sys :: godot_method_bind , blend4_node_get_amount : 0 as * mut sys :: godot_method_bind , blend4_node_set_amount : 0 as * mut sys :: godot_method_bind , connect_nodes : 0 as * mut sys :: godot_method_bind , disconnect_nodes : 0 as * mut sys :: godot_method_bind , get_animation_process_mode : 0 as * mut sys :: godot_method_bind , get_base_path : 0 as * mut sys :: godot_method_bind , get_master_player : 0 as * mut sys :: godot_method_bind , get_node_list : 0 as * mut sys :: godot_method_bind , is_active : 0 as * mut sys :: godot_method_bind , mix_node_get_amount : 0 as * mut sys :: godot_method_bind , mix_node_set_amount : 0 as * mut sys :: godot_method_bind , node_exists : 0 as * mut sys :: godot_method_bind , node_get_input_count : 0 as * mut sys :: godot_method_bind , node_get_input_source : 0 as * mut sys :: godot_method_bind , node_get_position : 0 as * mut sys :: godot_method_bind , node_get_type : 0 as * mut sys :: godot_method_bind , node_rename : 0 as * mut sys :: godot_method_bind , node_set_position : 0 as * mut sys :: godot_method_bind , oneshot_node_get_autorestart_delay : 0 as * mut sys :: godot_method_bind , oneshot_node_get_autorestart_random_delay : 0 as * mut sys :: godot_method_bind , oneshot_node_get_fadein_time : 0 as * mut sys :: godot_method_bind , oneshot_node_get_fadeout_time : 0 as * mut sys :: godot_method_bind , oneshot_node_has_autorestart : 0 as * mut sys :: godot_method_bind , oneshot_node_is_active : 0 as * mut sys :: godot_method_bind , oneshot_node_set_autorestart : 0 as * mut sys :: godot_method_bind , oneshot_node_set_autorestart_delay : 0 as * mut sys :: godot_method_bind , oneshot_node_set_autorestart_random_delay : 0 as * mut sys :: godot_method_bind , oneshot_node_set_fadein_time : 0 as * mut sys :: godot_method_bind , oneshot_node_set_fadeout_time : 0 as * mut sys :: godot_method_bind , oneshot_node_set_filter_path : 0 as * mut sys :: godot_method_bind , oneshot_node_start : 0 as * mut sys :: godot_method_bind , oneshot_node_stop : 0 as * mut sys :: godot_method_bind , recompute_caches : 0 as * mut sys :: godot_method_bind , remove_node : 0 as * mut sys :: godot_method_bind , reset : 0 as * mut sys :: godot_method_bind , set_active : 0 as * mut sys :: godot_method_bind , set_animation_process_mode : 0 as * mut sys :: godot_method_bind , set_base_path : 0 as * mut sys :: godot_method_bind , set_master_player : 0 as * mut sys :: godot_method_bind , timescale_node_get_scale : 0 as * mut sys :: godot_method_bind , timescale_node_set_scale : 0 as * mut sys :: godot_method_bind , timeseek_node_seek : 0 as * mut sys :: godot_method_bind , transition_node_delete_input : 0 as * mut sys :: godot_method_bind , transition_node_get_current : 0 as * mut sys :: godot_method_bind , transition_node_get_input_count : 0 as * mut sys :: godot_method_bind , transition_node_get_xfade_time : 0 as * mut sys :: godot_method_bind , transition_node_has_input_auto_advance : 0 as * mut sys :: godot_method_bind , transition_node_set_current : 0 as * mut sys :: godot_method_bind , transition_node_set_input_auto_advance : 0 as * mut sys :: godot_method_bind , transition_node_set_input_count : 0 as * mut sys :: godot_method_bind , transition_node_set_xfade_time : 0 as * mut sys :: godot_method_bind } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { AnimationTreePlayerMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AnimationTreePlayer\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 . advance = (gd_api . godot_method_bind_get_method) (class_name , "advance\0" . as_ptr () as * const c_char) ; table . animation_node_get_animation = (gd_api . godot_method_bind_get_method) (class_name , "animation_node_get_animation\0" . as_ptr () as * const c_char) ; table . animation_node_get_master_animation = (gd_api . godot_method_bind_get_method) (class_name , "animation_node_get_master_animation\0" . as_ptr () as * const c_char) ; table . animation_node_get_position = (gd_api . godot_method_bind_get_method) (class_name , "animation_node_get_position\0" . as_ptr () as * const c_char) ; table . animation_node_set_animation = (gd_api . godot_method_bind_get_method) (class_name , "animation_node_set_animation\0" . as_ptr () as * const c_char) ; table . animation_node_set_filter_path = (gd_api . godot_method_bind_get_method) (class_name , "animation_node_set_filter_path\0" . as_ptr () as * const c_char) ; table . animation_node_set_master_animation = (gd_api . godot_method_bind_get_method) (class_name , "animation_node_set_master_animation\0" . as_ptr () as * const c_char) ; table . are_nodes_connected = (gd_api . godot_method_bind_get_method) (class_name , "are_nodes_connected\0" . as_ptr () as * const c_char) ; table . blend2_node_get_amount = (gd_api . godot_method_bind_get_method) (class_name , "blend2_node_get_amount\0" . as_ptr () as * const c_char) ; table . blend2_node_set_amount = (gd_api . godot_method_bind_get_method) (class_name , "blend2_node_set_amount\0" . as_ptr () as * const c_char) ; table . blend2_node_set_filter_path = (gd_api . godot_method_bind_get_method) (class_name , "blend2_node_set_filter_path\0" . as_ptr () as * const c_char) ; table . blend3_node_get_amount = (gd_api . godot_method_bind_get_method) (class_name , "blend3_node_get_amount\0" . as_ptr () as * const c_char) ; table . blend3_node_set_amount = (gd_api . godot_method_bind_get_method) (class_name , "blend3_node_set_amount\0" . as_ptr () as * const c_char) ; table . blend4_node_get_amount = (gd_api . godot_method_bind_get_method) (class_name , "blend4_node_get_amount\0" . as_ptr () as * const c_char) ; table . blend4_node_set_amount = (gd_api . godot_method_bind_get_method) (class_name , "blend4_node_set_amount\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 . disconnect_nodes = (gd_api . godot_method_bind_get_method) (class_name , "disconnect_nodes\0" . as_ptr () as * const c_char) ; table . get_animation_process_mode = (gd_api . godot_method_bind_get_method) (class_name , "get_animation_process_mode\0" . as_ptr () as * const c_char) ; table . get_base_path = (gd_api . godot_method_bind_get_method) (class_name , "get_base_path\0" . as_ptr () as * const c_char) ; table . get_master_player = (gd_api . godot_method_bind_get_method) (class_name , "get_master_player\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 . is_active = (gd_api . godot_method_bind_get_method) (class_name , "is_active\0" . as_ptr () as * const c_char) ; table . mix_node_get_amount = (gd_api . godot_method_bind_get_method) (class_name , "mix_node_get_amount\0" . as_ptr () as * const c_char) ; table . mix_node_set_amount = (gd_api . godot_method_bind_get_method) (class_name , "mix_node_set_amount\0" . as_ptr () as * const c_char) ; table . node_exists = (gd_api . godot_method_bind_get_method) (class_name , "node_exists\0" . as_ptr () as * const c_char) ; table . node_get_input_count = (gd_api . godot_method_bind_get_method) (class_name , "node_get_input_count\0" . as_ptr () as * const c_char) ; table . node_get_input_source = (gd_api . godot_method_bind_get_method) (class_name , "node_get_input_source\0" . as_ptr () as * const c_char) ; table . node_get_position = (gd_api . godot_method_bind_get_method) (class_name , "node_get_position\0" . as_ptr () as * const c_char) ; table . node_get_type = (gd_api . godot_method_bind_get_method) (class_name , "node_get_type\0" . as_ptr () as * const c_char) ; table . node_rename = (gd_api . godot_method_bind_get_method) (class_name , "node_rename\0" . as_ptr () as * const c_char) ; table . node_set_position = (gd_api . godot_method_bind_get_method) (class_name , "node_set_position\0" . as_ptr () as * const c_char) ; table . oneshot_node_get_autorestart_delay = (gd_api . godot_method_bind_get_method) (class_name , "oneshot_node_get_autorestart_delay\0" . as_ptr () as * const c_char) ; table . oneshot_node_get_autorestart_random_delay = (gd_api . godot_method_bind_get_method) (class_name , "oneshot_node_get_autorestart_random_delay\0" . as_ptr () as * const c_char) ; table . oneshot_node_get_fadein_time = (gd_api . godot_method_bind_get_method) (class_name , "oneshot_node_get_fadein_time\0" . as_ptr () as * const c_char) ; table . oneshot_node_get_fadeout_time = (gd_api . godot_method_bind_get_method) (class_name , "oneshot_node_get_fadeout_time\0" . as_ptr () as * const c_char) ; table . oneshot_node_has_autorestart = (gd_api . godot_method_bind_get_method) (class_name , "oneshot_node_has_autorestart\0" . as_ptr () as * const c_char) ; table . oneshot_node_is_active = (gd_api . godot_method_bind_get_method) (class_name , "oneshot_node_is_active\0" . as_ptr () as * const c_char) ; table . oneshot_node_set_autorestart = (gd_api . godot_method_bind_get_method) (class_name , "oneshot_node_set_autorestart\0" . as_ptr () as * const c_char) ; table . oneshot_node_set_autorestart_delay = (gd_api . godot_method_bind_get_method) (class_name , "oneshot_node_set_autorestart_delay\0" . as_ptr () as * const c_char) ; table . oneshot_node_set_autorestart_random_delay = (gd_api . godot_method_bind_get_method) (class_name , "oneshot_node_set_autorestart_random_delay\0" . as_ptr () as * const c_char) ; table . oneshot_node_set_fadein_time = (gd_api . godot_method_bind_get_method) (class_name , "oneshot_node_set_fadein_time\0" . as_ptr () as * const c_char) ; table . oneshot_node_set_fadeout_time = (gd_api . godot_method_bind_get_method) (class_name , "oneshot_node_set_fadeout_time\0" . as_ptr () as * const c_char) ; table . oneshot_node_set_filter_path = (gd_api . godot_method_bind_get_method) (class_name , "oneshot_node_set_filter_path\0" . as_ptr () as * const c_char) ; table . oneshot_node_start = (gd_api . godot_method_bind_get_method) (class_name , "oneshot_node_start\0" . as_ptr () as * const c_char) ; table . oneshot_node_stop = (gd_api . godot_method_bind_get_method) (class_name , "oneshot_node_stop\0" . as_ptr () as * const c_char) ; table . recompute_caches = (gd_api . godot_method_bind_get_method) (class_name , "recompute_caches\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 . reset = (gd_api . godot_method_bind_get_method) (class_name , "reset\0" . as_ptr () as * const c_char) ; table . set_active = (gd_api . godot_method_bind_get_method) (class_name , "set_active\0" . as_ptr () as * const c_char) ; table . set_animation_process_mode = (gd_api . godot_method_bind_get_method) (class_name , "set_animation_process_mode\0" . as_ptr () as * const c_char) ; table . set_base_path = (gd_api . godot_method_bind_get_method) (class_name , "set_base_path\0" . as_ptr () as * const c_char) ; table . set_master_player = (gd_api . godot_method_bind_get_method) (class_name , "set_master_player\0" . as_ptr () as * const c_char) ; table . timescale_node_get_scale = (gd_api . godot_method_bind_get_method) (class_name , "timescale_node_get_scale\0" . as_ptr () as * const c_char) ; table . timescale_node_set_scale = (gd_api . godot_method_bind_get_method) (class_name , "timescale_node_set_scale\0" . as_ptr () as * const c_char) ; table . timeseek_node_seek = (gd_api . godot_method_bind_get_method) (class_name , "timeseek_node_seek\0" . as_ptr () as * const c_char) ; table . transition_node_delete_input = (gd_api . godot_method_bind_get_method) (class_name , "transition_node_delete_input\0" . as_ptr () as * const c_char) ; table . transition_node_get_current = (gd_api . godot_method_bind_get_method) (class_name , "transition_node_get_current\0" . as_ptr () as * const c_char) ; table . transition_node_get_input_count = (gd_api . godot_method_bind_get_method) (class_name , "transition_node_get_input_count\0" . as_ptr () as * const c_char) ; table . transition_node_get_xfade_time = (gd_api . godot_method_bind_get_method) (class_name , "transition_node_get_xfade_time\0" . as_ptr () as * const c_char) ; table . transition_node_has_input_auto_advance = (gd_api . godot_method_bind_get_method) (class_name , "transition_node_has_input_auto_advance\0" . as_ptr () as * const c_char) ; table . transition_node_set_current = (gd_api . godot_method_bind_get_method) (class_name , "transition_node_set_current\0" . as_ptr () as * const c_char) ; table . transition_node_set_input_auto_advance = (gd_api . godot_method_bind_get_method) (class_name , "transition_node_set_input_auto_advance\0" . as_ptr () as * const c_char) ; table . transition_node_set_input_count = (gd_api . godot_method_bind_get_method) (class_name , "transition_node_set_input_count\0" . as_ptr () as * const c_char) ; table . transition_node_set_xfade_time = (gd_api . godot_method_bind_get_method) (class_name , "transition_node_set_xfade_time\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:237:27113 [INFO] [stdout] | [INFO] [stdout] 237 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 237 | # ! [doc = "This module contains types related to the API class [`Area`][super::Area]."] pub (crate) mod private { # [doc = "`core class Area` inherits `CollisionObject` (manually managed).\n\nThis class has related types in the [`area`][super::area] module."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/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 `Ownership` in these types tracks whether\nownership 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 { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: Area ; # [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 } } impl FromVariant for SpaceOverride { # [inline] fn from_variant (v : & Variant) -> Result < Self , FromVariantError > { i64 :: from_variant (v) . map (Self :: from) } } # [doc = "Constants"] # [allow (non_upper_case_globals)] impl Area { pub const SPACE_OVERRIDE_DISABLED : i64 = 0i64 ; pub const SPACE_OVERRIDE_COMBINE : i64 = 1i64 ; pub const SPACE_OVERRIDE_COMBINE_REPLACE : i64 = 2i64 ; 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 , ownership :: 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.\nSee [member ProjectSettings.physics/3d/default_angular_damp] for more details about 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 :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [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 :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < GodotString > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "The area's gravity intensity (in meters per second squared). 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 :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [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 :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "The area's gravity vector (not normalized). If gravity is a point (see [`gravity_point`][Self::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 :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < Vector3 > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "The rate at which objects stop moving in this area. Represents the linear velocity lost per second.\nSee [member ProjectSettings.physics/3d/default_linear_damp] for more details about 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 :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Returns a list of intersecting [`Area`][Area]s. The overlapping area's [`CollisionObject.collision_layer`][CollisionObject::collision_layer] must be part of this area's [`CollisionObject.collision_mask`][CollisionObject::collision_mask] in order to be detected.\nFor 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`][PhysicsBody]s. The overlapping body's [`CollisionObject.collision_layer`][CollisionObject::collision_layer] must be part of this area's [`CollisionObject.collision_mask`][CollisionObject::collision_mask] in order to be detected.\nFor 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 :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [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 :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [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 :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < GodotString > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [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 :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Override mode for gravity and damping calculations within this area. See [`SpaceOverride`][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 :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < crate :: generated :: area :: SpaceOverride > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "If `true`, gravity is calculated from a point (set via [`gravity_vec`][Self::gravity_vec]). See also [`space_override`][Self::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 :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [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 :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [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 :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [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 :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [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 :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [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 >) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AreaMethodTable :: get (get_api ()) . overlaps_area ; let ret = crate :: icalls :: icallvar__obj (method_bind , self . this . sys () . as_ptr () , area . as_arg_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [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`][PhysicsBody] or a [`GridMap`][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 >) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AreaMethodTable :: get (get_api ()) . overlaps_body ; let ret = crate :: icalls :: icallvar__obj (method_bind , self . this . sys () . as_ptr () , body . as_arg_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "The rate at which objects stop spinning in this area. Represents the angular velocity lost per second.\nSee [member ProjectSettings.physics/3d/default_angular_damp] for more details about 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 :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , angular_damp as _) ; } } # [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 :: icallvar__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 :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , enable as _) ; } } # [doc = "The area's gravity intensity (in meters per second squared). 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 :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , gravity as _) ; } } # [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 :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , distance_scale as _) ; } } # [doc = "If `true`, gravity is calculated from a point (set via [`gravity_vec`][Self::gravity_vec]). See also [`space_override`][Self::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 :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , enable as _) ; } } # [doc = "The area's gravity vector (not normalized). If gravity is a point (see [`gravity_point`][Self::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 :: icallvar__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.\nSee [member ProjectSettings.physics/3d/default_linear_damp] for more details about 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 :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , linear_damp as _) ; } } # [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 :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , enable as _) ; } } # [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 :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , enable as _) ; } } # [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 :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , priority 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 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 :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , amount as _) ; } } # [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 :: icallvar__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 :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , amount as _) ; } } # [doc = "Override mode for gravity and damping calculations within this area. See [`SpaceOverride`][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 :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , enable as _) ; } } # [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 :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , enable as _) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for Area { } unsafe impl GodotObject for Area { type Memory = memory :: 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 :: icallvar_ (method_bind , obj) ; } } impl std :: ops :: Deref for Area { type Target = crate :: generated :: CollisionObject ; # [inline] fn deref (& self) -> & crate :: generated :: CollisionObject { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for Area { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: CollisionObject { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: CollisionObject > for Area { } unsafe impl SubClass < crate :: generated :: Spatial > for Area { } unsafe impl SubClass < crate :: generated :: Node > for Area { } unsafe impl SubClass < crate :: generated :: Object > for Area { } impl Instanciable for Area { # [inline] fn construct () -> Ref < Self , ownership :: 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_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_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_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_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 } ; &raw 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 = std :: sync :: 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_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_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 [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:243:23171 [INFO] [stdout] | [INFO] [stdout] 243 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 243 | # ! [doc = "This module contains types related to the API class [`Area2D`][super::Area2D]."] pub (crate) mod private { # [doc = "`core class Area2D` inherits `CollisionObject2D` (manually managed).\n\nThis class has related types in the [`area_2d`][super::area_2d] module."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_area2d.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`Area2D` 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\nArea2D inherits methods from:\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 `Ownership` in these types tracks whether\nownership 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 Area2D { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: Area2D ; # [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 } } impl FromVariant for SpaceOverride { # [inline] fn from_variant (v : & Variant) -> Result < Self , FromVariantError > { i64 :: from_variant (v) . map (Self :: from) } } # [doc = "Constants"] # [allow (non_upper_case_globals)] impl Area2D { pub const SPACE_OVERRIDE_DISABLED : i64 = 0i64 ; pub const SPACE_OVERRIDE_COMBINE : i64 = 1i64 ; pub const SPACE_OVERRIDE_COMBINE_REPLACE : i64 = 2i64 ; pub const SPACE_OVERRIDE_REPLACE : i64 = 3i64 ; pub const SPACE_OVERRIDE_REPLACE_COMBINE : i64 = 4i64 ; } impl Area2D { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = Area2DMethodTable :: 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.\nSee [member ProjectSettings.physics/2d/default_angular_damp] for more details about damping."] # [doc = ""] # [inline] pub fn angular_damp (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = Area2DMethodTable :: get (get_api ()) . get_angular_damp ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "The name of the area's audio bus."] # [doc = ""] # [inline] pub fn audio_bus_name (& self) -> GodotString { unsafe { let method_bind : * mut sys :: godot_method_bind = Area2DMethodTable :: get (get_api ()) . get_audio_bus_name ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < GodotString > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "The area's gravity intensity (in pixels per second squared). 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 = Area2DMethodTable :: get (get_api ()) . get_gravity ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [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 = Area2DMethodTable :: get (get_api ()) . get_gravity_distance_scale ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "The area's gravity vector (not normalized). If gravity is a point (see [`gravity_point`][Self::gravity_point]), this will be the point of attraction."] # [doc = ""] # [inline] pub fn gravity_vector (& self) -> Vector2 { unsafe { let method_bind : * mut sys :: godot_method_bind = Area2DMethodTable :: get (get_api ()) . get_gravity_vector ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < Vector2 > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "The rate at which objects stop moving in this area. Represents the linear velocity lost per second.\nSee [member ProjectSettings.physics/2d/default_linear_damp] for more details about damping."] # [doc = ""] # [inline] pub fn linear_damp (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = Area2DMethodTable :: get (get_api ()) . get_linear_damp ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Returns a list of intersecting [`Area2D`][Area2D]s. The overlapping area's [`CollisionObject2D.collision_layer`][CollisionObject2D::collision_layer] must be part of this area's [`CollisionObject2D.collision_mask`][CollisionObject2D::collision_mask] in order to be detected.\nFor 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 = Area2DMethodTable :: 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 [`PhysicsBody2D`][PhysicsBody2D]s. The overlapping body's [`CollisionObject2D.collision_layer`][CollisionObject2D::collision_layer] must be part of this area's [`CollisionObject2D.collision_mask`][CollisionObject2D::collision_mask] in order to be detected.\nFor 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 = Area2DMethodTable :: 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 = Area2DMethodTable :: get (get_api ()) . get_priority ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Override mode for gravity and damping calculations within this area. See [`SpaceOverride`][SpaceOverride] for possible values."] # [doc = ""] # [inline] pub fn space_override_mode (& self) -> crate :: generated :: area_2d :: SpaceOverride { unsafe { let method_bind : * mut sys :: godot_method_bind = Area2DMethodTable :: get (get_api ()) . get_space_override_mode ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < crate :: generated :: area_2d :: SpaceOverride > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "If `true`, gravity is calculated from a point (set via [`gravity_vec`][Self::gravity_vec]). See also [`space_override`][Self::space_override]."] # [doc = ""] # [inline] pub fn is_gravity_a_point (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = Area2DMethodTable :: get (get_api ()) . is_gravity_a_point ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [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 = Area2DMethodTable :: get (get_api ()) . is_monitorable ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [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 = Area2DMethodTable :: get (get_api ()) . is_monitoring ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [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 = Area2DMethodTable :: get (get_api ()) . is_overriding_audio_bus ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "If `true`, the given area overlaps the Area2D.\n**Note:** The result of this test is not immediate after moving objects. For performance, the 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 >) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = Area2DMethodTable :: get (get_api ()) . overlaps_area ; let ret = crate :: icalls :: icallvar__obj (method_bind , self . this . sys () . as_ptr () , area . as_arg_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "If `true`, the given physics body overlaps the Area2D.\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 [`PhysicsBody2D`][PhysicsBody2D] or a [`TileMap`][TileMap] instance (while TileMaps are not physics bodies 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 >) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = Area2DMethodTable :: get (get_api ()) . overlaps_body ; let ret = crate :: icalls :: icallvar__obj (method_bind , self . this . sys () . as_ptr () , body . as_arg_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "The rate at which objects stop spinning in this area. Represents the angular velocity lost per second.\nSee [member ProjectSettings.physics/2d/default_angular_damp] for more details about damping."] # [doc = ""] # [inline] pub fn set_angular_damp (& self , angular_damp : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = Area2DMethodTable :: get (get_api ()) . set_angular_damp ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , angular_damp as _) ; } } # [doc = "The name of the area's audio bus."] # [doc = ""] # [inline] pub fn set_audio_bus_name (& self , name : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = Area2DMethodTable :: get (get_api ()) . set_audio_bus_name ; let ret = crate :: icalls :: icallvar__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 = Area2DMethodTable :: get (get_api ()) . set_audio_bus_override ; let ret = crate :: icalls :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , enable as _) ; } } # [doc = "The area's gravity intensity (in pixels per second squared). 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 = Area2DMethodTable :: get (get_api ()) . set_gravity ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , gravity as _) ; } } # [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 = Area2DMethodTable :: get (get_api ()) . set_gravity_distance_scale ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , distance_scale as _) ; } } # [doc = "If `true`, gravity is calculated from a point (set via [`gravity_vec`][Self::gravity_vec]). See also [`space_override`][Self::space_override]."] # [doc = ""] # [inline] pub fn set_gravity_is_point (& self , enable : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = Area2DMethodTable :: get (get_api ()) . set_gravity_is_point ; let ret = crate :: icalls :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , enable as _) ; } } # [doc = "The area's gravity vector (not normalized). If gravity is a point (see [`gravity_point`][Self::gravity_point]), this will be the point of attraction."] # [doc = ""] # [inline] pub fn set_gravity_vector (& self , vector : Vector2) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = Area2DMethodTable :: get (get_api ()) . set_gravity_vector ; let ret = crate :: icalls :: icallvar__vec2 (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.\nSee [member ProjectSettings.physics/2d/default_linear_damp] for more details about damping."] # [doc = ""] # [inline] pub fn set_linear_damp (& self , linear_damp : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = Area2DMethodTable :: get (get_api ()) . set_linear_damp ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , linear_damp as _) ; } } # [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 = Area2DMethodTable :: get (get_api ()) . set_monitorable ; let ret = crate :: icalls :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , enable as _) ; } } # [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 = Area2DMethodTable :: get (get_api ()) . set_monitoring ; let ret = crate :: icalls :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , enable as _) ; } } # [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 = Area2DMethodTable :: get (get_api ()) . set_priority ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , priority as _) ; } } # [doc = "Override mode for gravity and damping calculations within this area. See [`SpaceOverride`][SpaceOverride] for possible values."] # [doc = ""] # [inline] pub fn set_space_override_mode (& self , space_override_mode : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = Area2DMethodTable :: get (get_api ()) . set_space_override_mode ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , space_override_mode as _) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for Area2D { } unsafe impl GodotObject for Area2D { type Memory = memory :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "Area2D" } } impl QueueFree for Area2D { # [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 :: icallvar_ (method_bind , obj) ; } } impl std :: ops :: Deref for Area2D { type Target = crate :: generated :: CollisionObject2D ; # [inline] fn deref (& self) -> & crate :: generated :: CollisionObject2D { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for Area2D { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: CollisionObject2D { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: CollisionObject2D > for Area2D { } unsafe impl SubClass < crate :: generated :: Node2D > for Area2D { } unsafe impl SubClass < crate :: generated :: CanvasItem > for Area2D { } unsafe impl SubClass < crate :: generated :: Node > for Area2D { } unsafe impl SubClass < crate :: generated :: Object > for Area2D { } impl Instanciable for Area2D { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { Area2D :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct Area2DMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_angular_damp : * mut sys :: godot_method_bind , pub get_audio_bus_name : * 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_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 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_name : * mut sys :: godot_method_bind , pub set_audio_bus_override : * 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_space_override_mode : * mut sys :: godot_method_bind } impl Area2DMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : Area2DMethodTable = Area2DMethodTable { class_constructor : None , get_angular_damp : 0 as * mut sys :: godot_method_bind , get_audio_bus_name : 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_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 , 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_name : 0 as * mut sys :: godot_method_bind , set_audio_bus_override : 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_space_override_mode : 0 as * mut sys :: godot_method_bind } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { Area2DMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "Area2D\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_name = (gd_api . godot_method_bind_get_method) (class_name , "get_audio_bus_name\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_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 . 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_name = (gd_api . godot_method_bind_get_method) (class_name , "set_audio_bus_name\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_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_space_override_mode = (gd_api . godot_method_bind_get_method) (class_name , "set_space_override_mode\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:249:20918 [INFO] [stdout] | [INFO] [stdout] 249 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 249 | # ! [doc = "This module contains types related to the API class [`ArrayMesh`][super::ArrayMesh]."] pub (crate) mod private { # [doc = "`core class ArrayMesh` inherits `Mesh` (reference-counted).\n\nThis class has related types in the [`array_mesh`][super::array_mesh] module."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_arraymesh.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\nArrayMesh inherits methods from:\n - [Mesh](struct.Mesh.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 `Ownership` in these types tracks whether\nownership 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 ArrayMesh { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: ArrayMesh ; # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct ArrayFormat (pub i64) ; impl ArrayFormat { pub const VERTEX : ArrayFormat = ArrayFormat (1i64) ; pub const NORMAL : ArrayFormat = ArrayFormat (2i64) ; pub const TANGENT : ArrayFormat = ArrayFormat (4i64) ; pub const COLOR : ArrayFormat = ArrayFormat (8i64) ; pub const TEX_UV : ArrayFormat = ArrayFormat (16i64) ; pub const TEX_UV2 : ArrayFormat = ArrayFormat (32i64) ; pub const BONES : ArrayFormat = ArrayFormat (64i64) ; pub const WEIGHTS : ArrayFormat = ArrayFormat (128i64) ; pub const INDEX : ArrayFormat = ArrayFormat (256i64) ; } impl From < i64 > for ArrayFormat { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < ArrayFormat > for i64 { # [inline] fn from (v : ArrayFormat) -> Self { v . 0 } } impl FromVariant for ArrayFormat { # [inline] fn from_variant (v : & Variant) -> Result < Self , FromVariantError > { i64 :: from_variant (v) . map (Self :: from) } } # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct ArrayType (pub i64) ; impl ArrayType { pub const VERTEX : ArrayType = ArrayType (0i64) ; pub const NORMAL : ArrayType = ArrayType (1i64) ; pub const TANGENT : ArrayType = ArrayType (2i64) ; pub const COLOR : ArrayType = ArrayType (3i64) ; pub const TEX_UV : ArrayType = ArrayType (4i64) ; pub const TEX_UV2 : ArrayType = ArrayType (5i64) ; pub const BONES : ArrayType = ArrayType (6i64) ; pub const WEIGHTS : ArrayType = ArrayType (7i64) ; pub const INDEX : ArrayType = ArrayType (8i64) ; pub const MAX : ArrayType = ArrayType (9i64) ; } impl From < i64 > for ArrayType { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < ArrayType > for i64 { # [inline] fn from (v : ArrayType) -> Self { v . 0 } } impl FromVariant for ArrayType { # [inline] fn from_variant (v : & Variant) -> Result < Self , FromVariantError > { i64 :: from_variant (v) . map (Self :: from) } } # [doc = "Constants"] # [allow (non_upper_case_globals)] impl ArrayMesh { pub const NO_INDEX_ARRAY : i64 = - 1i64 ; pub const ARRAY_VERTEX : i64 = 0i64 ; pub const ARRAY_FORMAT_VERTEX : i64 = 1i64 ; pub const ARRAY_NORMAL : i64 = 1i64 ; pub const ARRAY_FORMAT_NORMAL : i64 = 2i64 ; pub const ARRAY_TANGENT : i64 = 2i64 ; pub const ARRAY_COLOR : i64 = 3i64 ; pub const ARRAY_FORMAT_TANGENT : i64 = 4i64 ; pub const ARRAY_TEX_UV : i64 = 4i64 ; pub const ARRAY_WEIGHTS_SIZE : i64 = 4i64 ; pub const ARRAY_TEX_UV2 : i64 = 5i64 ; pub const ARRAY_BONES : i64 = 6i64 ; pub const ARRAY_WEIGHTS : i64 = 7i64 ; pub const ARRAY_FORMAT_COLOR : i64 = 8i64 ; pub const ARRAY_INDEX : i64 = 8i64 ; pub const ARRAY_MAX : i64 = 9i64 ; pub const ARRAY_FORMAT_TEX_UV : i64 = 16i64 ; pub const ARRAY_FORMAT_TEX_UV2 : i64 = 32i64 ; pub const ARRAY_FORMAT_BONES : i64 = 64i64 ; pub const ARRAY_FORMAT_WEIGHTS : i64 = 128i64 ; pub const ARRAY_FORMAT_INDEX : i64 = 256i64 ; } impl ArrayMesh { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = ArrayMeshMethodTable :: 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 name for a blend shape that will be added with [`add_surface_from_arrays`][Self::add_surface_from_arrays]. Must be called before surface is added."] # [doc = ""] # [inline] pub fn add_blend_shape (& self , name : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = ArrayMeshMethodTable :: get (get_api ()) . add_blend_shape ; let ret = crate :: icalls :: icallvar__str (method_bind , self . this . sys () . as_ptr () , name . into ()) ; } } # [doc = "Creates a new surface.\nSurfaces are created to be rendered using a `primitive`, which may be any of the types defined in [enum Mesh.PrimitiveType]. (As a note, when using indices, it is recommended to only use points, lines, or triangles.) [`Mesh.get_surface_count`][Mesh::get_surface_count] will become the `surf_idx` for this new surface.\nThe `arrays` argument is an array of arrays. See [`ArrayType`][ArrayType] for the values used in this array. For example, `arrays[`0`][0]` is the array of vertices. That first vertex sub-array is always required; the others are optional. Adding an index array puts this function into \"index mode\" where the vertex and other arrays become the sources of data and the index array defines the vertex order. All sub-arrays must have the same length as the vertex array or be empty, except for [`ARRAY_INDEX`][Self::ARRAY_INDEX] if it is used.\n`compress_flags` is a bitfield made of [enum Mesh.ArrayFormat] values. It defaults to [`Mesh.ARRAY_COMPRESS_DEFAULT`][Mesh::ARRAY_COMPRESS_DEFAULT].\n**Note:** The default `compress_flags` enable [`Mesh.ARRAY_COMPRESS_COLOR`][Mesh::ARRAY_COMPRESS_COLOR], which makes vertex colors stored as 8-bit unsigned integers. This will clamp overbright vertex colors to `Color(1, 1, 1, 1)` and reduce their precision. To store HDR vertex colors, remove the vertex color compression flag by passing `Mesh.ARRAY_COMPRESS_DEFAULT ^ Mesh.ARRAY_COMPRESS_COLOR` as the value of `compress_flags`.\n# Default Arguments\n* `blend_shapes` - `[ ]`\n* `compress_flags` - `2194432`"] # [doc = ""] # [inline] pub fn add_surface_from_arrays (& self , primitive : i64 , arrays : VariantArray , blend_shapes : VariantArray , compress_flags : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = ArrayMeshMethodTable :: get (get_api ()) . add_surface_from_arrays ; let ret = crate :: icalls :: icallvar__i64_arr_arr_i64 (method_bind , self . this . sys () . as_ptr () , primitive as _ , arrays , blend_shapes , compress_flags as _) ; } } # [doc = "Removes all blend shapes from this [`ArrayMesh`][ArrayMesh]."] # [doc = ""] # [inline] pub fn clear_blend_shapes (& self) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = ArrayMeshMethodTable :: get (get_api ()) . clear_blend_shapes ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; } } # [doc = "Removes all surfaces from this [`ArrayMesh`][ArrayMesh]."] # [doc = ""] # [inline] pub fn clear_surfaces (& self) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = ArrayMeshMethodTable :: get (get_api ()) . clear_surfaces ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; } } # [doc = "Returns the number of blend shapes that the [`ArrayMesh`][ArrayMesh] holds."] # [doc = ""] # [inline] pub fn get_blend_shape_count (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = ArrayMeshMethodTable :: get (get_api ()) . get_blend_shape_count ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "Sets the blend shape mode to one of [enum Mesh.BlendShapeMode]."] # [doc = ""] # [inline] pub fn blend_shape_mode (& self) -> crate :: generated :: mesh :: BlendShapeMode { unsafe { let method_bind : * mut sys :: godot_method_bind = ArrayMeshMethodTable :: get (get_api ()) . get_blend_shape_mode ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < crate :: generated :: mesh :: BlendShapeMode > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns the name of the blend shape at this index."] # [doc = ""] # [inline] pub fn get_blend_shape_name (& self , index : i64) -> GodotString { unsafe { let method_bind : * mut sys :: godot_method_bind = ArrayMeshMethodTable :: get (get_api ()) . get_blend_shape_name ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , index as _) ; < GodotString > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Overrides the [`AABB`][Aabb] with one defined by user for use with frustum culling. Especially useful to avoid unexpected culling when using a shader to offset vertices."] # [doc = ""] # [inline] pub fn custom_aabb (& self) -> Aabb { unsafe { let method_bind : * mut sys :: godot_method_bind = ArrayMeshMethodTable :: get (get_api ()) . get_custom_aabb ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < Aabb > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Will perform a UV unwrap on the [`ArrayMesh`][ArrayMesh] to prepare the mesh for lightmapping."] # [doc = ""] # [inline] pub fn lightmap_unwrap (& self , transform : Transform , texel_size : f64) -> GodotResult { unsafe { let method_bind : * mut sys :: godot_method_bind = ArrayMeshMethodTable :: get (get_api ()) . lightmap_unwrap ; let ret = crate :: icalls :: icallvar__trans_f64 (method_bind , self . this . sys () . as_ptr () , transform , texel_size as _) ; GodotError :: result_from_sys (sys :: godot_error :: from_variant (& ret) . expect ("Unexpected variant type")) } } # [doc = "Will regenerate normal maps for the [`ArrayMesh`][ArrayMesh]."] # [doc = ""] # [inline] pub fn regen_normalmaps (& self) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = ArrayMeshMethodTable :: get (get_api ()) . regen_normalmaps ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; } } # [doc = "Sets the blend shape mode to one of [enum Mesh.BlendShapeMode]."] # [doc = ""] # [inline] pub fn set_blend_shape_mode (& self , mode : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = ArrayMeshMethodTable :: get (get_api ()) . set_blend_shape_mode ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , mode as _) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn set_blend_shape_name (& self , index : i64 , name : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = ArrayMeshMethodTable :: get (get_api ()) . set_blend_shape_name ; let ret = crate :: icalls :: icallvar__i64_str (method_bind , self . this . sys () . as_ptr () , index as _ , name . into ()) ; } } # [doc = "Overrides the [`AABB`][Aabb] with one defined by user for use with frustum culling. Especially useful to avoid unexpected culling when using a shader to offset vertices."] # [doc = ""] # [inline] pub fn set_custom_aabb (& self , aabb : Aabb) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = ArrayMeshMethodTable :: get (get_api ()) . set_custom_aabb ; let ret = crate :: icalls :: icallvar__aabb (method_bind , self . this . sys () . as_ptr () , aabb) ; } } # [doc = "Returns the index of the first surface with this name held within this [`ArrayMesh`][ArrayMesh]. If none are found, -1 is returned."] # [doc = ""] # [inline] pub fn surface_find_by_name (& self , name : impl Into < GodotString >) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = ArrayMeshMethodTable :: get (get_api ()) . surface_find_by_name ; let ret = crate :: icalls :: icallvar__str (method_bind , self . this . sys () . as_ptr () , name . into ()) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "Returns the length in indices of the index array in the requested surface (see [`add_surface_from_arrays`][Self::add_surface_from_arrays])."] # [doc = ""] # [inline] pub fn surface_get_array_index_len (& self , surf_idx : i64) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = ArrayMeshMethodTable :: get (get_api ()) . surface_get_array_index_len ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , surf_idx as _) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "Returns the length in vertices of the vertex array in the requested surface (see [`add_surface_from_arrays`][Self::add_surface_from_arrays])."] # [doc = ""] # [inline] pub fn surface_get_array_len (& self , surf_idx : i64) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = ArrayMeshMethodTable :: get (get_api ()) . surface_get_array_len ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , surf_idx as _) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "Returns the format mask of the requested surface (see [`add_surface_from_arrays`][Self::add_surface_from_arrays])."] # [doc = ""] # [inline] pub fn surface_get_format (& self , surf_idx : i64) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = ArrayMeshMethodTable :: get (get_api ()) . surface_get_format ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , surf_idx as _) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "Gets the name assigned to this surface."] # [doc = ""] # [inline] pub fn surface_get_name (& self , surf_idx : i64) -> GodotString { unsafe { let method_bind : * mut sys :: godot_method_bind = ArrayMeshMethodTable :: get (get_api ()) . surface_get_name ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , surf_idx as _) ; < GodotString > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns the primitive type of the requested surface (see [`add_surface_from_arrays`][Self::add_surface_from_arrays])."] # [doc = ""] # [inline] pub fn surface_get_primitive_type (& self , surf_idx : i64) -> crate :: generated :: mesh :: PrimitiveType { unsafe { let method_bind : * mut sys :: godot_method_bind = ArrayMeshMethodTable :: get (get_api ()) . surface_get_primitive_type ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , surf_idx as _) ; < crate :: generated :: mesh :: PrimitiveType > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Removes a surface at position `surf_idx`, shifting greater surfaces one `surf_idx` slot down."] # [doc = ""] # [inline] pub fn surface_remove (& self , surf_idx : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = ArrayMeshMethodTable :: get (get_api ()) . surface_remove ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , surf_idx as _) ; } } # [doc = "Sets a name for a given surface."] # [doc = ""] # [inline] pub fn surface_set_name (& self , surf_idx : i64 , name : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = ArrayMeshMethodTable :: get (get_api ()) . surface_set_name ; let ret = crate :: icalls :: icallvar__i64_str (method_bind , self . this . sys () . as_ptr () , surf_idx as _ , name . into ()) ; } } # [doc = "Updates a specified region of mesh arrays on the GPU.\n**Warning:** Only use if you know what you are doing. You can easily cause crashes by calling this function with improper arguments."] # [doc = ""] # [inline] pub fn surface_update_region (& self , surf_idx : i64 , offset : i64 , data : PoolArray < u8 >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = ArrayMeshMethodTable :: get (get_api ()) . surface_update_region ; let ret = crate :: icalls :: icallvar__i64_i64_bytearr (method_bind , self . this . sys () . as_ptr () , surf_idx as _ , offset as _ , data) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for ArrayMesh { } unsafe impl GodotObject for ArrayMesh { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "ArrayMesh" } } impl std :: ops :: Deref for ArrayMesh { type Target = crate :: generated :: Mesh ; # [inline] fn deref (& self) -> & crate :: generated :: Mesh { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for ArrayMesh { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: Mesh { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: Mesh > for ArrayMesh { } unsafe impl SubClass < crate :: generated :: Resource > for ArrayMesh { } unsafe impl SubClass < crate :: generated :: Reference > for ArrayMesh { } unsafe impl SubClass < crate :: generated :: Object > for ArrayMesh { } impl Instanciable for ArrayMesh { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { ArrayMesh :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct ArrayMeshMethodTable { pub class_constructor : sys :: godot_class_constructor , pub add_blend_shape : * mut sys :: godot_method_bind , pub add_surface_from_arrays : * mut sys :: godot_method_bind , pub clear_blend_shapes : * mut sys :: godot_method_bind , pub clear_surfaces : * mut sys :: godot_method_bind , pub get_blend_shape_count : * mut sys :: godot_method_bind , pub get_blend_shape_mode : * mut sys :: godot_method_bind , pub get_blend_shape_name : * mut sys :: godot_method_bind , pub get_custom_aabb : * mut sys :: godot_method_bind , pub lightmap_unwrap : * mut sys :: godot_method_bind , pub regen_normalmaps : * mut sys :: godot_method_bind , pub set_blend_shape_mode : * mut sys :: godot_method_bind , pub set_blend_shape_name : * mut sys :: godot_method_bind , pub set_custom_aabb : * mut sys :: godot_method_bind , pub surface_find_by_name : * mut sys :: godot_method_bind , pub surface_get_array_index_len : * mut sys :: godot_method_bind , pub surface_get_array_len : * mut sys :: godot_method_bind , pub surface_get_format : * mut sys :: godot_method_bind , pub surface_get_name : * mut sys :: godot_method_bind , pub surface_get_primitive_type : * mut sys :: godot_method_bind , pub surface_remove : * mut sys :: godot_method_bind , pub surface_set_name : * mut sys :: godot_method_bind , pub surface_update_region : * mut sys :: godot_method_bind } impl ArrayMeshMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : ArrayMeshMethodTable = ArrayMeshMethodTable { class_constructor : None , add_blend_shape : 0 as * mut sys :: godot_method_bind , add_surface_from_arrays : 0 as * mut sys :: godot_method_bind , clear_blend_shapes : 0 as * mut sys :: godot_method_bind , clear_surfaces : 0 as * mut sys :: godot_method_bind , get_blend_shape_count : 0 as * mut sys :: godot_method_bind , get_blend_shape_mode : 0 as * mut sys :: godot_method_bind , get_blend_shape_name : 0 as * mut sys :: godot_method_bind , get_custom_aabb : 0 as * mut sys :: godot_method_bind , lightmap_unwrap : 0 as * mut sys :: godot_method_bind , regen_normalmaps : 0 as * mut sys :: godot_method_bind , set_blend_shape_mode : 0 as * mut sys :: godot_method_bind , set_blend_shape_name : 0 as * mut sys :: godot_method_bind , set_custom_aabb : 0 as * mut sys :: godot_method_bind , surface_find_by_name : 0 as * mut sys :: godot_method_bind , surface_get_array_index_len : 0 as * mut sys :: godot_method_bind , surface_get_array_len : 0 as * mut sys :: godot_method_bind , surface_get_format : 0 as * mut sys :: godot_method_bind , surface_get_name : 0 as * mut sys :: godot_method_bind , surface_get_primitive_type : 0 as * mut sys :: godot_method_bind , surface_remove : 0 as * mut sys :: godot_method_bind , surface_set_name : 0 as * mut sys :: godot_method_bind , surface_update_region : 0 as * mut sys :: godot_method_bind } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { ArrayMeshMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "ArrayMesh\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . add_blend_shape = (gd_api . godot_method_bind_get_method) (class_name , "add_blend_shape\0" . as_ptr () as * const c_char) ; table . add_surface_from_arrays = (gd_api . godot_method_bind_get_method) (class_name , "add_surface_from_arrays\0" . as_ptr () as * const c_char) ; table . clear_blend_shapes = (gd_api . godot_method_bind_get_method) (class_name , "clear_blend_shapes\0" . as_ptr () as * const c_char) ; table . clear_surfaces = (gd_api . godot_method_bind_get_method) (class_name , "clear_surfaces\0" . as_ptr () as * const c_char) ; table . get_blend_shape_count = (gd_api . godot_method_bind_get_method) (class_name , "get_blend_shape_count\0" . as_ptr () as * const c_char) ; table . get_blend_shape_mode = (gd_api . godot_method_bind_get_method) (class_name , "get_blend_shape_mode\0" . as_ptr () as * const c_char) ; table . get_blend_shape_name = (gd_api . godot_method_bind_get_method) (class_name , "get_blend_shape_name\0" . as_ptr () as * const c_char) ; table . get_custom_aabb = (gd_api . godot_method_bind_get_method) (class_name , "get_custom_aabb\0" . as_ptr () as * const c_char) ; table . lightmap_unwrap = (gd_api . godot_method_bind_get_method) (class_name , "lightmap_unwrap\0" . as_ptr () as * const c_char) ; table . regen_normalmaps = (gd_api . godot_method_bind_get_method) (class_name , "regen_normalmaps\0" . as_ptr () as * const c_char) ; table . set_blend_shape_mode = (gd_api . godot_method_bind_get_method) (class_name , "set_blend_shape_mode\0" . as_ptr () as * const c_char) ; table . set_blend_shape_name = (gd_api . godot_method_bind_get_method) (class_name , "set_blend_shape_name\0" . as_ptr () as * const c_char) ; table . set_custom_aabb = (gd_api . godot_method_bind_get_method) (class_name , "set_custom_aabb\0" . as_ptr () as * const c_char) ; table . surface_find_by_name = (gd_api . godot_method_bind_get_method) (class_name , "surface_find_by_name\0" . as_ptr () as * const c_char) ; table . surface_get_array_index_len = (gd_api . godot_method_bind_get_method) (class_name , "surface_get_array_index_len\0" . as_ptr () as * const c_char) ; table . surface_get_array_len = (gd_api . godot_method_bind_get_method) (class_name , "surface_get_array_len\0" . as_ptr () as * const c_char) ; table . surface_get_format = (gd_api . godot_method_bind_get_method) (class_name , "surface_get_format\0" . as_ptr () as * const c_char) ; table . surface_get_name = (gd_api . godot_method_bind_get_method) (class_name , "surface_get_name\0" . as_ptr () as * const c_char) ; table . surface_get_primitive_type = (gd_api . godot_method_bind_get_method) (class_name , "surface_get_primitive_type\0" . as_ptr () as * const c_char) ; table . surface_remove = (gd_api . godot_method_bind_get_method) (class_name , "surface_remove\0" . as_ptr () as * const c_char) ; table . surface_set_name = (gd_api . godot_method_bind_get_method) (class_name , "surface_set_name\0" . as_ptr () as * const c_char) ; table . surface_update_region = (gd_api . godot_method_bind_get_method) (class_name , "surface_update_region\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:255:11457 [INFO] [stdout] | [INFO] [stdout] 255 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 255 | # ! [doc = "This module contains types related to the API class [`AspectRatioContainer`][super::AspectRatioContainer]."] pub (crate) mod private { # [doc = "`core class AspectRatioContainer` inherits `Container` (manually managed).\n\nThis class has related types in the [`aspect_ratio_container`][super::aspect_ratio_container] module."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_aspectratiocontainer.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`AspectRatioContainer` 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\nAspectRatioContainer 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 `Ownership` in these types tracks whether\nownership 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 AspectRatioContainer { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AspectRatioContainer ; # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct AlignMode (pub i64) ; impl AlignMode { pub const BEGIN : AlignMode = AlignMode (0i64) ; pub const CENTER : AlignMode = AlignMode (1i64) ; pub const END : AlignMode = AlignMode (2i64) ; } impl From < i64 > for AlignMode { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < AlignMode > for i64 { # [inline] fn from (v : AlignMode) -> Self { v . 0 } } impl FromVariant for AlignMode { # [inline] fn from_variant (v : & Variant) -> Result < Self , FromVariantError > { i64 :: from_variant (v) . map (Self :: from) } } # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct StretchMode (pub i64) ; impl StretchMode { pub const WIDTH_CONTROLS_HEIGHT : StretchMode = StretchMode (0i64) ; pub const HEIGHT_CONTROLS_WIDTH : StretchMode = StretchMode (1i64) ; pub const FIT : StretchMode = StretchMode (2i64) ; pub const COVER : StretchMode = StretchMode (3i64) ; } impl From < i64 > for StretchMode { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < StretchMode > for i64 { # [inline] fn from (v : StretchMode) -> Self { v . 0 } } impl FromVariant for StretchMode { # [inline] fn from_variant (v : & Variant) -> Result < Self , FromVariantError > { i64 :: from_variant (v) . map (Self :: from) } } # [doc = "Constants"] # [allow (non_upper_case_globals)] impl AspectRatioContainer { pub const ALIGN_BEGIN : i64 = 0i64 ; pub const STRETCH_WIDTH_CONTROLS_HEIGHT : i64 = 0i64 ; pub const ALIGN_CENTER : i64 = 1i64 ; pub const STRETCH_HEIGHT_CONTROLS_WIDTH : i64 = 1i64 ; pub const ALIGN_END : i64 = 2i64 ; pub const STRETCH_FIT : i64 = 2i64 ; pub const STRETCH_COVER : i64 = 3i64 ; } impl AspectRatioContainer { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AspectRatioContainerMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "Specifies the horizontal relative position of child controls."] # [doc = ""] # [inline] pub fn alignment_horizontal (& self) -> crate :: generated :: aspect_ratio_container :: AlignMode { unsafe { let method_bind : * mut sys :: godot_method_bind = AspectRatioContainerMethodTable :: get (get_api ()) . get_alignment_horizontal ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < crate :: generated :: aspect_ratio_container :: AlignMode > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Specifies the vertical relative position of child controls."] # [doc = ""] # [inline] pub fn alignment_vertical (& self) -> crate :: generated :: aspect_ratio_container :: AlignMode { unsafe { let method_bind : * mut sys :: godot_method_bind = AspectRatioContainerMethodTable :: get (get_api ()) . get_alignment_vertical ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < crate :: generated :: aspect_ratio_container :: AlignMode > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "The aspect ratio to enforce on child controls. This is the width divided by the height. The ratio depends on the [`stretch_mode`][Self::stretch_mode]."] # [doc = ""] # [inline] pub fn ratio (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AspectRatioContainerMethodTable :: get (get_api ()) . get_ratio ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "The stretch mode used to align child controls."] # [doc = ""] # [inline] pub fn stretch_mode (& self) -> crate :: generated :: aspect_ratio_container :: StretchMode { unsafe { let method_bind : * mut sys :: godot_method_bind = AspectRatioContainerMethodTable :: get (get_api ()) . get_stretch_mode ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < crate :: generated :: aspect_ratio_container :: StretchMode > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Specifies the horizontal relative position of child controls."] # [doc = ""] # [inline] pub fn set_alignment_horizontal (& self , alignment_horizontal : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AspectRatioContainerMethodTable :: get (get_api ()) . set_alignment_horizontal ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , alignment_horizontal as _) ; } } # [doc = "Specifies the vertical relative position of child controls."] # [doc = ""] # [inline] pub fn set_alignment_vertical (& self , alignment_vertical : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AspectRatioContainerMethodTable :: get (get_api ()) . set_alignment_vertical ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , alignment_vertical as _) ; } } # [doc = "The aspect ratio to enforce on child controls. This is the width divided by the height. The ratio depends on the [`stretch_mode`][Self::stretch_mode]."] # [doc = ""] # [inline] pub fn set_ratio (& self , ratio : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AspectRatioContainerMethodTable :: get (get_api ()) . set_ratio ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , ratio as _) ; } } # [doc = "The stretch mode used to align child controls."] # [doc = ""] # [inline] pub fn set_stretch_mode (& self , stretch_mode : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AspectRatioContainerMethodTable :: get (get_api ()) . set_stretch_mode ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , stretch_mode as _) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for AspectRatioContainer { } unsafe impl GodotObject for AspectRatioContainer { type Memory = memory :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "AspectRatioContainer" } } impl QueueFree for AspectRatioContainer { # [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 :: icallvar_ (method_bind , obj) ; } } impl std :: ops :: Deref for AspectRatioContainer { type Target = crate :: generated :: Container ; # [inline] fn deref (& self) -> & crate :: generated :: Container { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AspectRatioContainer { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: Container { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: Container > for AspectRatioContainer { } unsafe impl SubClass < crate :: generated :: Control > for AspectRatioContainer { } unsafe impl SubClass < crate :: generated :: CanvasItem > for AspectRatioContainer { } unsafe impl SubClass < crate :: generated :: Node > for AspectRatioContainer { } unsafe impl SubClass < crate :: generated :: Object > for AspectRatioContainer { } impl Instanciable for AspectRatioContainer { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { AspectRatioContainer :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AspectRatioContainerMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_alignment_horizontal : * mut sys :: godot_method_bind , pub get_alignment_vertical : * mut sys :: godot_method_bind , pub get_ratio : * mut sys :: godot_method_bind , pub get_stretch_mode : * mut sys :: godot_method_bind , pub set_alignment_horizontal : * mut sys :: godot_method_bind , pub set_alignment_vertical : * mut sys :: godot_method_bind , pub set_ratio : * mut sys :: godot_method_bind , pub set_stretch_mode : * mut sys :: godot_method_bind } impl AspectRatioContainerMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AspectRatioContainerMethodTable = AspectRatioContainerMethodTable { class_constructor : None , get_alignment_horizontal : 0 as * mut sys :: godot_method_bind , get_alignment_vertical : 0 as * mut sys :: godot_method_bind , get_ratio : 0 as * mut sys :: godot_method_bind , get_stretch_mode : 0 as * mut sys :: godot_method_bind , set_alignment_horizontal : 0 as * mut sys :: godot_method_bind , set_alignment_vertical : 0 as * mut sys :: godot_method_bind , set_ratio : 0 as * mut sys :: godot_method_bind , set_stretch_mode : 0 as * mut sys :: godot_method_bind } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { AspectRatioContainerMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AspectRatioContainer\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_alignment_horizontal = (gd_api . godot_method_bind_get_method) (class_name , "get_alignment_horizontal\0" . as_ptr () as * const c_char) ; table . get_alignment_vertical = (gd_api . godot_method_bind_get_method) (class_name , "get_alignment_vertical\0" . as_ptr () as * const c_char) ; table . get_ratio = (gd_api . godot_method_bind_get_method) (class_name , "get_ratio\0" . as_ptr () as * const c_char) ; table . get_stretch_mode = (gd_api . godot_method_bind_get_method) (class_name , "get_stretch_mode\0" . as_ptr () as * const c_char) ; table . set_alignment_horizontal = (gd_api . godot_method_bind_get_method) (class_name , "set_alignment_horizontal\0" . as_ptr () as * const c_char) ; table . set_alignment_vertical = (gd_api . godot_method_bind_get_method) (class_name , "set_alignment_vertical\0" . as_ptr () as * const c_char) ; table . set_ratio = (gd_api . godot_method_bind_get_method) (class_name , "set_ratio\0" . as_ptr () as * const c_char) ; table . set_stretch_mode = (gd_api . godot_method_bind_get_method) (class_name , "set_stretch_mode\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:261:7918 [INFO] [stdout] | [INFO] [stdout] 261 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 261 | # ! [doc = "This module contains types related to the API class [`AtlasTexture`][super::AtlasTexture]."] pub (crate) mod private { # [doc = "`core class AtlasTexture` inherits `Texture` (reference-counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_atlastexture.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\nAtlasTexture 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 `Ownership` in these types tracks whether\nownership 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 AtlasTexture { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AtlasTexture ; impl AtlasTexture { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AtlasTextureMethodTable :: 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 texture that contains the atlas. Can be any [`Texture`][Texture] subtype."] # [doc = ""] # [inline] pub fn atlas (& self) -> Option < Ref < crate :: generated :: Texture , ownership :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = AtlasTextureMethodTable :: get (get_api ()) . get_atlas ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < Option < Ref < crate :: generated :: Texture , ownership :: Shared > > > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "The margin around the region. The [`Rect2`][Rect2]'s [`Rect2.size`][Rect2::size] parameter (\"w\" and \"h\" in the editor) resizes the texture so it fits within the margin."] # [doc = ""] # [inline] pub fn margin (& self) -> Rect2 { unsafe { let method_bind : * mut sys :: godot_method_bind = AtlasTextureMethodTable :: get (get_api ()) . get_margin ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < Rect2 > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "The AtlasTexture's used region."] # [doc = ""] # [inline] pub fn region (& self) -> Rect2 { unsafe { let method_bind : * mut sys :: godot_method_bind = AtlasTextureMethodTable :: get (get_api ()) . get_region ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < Rect2 > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "If `true`, clips the area outside of the region to avoid bleeding of the surrounding texture pixels."] # [doc = ""] # [inline] pub fn has_filter_clip (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AtlasTextureMethodTable :: get (get_api ()) . has_filter_clip ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "The texture that contains the atlas. Can be any [`Texture`][Texture] subtype."] # [doc = ""] # [inline] pub fn set_atlas (& self , atlas : impl AsArg < crate :: generated :: Texture >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AtlasTextureMethodTable :: get (get_api ()) . set_atlas ; let ret = crate :: icalls :: icallvar__obj (method_bind , self . this . sys () . as_ptr () , atlas . as_arg_ptr ()) ; } } # [doc = "If `true`, clips the area outside of the region to avoid bleeding of the surrounding texture pixels."] # [doc = ""] # [inline] pub fn set_filter_clip (& self , enable : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AtlasTextureMethodTable :: get (get_api ()) . set_filter_clip ; let ret = crate :: icalls :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , enable as _) ; } } # [doc = "The margin around the region. The [`Rect2`][Rect2]'s [`Rect2.size`][Rect2::size] parameter (\"w\" and \"h\" in the editor) resizes the texture so it fits within the margin."] # [doc = ""] # [inline] pub fn set_margin (& self , margin : Rect2) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AtlasTextureMethodTable :: get (get_api ()) . set_margin ; let ret = crate :: icalls :: icallvar__rect2 (method_bind , self . this . sys () . as_ptr () , margin) ; } } # [doc = "The AtlasTexture's used region."] # [doc = ""] # [inline] pub fn set_region (& self , region : Rect2) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AtlasTextureMethodTable :: get (get_api ()) . set_region ; let ret = crate :: icalls :: icallvar__rect2 (method_bind , self . this . sys () . as_ptr () , region) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for AtlasTexture { } unsafe impl GodotObject for AtlasTexture { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AtlasTexture" } } impl std :: ops :: Deref for AtlasTexture { type Target = crate :: generated :: Texture ; # [inline] fn deref (& self) -> & crate :: generated :: Texture { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AtlasTexture { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: Texture { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: Texture > for AtlasTexture { } unsafe impl SubClass < crate :: generated :: Resource > for AtlasTexture { } unsafe impl SubClass < crate :: generated :: Reference > for AtlasTexture { } unsafe impl SubClass < crate :: generated :: Object > for AtlasTexture { } impl Instanciable for AtlasTexture { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { AtlasTexture :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AtlasTextureMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_atlas : * mut sys :: godot_method_bind , pub get_margin : * mut sys :: godot_method_bind , pub get_region : * mut sys :: godot_method_bind , pub has_filter_clip : * mut sys :: godot_method_bind , pub set_atlas : * mut sys :: godot_method_bind , pub set_filter_clip : * mut sys :: godot_method_bind , pub set_margin : * mut sys :: godot_method_bind , pub set_region : * mut sys :: godot_method_bind } impl AtlasTextureMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AtlasTextureMethodTable = AtlasTextureMethodTable { class_constructor : None , get_atlas : 0 as * mut sys :: godot_method_bind , get_margin : 0 as * mut sys :: godot_method_bind , get_region : 0 as * mut sys :: godot_method_bind , has_filter_clip : 0 as * mut sys :: godot_method_bind , set_atlas : 0 as * mut sys :: godot_method_bind , set_filter_clip : 0 as * mut sys :: godot_method_bind , set_margin : 0 as * mut sys :: godot_method_bind , set_region : 0 as * mut sys :: godot_method_bind } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { AtlasTextureMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AtlasTexture\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_atlas = (gd_api . godot_method_bind_get_method) (class_name , "get_atlas\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_region = (gd_api . godot_method_bind_get_method) (class_name , "get_region\0" . as_ptr () as * const c_char) ; table . has_filter_clip = (gd_api . godot_method_bind_get_method) (class_name , "has_filter_clip\0" . as_ptr () as * const c_char) ; table . set_atlas = (gd_api . godot_method_bind_get_method) (class_name , "set_atlas\0" . as_ptr () as * const c_char) ; table . set_filter_clip = (gd_api . godot_method_bind_get_method) (class_name , "set_filter_clip\0" . as_ptr () as * const c_char) ; table . set_margin = (gd_api . godot_method_bind_get_method) (class_name , "set_margin\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) ; } } } [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:267:3417 [INFO] [stdout] | [INFO] [stdout] 267 | ...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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 267 | # ! [doc = "This module contains types related to the API class [`AudioBusLayout`][super::AudioBusLayout]."] pub (crate) mod private { # [doc = "`core class AudioBusLayout` inherits `Resource` (reference-counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_audiobuslayout.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\nAudioBusLayout 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 `Ownership` in these types tracks whether\nownership 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 AudioBusLayout { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AudioBusLayout ; impl AudioBusLayout { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AudioBusLayoutMethodTable :: 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 AudioBusLayout { } unsafe impl GodotObject for AudioBusLayout { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AudioBusLayout" } } impl std :: ops :: Deref for AudioBusLayout { type Target = crate :: generated :: Resource ; # [inline] fn deref (& self) -> & crate :: generated :: Resource { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AudioBusLayout { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: Resource { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: Resource > for AudioBusLayout { } unsafe impl SubClass < crate :: generated :: Reference > for AudioBusLayout { } unsafe impl SubClass < crate :: generated :: Object > for AudioBusLayout { } impl Instanciable for AudioBusLayout { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { AudioBusLayout :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AudioBusLayoutMethodTable { pub class_constructor : sys :: godot_class_constructor , } impl AudioBusLayoutMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AudioBusLayoutMethodTable = AudioBusLayoutMethodTable { class_constructor : None , } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { AudioBusLayoutMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AudioBusLayout\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 [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:279:4803 [INFO] [stdout] | [INFO] [stdout] 279 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 279 | # ! [doc = "This module contains types related to the API class [`AudioEffectAmplify`][super::AudioEffectAmplify]."] pub (crate) mod private { # [doc = "`core class AudioEffectAmplify` inherits `AudioEffect` (reference-counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/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 `Ownership` in these types tracks whether\nownership 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 { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AudioEffectAmplify ; 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 , ownership :: 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 :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [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 :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , volume as _) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for AudioEffectAmplify { } unsafe impl GodotObject for AudioEffectAmplify { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AudioEffectAmplify" } } impl std :: ops :: Deref for AudioEffectAmplify { type Target = crate :: generated :: AudioEffect ; # [inline] fn deref (& self) -> & crate :: generated :: AudioEffect { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AudioEffectAmplify { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: AudioEffect { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: AudioEffect > for AudioEffectAmplify { } unsafe impl SubClass < crate :: generated :: Resource > for AudioEffectAmplify { } unsafe impl SubClass < crate :: generated :: Reference > for AudioEffectAmplify { } unsafe impl SubClass < crate :: generated :: Object > for AudioEffectAmplify { } impl Instanciable for AudioEffectAmplify { # [inline] fn construct () -> Ref < Self , ownership :: 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 } ; &raw 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 = std :: sync :: 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 [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:285:4021 [INFO] [stdout] | [INFO] [stdout] 285 | ...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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 285 | # ! [doc = "This module contains types related to the API class [`AudioEffectBandLimitFilter`][super::AudioEffectBandLimitFilter]."] pub (crate) mod private { # [doc = "`core class AudioEffectBandLimitFilter` inherits `AudioEffectFilter` (reference-counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_audioeffectbandlimitfilter.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\nAudioEffectBandLimitFilter 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 `Ownership` in these types tracks whether\nownership 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 AudioEffectBandLimitFilter { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AudioEffectBandLimitFilter ; impl AudioEffectBandLimitFilter { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AudioEffectBandLimitFilterMethodTable :: 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 AudioEffectBandLimitFilter { } unsafe impl GodotObject for AudioEffectBandLimitFilter { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AudioEffectBandLimitFilter" } } impl std :: ops :: Deref for AudioEffectBandLimitFilter { type Target = crate :: generated :: AudioEffectFilter ; # [inline] fn deref (& self) -> & crate :: generated :: AudioEffectFilter { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AudioEffectBandLimitFilter { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: AudioEffectFilter { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: AudioEffectFilter > for AudioEffectBandLimitFilter { } unsafe impl SubClass < crate :: generated :: AudioEffect > for AudioEffectBandLimitFilter { } unsafe impl SubClass < crate :: generated :: Resource > for AudioEffectBandLimitFilter { } unsafe impl SubClass < crate :: generated :: Reference > for AudioEffectBandLimitFilter { } unsafe impl SubClass < crate :: generated :: Object > for AudioEffectBandLimitFilter { } impl Instanciable for AudioEffectBandLimitFilter { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { AudioEffectBandLimitFilter :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AudioEffectBandLimitFilterMethodTable { pub class_constructor : sys :: godot_class_constructor , } impl AudioEffectBandLimitFilterMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AudioEffectBandLimitFilterMethodTable = AudioEffectBandLimitFilterMethodTable { class_constructor : None , } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { AudioEffectBandLimitFilterMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AudioEffectBandLimitFilter\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 [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:291:3996 [INFO] [stdout] | [INFO] [stdout] 291 | ...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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 291 | # ! [doc = "This module contains types related to the API class [`AudioEffectBandPassFilter`][super::AudioEffectBandPassFilter]."] pub (crate) mod private { # [doc = "`core class AudioEffectBandPassFilter` inherits `AudioEffectFilter` (reference-counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_audioeffectbandpassfilter.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\nAudioEffectBandPassFilter 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 `Ownership` in these types tracks whether\nownership 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 AudioEffectBandPassFilter { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AudioEffectBandPassFilter ; impl AudioEffectBandPassFilter { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AudioEffectBandPassFilterMethodTable :: 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 AudioEffectBandPassFilter { } unsafe impl GodotObject for AudioEffectBandPassFilter { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AudioEffectBandPassFilter" } } impl std :: ops :: Deref for AudioEffectBandPassFilter { type Target = crate :: generated :: AudioEffectFilter ; # [inline] fn deref (& self) -> & crate :: generated :: AudioEffectFilter { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AudioEffectBandPassFilter { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: AudioEffectFilter { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: AudioEffectFilter > for AudioEffectBandPassFilter { } unsafe impl SubClass < crate :: generated :: AudioEffect > for AudioEffectBandPassFilter { } unsafe impl SubClass < crate :: generated :: Resource > for AudioEffectBandPassFilter { } unsafe impl SubClass < crate :: generated :: Reference > for AudioEffectBandPassFilter { } unsafe impl SubClass < crate :: generated :: Object > for AudioEffectBandPassFilter { } impl Instanciable for AudioEffectBandPassFilter { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { AudioEffectBandPassFilter :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AudioEffectBandPassFilterMethodTable { pub class_constructor : sys :: godot_class_constructor , } impl AudioEffectBandPassFilterMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AudioEffectBandPassFilterMethodTable = AudioEffectBandPassFilterMethodTable { class_constructor : None , } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { AudioEffectBandPassFilterMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AudioEffectBandPassFilter\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 [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:297:8813 [INFO] [stdout] | [INFO] [stdout] 297 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 297 | # ! [doc = "This module contains types related to the API class [`AudioEffectCapture`][super::AudioEffectCapture]."] pub (crate) mod private { # [doc = "`core class AudioEffectCapture` inherits `AudioEffect` (reference-counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_audioeffectcapture.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\nAudioEffectCapture 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 `Ownership` in these types tracks whether\nownership 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 AudioEffectCapture { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AudioEffectCapture ; impl AudioEffectCapture { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AudioEffectCaptureMethodTable :: 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 at least `frames` audio frames are available to read in the internal ring buffer."] # [doc = ""] # [inline] pub fn can_get_buffer (& self , frames : i64) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectCaptureMethodTable :: get (get_api ()) . can_get_buffer ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , frames as _) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "Clears the internal ring buffer."] # [doc = ""] # [inline] pub fn clear_buffer (& self) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectCaptureMethodTable :: get (get_api ()) . clear_buffer ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; } } # [doc = "Gets the next `frames` audio samples from the internal ring buffer.\nReturns a [`PoolVector2Array`][PoolArray] containing exactly `frames` audio samples if available, or an empty [`PoolVector2Array`][PoolArray] if insufficient data was available."] # [doc = ""] # [inline] pub fn get_buffer (& self , frames : i64) -> PoolArray < Vector2 > { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectCaptureMethodTable :: get (get_api ()) . get_buffer ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , frames as _) ; < PoolArray < Vector2 > > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Length of the internal ring buffer, in seconds. Setting the buffer length will have no effect if already initialized."] # [doc = ""] # [inline] pub fn buffer_length (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectCaptureMethodTable :: get (get_api ()) . get_buffer_length ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Returns the total size of the internal ring buffer in frames."] # [doc = ""] # [inline] pub fn get_buffer_length_frames (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectCaptureMethodTable :: get (get_api ()) . get_buffer_length_frames ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "Returns the number of audio frames discarded from the audio bus due to full buffer."] # [doc = ""] # [inline] pub fn get_discarded_frames (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectCaptureMethodTable :: get (get_api ()) . get_discarded_frames ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "Returns the number of frames available to read using [`get_buffer`][Self::get_buffer]."] # [doc = ""] # [inline] pub fn get_frames_available (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectCaptureMethodTable :: get (get_api ()) . get_frames_available ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "Returns the number of audio frames inserted from the audio bus."] # [doc = ""] # [inline] pub fn get_pushed_frames (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectCaptureMethodTable :: get (get_api ()) . get_pushed_frames ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "Length of the internal ring buffer, in seconds. Setting the buffer length will have no effect if already initialized."] # [doc = ""] # [inline] pub fn set_buffer_length (& self , buffer_length_seconds : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectCaptureMethodTable :: get (get_api ()) . set_buffer_length ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , buffer_length_seconds as _) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for AudioEffectCapture { } unsafe impl GodotObject for AudioEffectCapture { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AudioEffectCapture" } } impl std :: ops :: Deref for AudioEffectCapture { type Target = crate :: generated :: AudioEffect ; # [inline] fn deref (& self) -> & crate :: generated :: AudioEffect { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AudioEffectCapture { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: AudioEffect { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: AudioEffect > for AudioEffectCapture { } unsafe impl SubClass < crate :: generated :: Resource > for AudioEffectCapture { } unsafe impl SubClass < crate :: generated :: Reference > for AudioEffectCapture { } unsafe impl SubClass < crate :: generated :: Object > for AudioEffectCapture { } impl Instanciable for AudioEffectCapture { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { AudioEffectCapture :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AudioEffectCaptureMethodTable { pub class_constructor : sys :: godot_class_constructor , pub can_get_buffer : * mut sys :: godot_method_bind , pub clear_buffer : * mut sys :: godot_method_bind , pub get_buffer : * mut sys :: godot_method_bind , pub get_buffer_length : * mut sys :: godot_method_bind , pub get_buffer_length_frames : * mut sys :: godot_method_bind , pub get_discarded_frames : * mut sys :: godot_method_bind , pub get_frames_available : * mut sys :: godot_method_bind , pub get_pushed_frames : * mut sys :: godot_method_bind , pub set_buffer_length : * mut sys :: godot_method_bind } impl AudioEffectCaptureMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AudioEffectCaptureMethodTable = AudioEffectCaptureMethodTable { class_constructor : None , can_get_buffer : 0 as * mut sys :: godot_method_bind , clear_buffer : 0 as * mut sys :: godot_method_bind , get_buffer : 0 as * mut sys :: godot_method_bind , get_buffer_length : 0 as * mut sys :: godot_method_bind , get_buffer_length_frames : 0 as * mut sys :: godot_method_bind , get_discarded_frames : 0 as * mut sys :: godot_method_bind , get_frames_available : 0 as * mut sys :: godot_method_bind , get_pushed_frames : 0 as * mut sys :: godot_method_bind , set_buffer_length : 0 as * mut sys :: godot_method_bind } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { AudioEffectCaptureMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AudioEffectCapture\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . can_get_buffer = (gd_api . godot_method_bind_get_method) (class_name , "can_get_buffer\0" . as_ptr () as * const c_char) ; table . clear_buffer = (gd_api . godot_method_bind_get_method) (class_name , "clear_buffer\0" . as_ptr () as * const c_char) ; table . get_buffer = (gd_api . godot_method_bind_get_method) (class_name , "get_buffer\0" . as_ptr () as * const c_char) ; table . get_buffer_length = (gd_api . godot_method_bind_get_method) (class_name , "get_buffer_length\0" . as_ptr () as * const c_char) ; table . get_buffer_length_frames = (gd_api . godot_method_bind_get_method) (class_name , "get_buffer_length_frames\0" . as_ptr () as * const c_char) ; table . get_discarded_frames = (gd_api . godot_method_bind_get_method) (class_name , "get_discarded_frames\0" . as_ptr () as * const c_char) ; table . get_frames_available = (gd_api . godot_method_bind_get_method) (class_name , "get_frames_available\0" . as_ptr () as * const c_char) ; table . get_pushed_frames = (gd_api . godot_method_bind_get_method) (class_name , "get_pushed_frames\0" . as_ptr () as * const c_char) ; table . set_buffer_length = (gd_api . godot_method_bind_get_method) (class_name , "set_buffer_length\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:303:12565 [INFO] [stdout] | [INFO] [stdout] 303 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 303 | # ! [doc = "This module contains types related to the API class [`AudioEffectChorus`][super::AudioEffectChorus]."] pub (crate) mod private { # [doc = "`core class AudioEffectChorus` inherits `AudioEffect` (reference-counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_audioeffectchorus.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\nAudioEffectChorus 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 `Ownership` in these types tracks whether\nownership 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 AudioEffectChorus { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AudioEffectChorus ; impl AudioEffectChorus { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AudioEffectChorusMethodTable :: 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 effect's raw signal."] # [doc = ""] # [inline] pub fn dry (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectChorusMethodTable :: get (get_api ()) . get_dry ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "The amount of voices in the effect."] # [doc = ""] # [inline] pub fn voice_count (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectChorusMethodTable :: get (get_api ()) . get_voice_count ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "The voice's cutoff frequency."] # [doc = ""] # [inline] pub fn voice_cutoff_hz (& self , voice_idx : i64) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectChorusMethodTable :: get (get_api ()) . get_voice_cutoff_hz ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , voice_idx as _) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "The voice's signal delay."] # [doc = ""] # [inline] pub fn voice_delay_ms (& self , voice_idx : i64) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectChorusMethodTable :: get (get_api ()) . get_voice_delay_ms ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , voice_idx as _) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "The voice filter's depth."] # [doc = ""] # [inline] pub fn voice_depth_ms (& self , voice_idx : i64) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectChorusMethodTable :: get (get_api ()) . get_voice_depth_ms ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , voice_idx as _) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "The voice's volume."] # [doc = ""] # [inline] pub fn voice_level_db (& self , voice_idx : i64) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectChorusMethodTable :: get (get_api ()) . get_voice_level_db ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , voice_idx as _) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "The voice's pan level."] # [doc = ""] # [inline] pub fn voice_pan (& self , voice_idx : i64) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectChorusMethodTable :: get (get_api ()) . get_voice_pan ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , voice_idx as _) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "The voice's filter rate."] # [doc = ""] # [inline] pub fn voice_rate_hz (& self , voice_idx : i64) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectChorusMethodTable :: get (get_api ()) . get_voice_rate_hz ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , voice_idx as _) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "The effect's processed signal."] # [doc = ""] # [inline] pub fn wet (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectChorusMethodTable :: get (get_api ()) . get_wet ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "The effect's raw signal."] # [doc = ""] # [inline] pub fn set_dry (& self , amount : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectChorusMethodTable :: get (get_api ()) . set_dry ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , amount as _) ; } } # [doc = "The amount of voices in the effect."] # [doc = ""] # [inline] pub fn set_voice_count (& self , voices : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectChorusMethodTable :: get (get_api ()) . set_voice_count ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , voices as _) ; } } # [doc = "The voice's cutoff frequency."] # [doc = ""] # [inline] pub fn set_voice_cutoff_hz (& self , voice_idx : i64 , cutoff_hz : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectChorusMethodTable :: get (get_api ()) . set_voice_cutoff_hz ; let ret = crate :: icalls :: icallvar__i64_f64 (method_bind , self . this . sys () . as_ptr () , voice_idx as _ , cutoff_hz as _) ; } } # [doc = "The voice's signal delay."] # [doc = ""] # [inline] pub fn set_voice_delay_ms (& self , voice_idx : i64 , delay_ms : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectChorusMethodTable :: get (get_api ()) . set_voice_delay_ms ; let ret = crate :: icalls :: icallvar__i64_f64 (method_bind , self . this . sys () . as_ptr () , voice_idx as _ , delay_ms as _) ; } } # [doc = "The voice filter's depth."] # [doc = ""] # [inline] pub fn set_voice_depth_ms (& self , voice_idx : i64 , depth_ms : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectChorusMethodTable :: get (get_api ()) . set_voice_depth_ms ; let ret = crate :: icalls :: icallvar__i64_f64 (method_bind , self . this . sys () . as_ptr () , voice_idx as _ , depth_ms as _) ; } } # [doc = "The voice's volume."] # [doc = ""] # [inline] pub fn set_voice_level_db (& self , voice_idx : i64 , level_db : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectChorusMethodTable :: get (get_api ()) . set_voice_level_db ; let ret = crate :: icalls :: icallvar__i64_f64 (method_bind , self . this . sys () . as_ptr () , voice_idx as _ , level_db as _) ; } } # [doc = "The voice's pan level."] # [doc = ""] # [inline] pub fn set_voice_pan (& self , voice_idx : i64 , pan : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectChorusMethodTable :: get (get_api ()) . set_voice_pan ; let ret = crate :: icalls :: icallvar__i64_f64 (method_bind , self . this . sys () . as_ptr () , voice_idx as _ , pan as _) ; } } # [doc = "The voice's filter rate."] # [doc = ""] # [inline] pub fn set_voice_rate_hz (& self , voice_idx : i64 , rate_hz : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectChorusMethodTable :: get (get_api ()) . set_voice_rate_hz ; let ret = crate :: icalls :: icallvar__i64_f64 (method_bind , self . this . sys () . as_ptr () , voice_idx as _ , rate_hz as _) ; } } # [doc = "The effect's processed signal."] # [doc = ""] # [inline] pub fn set_wet (& self , amount : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectChorusMethodTable :: get (get_api ()) . set_wet ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , amount as _) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for AudioEffectChorus { } unsafe impl GodotObject for AudioEffectChorus { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AudioEffectChorus" } } impl std :: ops :: Deref for AudioEffectChorus { type Target = crate :: generated :: AudioEffect ; # [inline] fn deref (& self) -> & crate :: generated :: AudioEffect { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AudioEffectChorus { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: AudioEffect { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: AudioEffect > for AudioEffectChorus { } unsafe impl SubClass < crate :: generated :: Resource > for AudioEffectChorus { } unsafe impl SubClass < crate :: generated :: Reference > for AudioEffectChorus { } unsafe impl SubClass < crate :: generated :: Object > for AudioEffectChorus { } impl Instanciable for AudioEffectChorus { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { AudioEffectChorus :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AudioEffectChorusMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_dry : * mut sys :: godot_method_bind , pub get_voice_count : * mut sys :: godot_method_bind , pub get_voice_cutoff_hz : * mut sys :: godot_method_bind , pub get_voice_delay_ms : * mut sys :: godot_method_bind , pub get_voice_depth_ms : * mut sys :: godot_method_bind , pub get_voice_level_db : * mut sys :: godot_method_bind , pub get_voice_pan : * mut sys :: godot_method_bind , pub get_voice_rate_hz : * mut sys :: godot_method_bind , pub get_wet : * mut sys :: godot_method_bind , pub set_dry : * mut sys :: godot_method_bind , pub set_voice_count : * mut sys :: godot_method_bind , pub set_voice_cutoff_hz : * mut sys :: godot_method_bind , pub set_voice_delay_ms : * mut sys :: godot_method_bind , pub set_voice_depth_ms : * mut sys :: godot_method_bind , pub set_voice_level_db : * mut sys :: godot_method_bind , pub set_voice_pan : * mut sys :: godot_method_bind , pub set_voice_rate_hz : * mut sys :: godot_method_bind , pub set_wet : * mut sys :: godot_method_bind } impl AudioEffectChorusMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AudioEffectChorusMethodTable = AudioEffectChorusMethodTable { class_constructor : None , get_dry : 0 as * mut sys :: godot_method_bind , get_voice_count : 0 as * mut sys :: godot_method_bind , get_voice_cutoff_hz : 0 as * mut sys :: godot_method_bind , get_voice_delay_ms : 0 as * mut sys :: godot_method_bind , get_voice_depth_ms : 0 as * mut sys :: godot_method_bind , get_voice_level_db : 0 as * mut sys :: godot_method_bind , get_voice_pan : 0 as * mut sys :: godot_method_bind , get_voice_rate_hz : 0 as * mut sys :: godot_method_bind , get_wet : 0 as * mut sys :: godot_method_bind , set_dry : 0 as * mut sys :: godot_method_bind , set_voice_count : 0 as * mut sys :: godot_method_bind , set_voice_cutoff_hz : 0 as * mut sys :: godot_method_bind , set_voice_delay_ms : 0 as * mut sys :: godot_method_bind , set_voice_depth_ms : 0 as * mut sys :: godot_method_bind , set_voice_level_db : 0 as * mut sys :: godot_method_bind , set_voice_pan : 0 as * mut sys :: godot_method_bind , set_voice_rate_hz : 0 as * mut sys :: godot_method_bind , set_wet : 0 as * mut sys :: godot_method_bind } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { AudioEffectChorusMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AudioEffectChorus\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_dry = (gd_api . godot_method_bind_get_method) (class_name , "get_dry\0" . as_ptr () as * const c_char) ; table . get_voice_count = (gd_api . godot_method_bind_get_method) (class_name , "get_voice_count\0" . as_ptr () as * const c_char) ; table . get_voice_cutoff_hz = (gd_api . godot_method_bind_get_method) (class_name , "get_voice_cutoff_hz\0" . as_ptr () as * const c_char) ; table . get_voice_delay_ms = (gd_api . godot_method_bind_get_method) (class_name , "get_voice_delay_ms\0" . as_ptr () as * const c_char) ; table . get_voice_depth_ms = (gd_api . godot_method_bind_get_method) (class_name , "get_voice_depth_ms\0" . as_ptr () as * const c_char) ; table . get_voice_level_db = (gd_api . godot_method_bind_get_method) (class_name , "get_voice_level_db\0" . as_ptr () as * const c_char) ; table . get_voice_pan = (gd_api . godot_method_bind_get_method) (class_name , "get_voice_pan\0" . as_ptr () as * const c_char) ; table . get_voice_rate_hz = (gd_api . godot_method_bind_get_method) (class_name , "get_voice_rate_hz\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_dry = (gd_api . godot_method_bind_get_method) (class_name , "set_dry\0" . as_ptr () as * const c_char) ; table . set_voice_count = (gd_api . godot_method_bind_get_method) (class_name , "set_voice_count\0" . as_ptr () as * const c_char) ; table . set_voice_cutoff_hz = (gd_api . godot_method_bind_get_method) (class_name , "set_voice_cutoff_hz\0" . as_ptr () as * const c_char) ; table . set_voice_delay_ms = (gd_api . godot_method_bind_get_method) (class_name , "set_voice_delay_ms\0" . as_ptr () as * const c_char) ; table . set_voice_depth_ms = (gd_api . godot_method_bind_get_method) (class_name , "set_voice_depth_ms\0" . as_ptr () as * const c_char) ; table . set_voice_level_db = (gd_api . godot_method_bind_get_method) (class_name , "set_voice_level_db\0" . as_ptr () as * const c_char) ; table . set_voice_pan = (gd_api . godot_method_bind_get_method) (class_name , "set_voice_pan\0" . as_ptr () as * const c_char) ; table . set_voice_rate_hz = (gd_api . godot_method_bind_get_method) (class_name , "set_voice_rate_hz\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 [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:309:11382 [INFO] [stdout] | [INFO] [stdout] 309 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 309 | # ! [doc = "This module contains types related to the API class [`AudioEffectCompressor`][super::AudioEffectCompressor]."] pub (crate) mod private { # [doc = "`core class AudioEffectCompressor` inherits `AudioEffect` (reference-counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_audioeffectcompressor.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\nAudioEffectCompressor 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 `Ownership` in these types tracks whether\nownership 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 AudioEffectCompressor { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AudioEffectCompressor ; impl AudioEffectCompressor { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AudioEffectCompressorMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "Compressor's reaction time when the signal exceeds the threshold, in microseconds. Value can range from 20 to 2000."] # [doc = ""] # [inline] pub fn attack_us (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectCompressorMethodTable :: get (get_api ()) . get_attack_us ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Gain applied to the output signal."] # [doc = ""] # [inline] pub fn gain (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectCompressorMethodTable :: get (get_api ()) . get_gain ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Balance between original signal and effect signal. Value can range from 0 (totally dry) to 1 (totally wet)."] # [doc = ""] # [inline] pub fn mix (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectCompressorMethodTable :: get (get_api ()) . get_mix ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Amount of compression applied to the audio once it passes the threshold level. The higher the ratio, the more the loud parts of the audio will be compressed. Value can range from 1 to 48."] # [doc = ""] # [inline] pub fn ratio (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectCompressorMethodTable :: get (get_api ()) . get_ratio ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Compressor's delay time to stop reducing the signal after the signal level falls below the threshold, in milliseconds. Value can range from 20 to 2000."] # [doc = ""] # [inline] pub fn release_ms (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectCompressorMethodTable :: get (get_api ()) . get_release_ms ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Reduce the sound level using another audio bus for threshold detection."] # [doc = ""] # [inline] pub fn sidechain (& self) -> GodotString { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectCompressorMethodTable :: get (get_api ()) . get_sidechain ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < GodotString > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "The level above which compression is applied to the audio. Value can range from -60 to 0."] # [doc = ""] # [inline] pub fn threshold (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectCompressorMethodTable :: get (get_api ()) . get_threshold ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Compressor's reaction time when the signal exceeds the threshold, in microseconds. Value can range from 20 to 2000."] # [doc = ""] # [inline] pub fn set_attack_us (& self , attack_us : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectCompressorMethodTable :: get (get_api ()) . set_attack_us ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , attack_us as _) ; } } # [doc = "Gain applied to the output signal."] # [doc = ""] # [inline] pub fn set_gain (& self , gain : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectCompressorMethodTable :: get (get_api ()) . set_gain ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , gain as _) ; } } # [doc = "Balance between original signal and effect signal. Value can range from 0 (totally dry) to 1 (totally wet)."] # [doc = ""] # [inline] pub fn set_mix (& self , mix : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectCompressorMethodTable :: get (get_api ()) . set_mix ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , mix as _) ; } } # [doc = "Amount of compression applied to the audio once it passes the threshold level. The higher the ratio, the more the loud parts of the audio will be compressed. Value can range from 1 to 48."] # [doc = ""] # [inline] pub fn set_ratio (& self , ratio : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectCompressorMethodTable :: get (get_api ()) . set_ratio ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , ratio as _) ; } } # [doc = "Compressor's delay time to stop reducing the signal after the signal level falls below the threshold, in milliseconds. Value can range from 20 to 2000."] # [doc = ""] # [inline] pub fn set_release_ms (& self , release_ms : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectCompressorMethodTable :: get (get_api ()) . set_release_ms ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , release_ms as _) ; } } # [doc = "Reduce the sound level using another audio bus for threshold detection."] # [doc = ""] # [inline] pub fn set_sidechain (& self , sidechain : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectCompressorMethodTable :: get (get_api ()) . set_sidechain ; let ret = crate :: icalls :: icallvar__str (method_bind , self . this . sys () . as_ptr () , sidechain . into ()) ; } } # [doc = "The level above which compression is applied to the audio. Value can range from -60 to 0."] # [doc = ""] # [inline] pub fn set_threshold (& self , threshold : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectCompressorMethodTable :: get (get_api ()) . set_threshold ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , threshold as _) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for AudioEffectCompressor { } unsafe impl GodotObject for AudioEffectCompressor { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AudioEffectCompressor" } } impl std :: ops :: Deref for AudioEffectCompressor { type Target = crate :: generated :: AudioEffect ; # [inline] fn deref (& self) -> & crate :: generated :: AudioEffect { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AudioEffectCompressor { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: AudioEffect { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: AudioEffect > for AudioEffectCompressor { } unsafe impl SubClass < crate :: generated :: Resource > for AudioEffectCompressor { } unsafe impl SubClass < crate :: generated :: Reference > for AudioEffectCompressor { } unsafe impl SubClass < crate :: generated :: Object > for AudioEffectCompressor { } impl Instanciable for AudioEffectCompressor { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { AudioEffectCompressor :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AudioEffectCompressorMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_attack_us : * mut sys :: godot_method_bind , pub get_gain : * mut sys :: godot_method_bind , pub get_mix : * mut sys :: godot_method_bind , pub get_ratio : * mut sys :: godot_method_bind , pub get_release_ms : * mut sys :: godot_method_bind , pub get_sidechain : * mut sys :: godot_method_bind , pub get_threshold : * mut sys :: godot_method_bind , pub set_attack_us : * mut sys :: godot_method_bind , pub set_gain : * mut sys :: godot_method_bind , pub set_mix : * mut sys :: godot_method_bind , pub set_ratio : * mut sys :: godot_method_bind , pub set_release_ms : * mut sys :: godot_method_bind , pub set_sidechain : * mut sys :: godot_method_bind , pub set_threshold : * mut sys :: godot_method_bind } impl AudioEffectCompressorMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AudioEffectCompressorMethodTable = AudioEffectCompressorMethodTable { class_constructor : None , get_attack_us : 0 as * mut sys :: godot_method_bind , get_gain : 0 as * mut sys :: godot_method_bind , get_mix : 0 as * mut sys :: godot_method_bind , get_ratio : 0 as * mut sys :: godot_method_bind , get_release_ms : 0 as * mut sys :: godot_method_bind , get_sidechain : 0 as * mut sys :: godot_method_bind , get_threshold : 0 as * mut sys :: godot_method_bind , set_attack_us : 0 as * mut sys :: godot_method_bind , set_gain : 0 as * mut sys :: godot_method_bind , set_mix : 0 as * mut sys :: godot_method_bind , set_ratio : 0 as * mut sys :: godot_method_bind , set_release_ms : 0 as * mut sys :: godot_method_bind , set_sidechain : 0 as * mut sys :: godot_method_bind , set_threshold : 0 as * mut sys :: godot_method_bind } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { AudioEffectCompressorMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AudioEffectCompressor\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_attack_us = (gd_api . godot_method_bind_get_method) (class_name , "get_attack_us\0" . as_ptr () as * const c_char) ; table . get_gain = (gd_api . godot_method_bind_get_method) (class_name , "get_gain\0" . as_ptr () as * const c_char) ; table . get_mix = (gd_api . godot_method_bind_get_method) (class_name , "get_mix\0" . as_ptr () as * const c_char) ; table . get_ratio = (gd_api . godot_method_bind_get_method) (class_name , "get_ratio\0" . as_ptr () as * const c_char) ; table . get_release_ms = (gd_api . godot_method_bind_get_method) (class_name , "get_release_ms\0" . as_ptr () as * const c_char) ; table . get_sidechain = (gd_api . godot_method_bind_get_method) (class_name , "get_sidechain\0" . as_ptr () as * const c_char) ; table . get_threshold = (gd_api . godot_method_bind_get_method) (class_name , "get_threshold\0" . as_ptr () as * const c_char) ; table . set_attack_us = (gd_api . godot_method_bind_get_method) (class_name , "set_attack_us\0" . as_ptr () as * const c_char) ; table . set_gain = (gd_api . godot_method_bind_get_method) (class_name , "set_gain\0" . as_ptr () as * const c_char) ; table . set_mix = (gd_api . godot_method_bind_get_method) (class_name , "set_mix\0" . as_ptr () as * const c_char) ; table . set_ratio = (gd_api . godot_method_bind_get_method) (class_name , "set_ratio\0" . as_ptr () as * const c_char) ; table . set_release_ms = (gd_api . godot_method_bind_get_method) (class_name , "set_release_ms\0" . as_ptr () as * const c_char) ; table . set_sidechain = (gd_api . godot_method_bind_get_method) (class_name , "set_sidechain\0" . as_ptr () as * const c_char) ; table . set_threshold = (gd_api . godot_method_bind_get_method) (class_name , "set_threshold\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:315:16567 [INFO] [stdout] | [INFO] [stdout] 315 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 315 | # ! [doc = "This module contains types related to the API class [`AudioEffectDelay`][super::AudioEffectDelay]."] pub (crate) mod private { # [doc = "`core class AudioEffectDelay` inherits `AudioEffect` (reference-counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_audioeffectdelay.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\nAudioEffectDelay 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 `Ownership` in these types tracks whether\nownership 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 AudioEffectDelay { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AudioEffectDelay ; impl AudioEffectDelay { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AudioEffectDelayMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "Output percent of original sound. At 0, only delayed sounds are output. Value can range from 0 to 1."] # [doc = ""] # [inline] pub fn dry (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectDelayMethodTable :: get (get_api ()) . get_dry ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Feedback delay time in milliseconds."] # [doc = ""] # [inline] pub fn feedback_delay_ms (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectDelayMethodTable :: get (get_api ()) . get_feedback_delay_ms ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Sound level for `tap1`."] # [doc = ""] # [inline] pub fn feedback_level_db (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectDelayMethodTable :: get (get_api ()) . get_feedback_level_db ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Low-pass filter for feedback, in Hz. Frequencies below this value are filtered out of the source signal."] # [doc = ""] # [inline] pub fn feedback_lowpass (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectDelayMethodTable :: get (get_api ()) . get_feedback_lowpass ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "`tap1` delay time in milliseconds."] # [doc = ""] # [inline] pub fn tap1_delay_ms (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectDelayMethodTable :: get (get_api ()) . get_tap1_delay_ms ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Sound level for `tap1`."] # [doc = ""] # [inline] pub fn tap1_level_db (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectDelayMethodTable :: get (get_api ()) . get_tap1_level_db ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Pan position for `tap1`. Value can range from -1 (fully left) to 1 (fully right)."] # [doc = ""] # [inline] pub fn tap1_pan (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectDelayMethodTable :: get (get_api ()) . get_tap1_pan ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "**Tap2** delay time in milliseconds."] # [doc = ""] # [inline] pub fn tap2_delay_ms (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectDelayMethodTable :: get (get_api ()) . get_tap2_delay_ms ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Sound level for `tap2`."] # [doc = ""] # [inline] pub fn tap2_level_db (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectDelayMethodTable :: get (get_api ()) . get_tap2_level_db ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Pan position for `tap2`. Value can range from -1 (fully left) to 1 (fully right)."] # [doc = ""] # [inline] pub fn tap2_pan (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectDelayMethodTable :: get (get_api ()) . get_tap2_pan ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "If `true`, feedback is enabled."] # [doc = ""] # [inline] pub fn is_feedback_active (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectDelayMethodTable :: get (get_api ()) . is_feedback_active ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "If `true`, `tap1` will be enabled."] # [doc = ""] # [inline] pub fn is_tap1_active (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectDelayMethodTable :: get (get_api ()) . is_tap1_active ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "If `true`, `tap2` will be enabled."] # [doc = ""] # [inline] pub fn is_tap2_active (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectDelayMethodTable :: get (get_api ()) . is_tap2_active ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "Output percent of original sound. At 0, only delayed sounds are output. 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 = AudioEffectDelayMethodTable :: get (get_api ()) . set_dry ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , amount as _) ; } } # [doc = "If `true`, feedback is enabled."] # [doc = ""] # [inline] pub fn set_feedback_active (& self , amount : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectDelayMethodTable :: get (get_api ()) . set_feedback_active ; let ret = crate :: icalls :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , amount as _) ; } } # [doc = "Feedback delay time in milliseconds."] # [doc = ""] # [inline] pub fn set_feedback_delay_ms (& self , amount : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectDelayMethodTable :: get (get_api ()) . set_feedback_delay_ms ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , amount as _) ; } } # [doc = "Sound level for `tap1`."] # [doc = ""] # [inline] pub fn set_feedback_level_db (& self , amount : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectDelayMethodTable :: get (get_api ()) . set_feedback_level_db ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , amount as _) ; } } # [doc = "Low-pass filter for feedback, in Hz. Frequencies below this value are filtered out of the source signal."] # [doc = ""] # [inline] pub fn set_feedback_lowpass (& self , amount : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectDelayMethodTable :: get (get_api ()) . set_feedback_lowpass ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , amount as _) ; } } # [doc = "If `true`, `tap1` will be enabled."] # [doc = ""] # [inline] pub fn set_tap1_active (& self , amount : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectDelayMethodTable :: get (get_api ()) . set_tap1_active ; let ret = crate :: icalls :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , amount as _) ; } } # [doc = "`tap1` delay time in milliseconds."] # [doc = ""] # [inline] pub fn set_tap1_delay_ms (& self , amount : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectDelayMethodTable :: get (get_api ()) . set_tap1_delay_ms ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , amount as _) ; } } # [doc = "Sound level for `tap1`."] # [doc = ""] # [inline] pub fn set_tap1_level_db (& self , amount : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectDelayMethodTable :: get (get_api ()) . set_tap1_level_db ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , amount as _) ; } } # [doc = "Pan position for `tap1`. Value can range from -1 (fully left) to 1 (fully right)."] # [doc = ""] # [inline] pub fn set_tap1_pan (& self , amount : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectDelayMethodTable :: get (get_api ()) . set_tap1_pan ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , amount as _) ; } } # [doc = "If `true`, `tap2` will be enabled."] # [doc = ""] # [inline] pub fn set_tap2_active (& self , amount : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectDelayMethodTable :: get (get_api ()) . set_tap2_active ; let ret = crate :: icalls :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , amount as _) ; } } # [doc = "**Tap2** delay time in milliseconds."] # [doc = ""] # [inline] pub fn set_tap2_delay_ms (& self , amount : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectDelayMethodTable :: get (get_api ()) . set_tap2_delay_ms ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , amount as _) ; } } # [doc = "Sound level for `tap2`."] # [doc = ""] # [inline] pub fn set_tap2_level_db (& self , amount : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectDelayMethodTable :: get (get_api ()) . set_tap2_level_db ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , amount as _) ; } } # [doc = "Pan position for `tap2`. Value can range from -1 (fully left) to 1 (fully right)."] # [doc = ""] # [inline] pub fn set_tap2_pan (& self , amount : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectDelayMethodTable :: get (get_api ()) . set_tap2_pan ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , amount as _) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for AudioEffectDelay { } unsafe impl GodotObject for AudioEffectDelay { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AudioEffectDelay" } } impl std :: ops :: Deref for AudioEffectDelay { type Target = crate :: generated :: AudioEffect ; # [inline] fn deref (& self) -> & crate :: generated :: AudioEffect { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AudioEffectDelay { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: AudioEffect { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: AudioEffect > for AudioEffectDelay { } unsafe impl SubClass < crate :: generated :: Resource > for AudioEffectDelay { } unsafe impl SubClass < crate :: generated :: Reference > for AudioEffectDelay { } unsafe impl SubClass < crate :: generated :: Object > for AudioEffectDelay { } impl Instanciable for AudioEffectDelay { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { AudioEffectDelay :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AudioEffectDelayMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_dry : * mut sys :: godot_method_bind , pub get_feedback_delay_ms : * mut sys :: godot_method_bind , pub get_feedback_level_db : * mut sys :: godot_method_bind , pub get_feedback_lowpass : * mut sys :: godot_method_bind , pub get_tap1_delay_ms : * mut sys :: godot_method_bind , pub get_tap1_level_db : * mut sys :: godot_method_bind , pub get_tap1_pan : * mut sys :: godot_method_bind , pub get_tap2_delay_ms : * mut sys :: godot_method_bind , pub get_tap2_level_db : * mut sys :: godot_method_bind , pub get_tap2_pan : * mut sys :: godot_method_bind , pub is_feedback_active : * mut sys :: godot_method_bind , pub is_tap1_active : * mut sys :: godot_method_bind , pub is_tap2_active : * mut sys :: godot_method_bind , pub set_dry : * mut sys :: godot_method_bind , pub set_feedback_active : * mut sys :: godot_method_bind , pub set_feedback_delay_ms : * mut sys :: godot_method_bind , pub set_feedback_level_db : * mut sys :: godot_method_bind , pub set_feedback_lowpass : * mut sys :: godot_method_bind , pub set_tap1_active : * mut sys :: godot_method_bind , pub set_tap1_delay_ms : * mut sys :: godot_method_bind , pub set_tap1_level_db : * mut sys :: godot_method_bind , pub set_tap1_pan : * mut sys :: godot_method_bind , pub set_tap2_active : * mut sys :: godot_method_bind , pub set_tap2_delay_ms : * mut sys :: godot_method_bind , pub set_tap2_level_db : * mut sys :: godot_method_bind , pub set_tap2_pan : * mut sys :: godot_method_bind } impl AudioEffectDelayMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AudioEffectDelayMethodTable = AudioEffectDelayMethodTable { class_constructor : None , get_dry : 0 as * mut sys :: godot_method_bind , get_feedback_delay_ms : 0 as * mut sys :: godot_method_bind , get_feedback_level_db : 0 as * mut sys :: godot_method_bind , get_feedback_lowpass : 0 as * mut sys :: godot_method_bind , get_tap1_delay_ms : 0 as * mut sys :: godot_method_bind , get_tap1_level_db : 0 as * mut sys :: godot_method_bind , get_tap1_pan : 0 as * mut sys :: godot_method_bind , get_tap2_delay_ms : 0 as * mut sys :: godot_method_bind , get_tap2_level_db : 0 as * mut sys :: godot_method_bind , get_tap2_pan : 0 as * mut sys :: godot_method_bind , is_feedback_active : 0 as * mut sys :: godot_method_bind , is_tap1_active : 0 as * mut sys :: godot_method_bind , is_tap2_active : 0 as * mut sys :: godot_method_bind , set_dry : 0 as * mut sys :: godot_method_bind , set_feedback_active : 0 as * mut sys :: godot_method_bind , set_feedback_delay_ms : 0 as * mut sys :: godot_method_bind , set_feedback_level_db : 0 as * mut sys :: godot_method_bind , set_feedback_lowpass : 0 as * mut sys :: godot_method_bind , set_tap1_active : 0 as * mut sys :: godot_method_bind , set_tap1_delay_ms : 0 as * mut sys :: godot_method_bind , set_tap1_level_db : 0 as * mut sys :: godot_method_bind , set_tap1_pan : 0 as * mut sys :: godot_method_bind , set_tap2_active : 0 as * mut sys :: godot_method_bind , set_tap2_delay_ms : 0 as * mut sys :: godot_method_bind , set_tap2_level_db : 0 as * mut sys :: godot_method_bind , set_tap2_pan : 0 as * mut sys :: godot_method_bind } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { AudioEffectDelayMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AudioEffectDelay\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_dry = (gd_api . godot_method_bind_get_method) (class_name , "get_dry\0" . as_ptr () as * const c_char) ; table . get_feedback_delay_ms = (gd_api . godot_method_bind_get_method) (class_name , "get_feedback_delay_ms\0" . as_ptr () as * const c_char) ; table . get_feedback_level_db = (gd_api . godot_method_bind_get_method) (class_name , "get_feedback_level_db\0" . as_ptr () as * const c_char) ; table . get_feedback_lowpass = (gd_api . godot_method_bind_get_method) (class_name , "get_feedback_lowpass\0" . as_ptr () as * const c_char) ; table . get_tap1_delay_ms = (gd_api . godot_method_bind_get_method) (class_name , "get_tap1_delay_ms\0" . as_ptr () as * const c_char) ; table . get_tap1_level_db = (gd_api . godot_method_bind_get_method) (class_name , "get_tap1_level_db\0" . as_ptr () as * const c_char) ; table . get_tap1_pan = (gd_api . godot_method_bind_get_method) (class_name , "get_tap1_pan\0" . as_ptr () as * const c_char) ; table . get_tap2_delay_ms = (gd_api . godot_method_bind_get_method) (class_name , "get_tap2_delay_ms\0" . as_ptr () as * const c_char) ; table . get_tap2_level_db = (gd_api . godot_method_bind_get_method) (class_name , "get_tap2_level_db\0" . as_ptr () as * const c_char) ; table . get_tap2_pan = (gd_api . godot_method_bind_get_method) (class_name , "get_tap2_pan\0" . as_ptr () as * const c_char) ; table . is_feedback_active = (gd_api . godot_method_bind_get_method) (class_name , "is_feedback_active\0" . as_ptr () as * const c_char) ; table . is_tap1_active = (gd_api . godot_method_bind_get_method) (class_name , "is_tap1_active\0" . as_ptr () as * const c_char) ; table . is_tap2_active = (gd_api . godot_method_bind_get_method) (class_name , "is_tap2_active\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_feedback_active = (gd_api . godot_method_bind_get_method) (class_name , "set_feedback_active\0" . as_ptr () as * const c_char) ; table . set_feedback_delay_ms = (gd_api . godot_method_bind_get_method) (class_name , "set_feedback_delay_ms\0" . as_ptr () as * const c_char) ; table . set_feedback_level_db = (gd_api . godot_method_bind_get_method) (class_name , "set_feedback_level_db\0" . as_ptr () as * const c_char) ; table . set_feedback_lowpass = (gd_api . godot_method_bind_get_method) (class_name , "set_feedback_lowpass\0" . as_ptr () as * const c_char) ; table . set_tap1_active = (gd_api . godot_method_bind_get_method) (class_name , "set_tap1_active\0" . as_ptr () as * const c_char) ; table . set_tap1_delay_ms = (gd_api . godot_method_bind_get_method) (class_name , "set_tap1_delay_ms\0" . as_ptr () as * const c_char) ; table . set_tap1_level_db = (gd_api . godot_method_bind_get_method) (class_name , "set_tap1_level_db\0" . as_ptr () as * const c_char) ; table . set_tap1_pan = (gd_api . godot_method_bind_get_method) (class_name , "set_tap1_pan\0" . as_ptr () as * const c_char) ; table . set_tap2_active = (gd_api . godot_method_bind_get_method) (class_name , "set_tap2_active\0" . as_ptr () as * const c_char) ; table . set_tap2_delay_ms = (gd_api . godot_method_bind_get_method) (class_name , "set_tap2_delay_ms\0" . as_ptr () as * const c_char) ; table . set_tap2_level_db = (gd_api . godot_method_bind_get_method) (class_name , "set_tap2_level_db\0" . as_ptr () as * const c_char) ; table . set_tap2_pan = (gd_api . godot_method_bind_get_method) (class_name , "set_tap2_pan\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:321:9944 [INFO] [stdout] | [INFO] [stdout] 321 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 321 | # ! [doc = "This module contains types related to the API class [`AudioEffectDistortion`][super::AudioEffectDistortion]."] pub (crate) mod private { # [doc = "`core class AudioEffectDistortion` inherits `AudioEffect` (reference-counted).\n\nThis class has related types in the [`audio_effect_distortion`][super::audio_effect_distortion] module."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/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 `Ownership` in these types tracks whether\nownership 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 { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AudioEffectDistortion ; # [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 } } impl FromVariant for Mode { # [inline] fn from_variant (v : & Variant) -> Result < Self , FromVariantError > { i64 :: from_variant (v) . map (Self :: from) } } # [doc = "Constants"] # [allow (non_upper_case_globals)] impl AudioEffectDistortion { pub const MODE_CLIP : i64 = 0i64 ; pub const MODE_ATAN : i64 = 1i64 ; 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 , ownership :: 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 :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [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 :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [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 :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < crate :: generated :: audio_effect_distortion :: Mode > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [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 :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [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 :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [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 :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , drive 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 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 :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , keep_hf_hz as _) ; } } # [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 :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , mode as _) ; } } # [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 :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , post_gain as _) ; } } # [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 :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , pre_gain as _) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for AudioEffectDistortion { } unsafe impl GodotObject for AudioEffectDistortion { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AudioEffectDistortion" } } impl std :: ops :: Deref for AudioEffectDistortion { type Target = crate :: generated :: AudioEffect ; # [inline] fn deref (& self) -> & crate :: generated :: AudioEffect { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AudioEffectDistortion { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: AudioEffect { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: AudioEffect > for AudioEffectDistortion { } unsafe impl SubClass < crate :: generated :: Resource > for AudioEffectDistortion { } unsafe impl SubClass < crate :: generated :: Reference > for AudioEffectDistortion { } unsafe impl SubClass < crate :: generated :: Object > for AudioEffectDistortion { } impl Instanciable for AudioEffectDistortion { # [inline] fn construct () -> Ref < Self , ownership :: 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 } ; &raw 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 = std :: sync :: 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 [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:327:5090 [INFO] [stdout] | [INFO] [stdout] 327 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 327 | # ! [doc = "This module contains types related to the API class [`AudioEffectEQ`][super::AudioEffectEQ]."] pub (crate) mod private { # [doc = "`core class AudioEffectEQ` inherits `AudioEffect` (reference-counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_audioeffecteq.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\nAudioEffectEQ 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 `Ownership` in these types tracks whether\nownership 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 AudioEffectEQ { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AudioEffectEQ ; impl AudioEffectEQ { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AudioEffectEQMethodTable :: 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 number of bands of the equalizer."] # [doc = ""] # [inline] pub fn get_band_count (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectEQMethodTable :: get (get_api ()) . get_band_count ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "Returns the band's gain at the specified index, in dB."] # [doc = ""] # [inline] pub fn get_band_gain_db (& self , band_idx : i64) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectEQMethodTable :: get (get_api ()) . get_band_gain_db ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , band_idx as _) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Sets band's gain at the specified index, in dB."] # [doc = ""] # [inline] pub fn set_band_gain_db (& self , band_idx : i64 , volume_db : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectEQMethodTable :: get (get_api ()) . set_band_gain_db ; let ret = crate :: icalls :: icallvar__i64_f64 (method_bind , self . this . sys () . as_ptr () , band_idx as _ , volume_db as _) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for AudioEffectEQ { } unsafe impl GodotObject for AudioEffectEQ { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AudioEffectEQ" } } impl std :: ops :: Deref for AudioEffectEQ { type Target = crate :: generated :: AudioEffect ; # [inline] fn deref (& self) -> & crate :: generated :: AudioEffect { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AudioEffectEQ { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: AudioEffect { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: AudioEffect > for AudioEffectEQ { } unsafe impl SubClass < crate :: generated :: Resource > for AudioEffectEQ { } unsafe impl SubClass < crate :: generated :: Reference > for AudioEffectEQ { } unsafe impl SubClass < crate :: generated :: Object > for AudioEffectEQ { } impl Instanciable for AudioEffectEQ { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { AudioEffectEQ :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AudioEffectEQMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_band_count : * mut sys :: godot_method_bind , pub get_band_gain_db : * mut sys :: godot_method_bind , pub set_band_gain_db : * mut sys :: godot_method_bind } impl AudioEffectEQMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AudioEffectEQMethodTable = AudioEffectEQMethodTable { class_constructor : None , get_band_count : 0 as * mut sys :: godot_method_bind , get_band_gain_db : 0 as * mut sys :: godot_method_bind , set_band_gain_db : 0 as * mut sys :: godot_method_bind } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { AudioEffectEQMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AudioEffectEQ\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_band_count = (gd_api . godot_method_bind_get_method) (class_name , "get_band_count\0" . as_ptr () as * const c_char) ; table . get_band_gain_db = (gd_api . godot_method_bind_get_method) (class_name , "get_band_gain_db\0" . as_ptr () as * const c_char) ; table . set_band_gain_db = (gd_api . godot_method_bind_get_method) (class_name , "set_band_gain_db\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:333:3718 [INFO] [stdout] | [INFO] [stdout] 333 | ...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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 333 | # ! [doc = "This module contains types related to the API class [`AudioEffectEQ10`][super::AudioEffectEQ10]."] pub (crate) mod private { # [doc = "`core class AudioEffectEQ10` inherits `AudioEffectEQ` (reference-counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_audioeffecteq10.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\nAudioEffectEQ10 inherits methods from:\n - [AudioEffectEQ](struct.AudioEffectEQ.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 `Ownership` in these types tracks whether\nownership 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 AudioEffectEQ10 { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AudioEffectEQ10 ; impl AudioEffectEQ10 { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AudioEffectEQ10MethodTable :: 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 AudioEffectEQ10 { } unsafe impl GodotObject for AudioEffectEQ10 { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AudioEffectEQ10" } } impl std :: ops :: Deref for AudioEffectEQ10 { type Target = crate :: generated :: AudioEffectEQ ; # [inline] fn deref (& self) -> & crate :: generated :: AudioEffectEQ { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AudioEffectEQ10 { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: AudioEffectEQ { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: AudioEffectEQ > for AudioEffectEQ10 { } unsafe impl SubClass < crate :: generated :: AudioEffect > for AudioEffectEQ10 { } unsafe impl SubClass < crate :: generated :: Resource > for AudioEffectEQ10 { } unsafe impl SubClass < crate :: generated :: Reference > for AudioEffectEQ10 { } unsafe impl SubClass < crate :: generated :: Object > for AudioEffectEQ10 { } impl Instanciable for AudioEffectEQ10 { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { AudioEffectEQ10 :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AudioEffectEQ10MethodTable { pub class_constructor : sys :: godot_class_constructor , } impl AudioEffectEQ10MethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AudioEffectEQ10MethodTable = AudioEffectEQ10MethodTable { class_constructor : None , } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { AudioEffectEQ10MethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AudioEffectEQ10\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 [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:339:3718 [INFO] [stdout] | [INFO] [stdout] 339 | ...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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 339 | # ! [doc = "This module contains types related to the API class [`AudioEffectEQ21`][super::AudioEffectEQ21]."] pub (crate) mod private { # [doc = "`core class AudioEffectEQ21` inherits `AudioEffectEQ` (reference-counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_audioeffecteq21.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\nAudioEffectEQ21 inherits methods from:\n - [AudioEffectEQ](struct.AudioEffectEQ.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 `Ownership` in these types tracks whether\nownership 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 AudioEffectEQ21 { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AudioEffectEQ21 ; impl AudioEffectEQ21 { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AudioEffectEQ21MethodTable :: 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 AudioEffectEQ21 { } unsafe impl GodotObject for AudioEffectEQ21 { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AudioEffectEQ21" } } impl std :: ops :: Deref for AudioEffectEQ21 { type Target = crate :: generated :: AudioEffectEQ ; # [inline] fn deref (& self) -> & crate :: generated :: AudioEffectEQ { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AudioEffectEQ21 { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: AudioEffectEQ { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: AudioEffectEQ > for AudioEffectEQ21 { } unsafe impl SubClass < crate :: generated :: AudioEffect > for AudioEffectEQ21 { } unsafe impl SubClass < crate :: generated :: Resource > for AudioEffectEQ21 { } unsafe impl SubClass < crate :: generated :: Reference > for AudioEffectEQ21 { } unsafe impl SubClass < crate :: generated :: Object > for AudioEffectEQ21 { } impl Instanciable for AudioEffectEQ21 { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { AudioEffectEQ21 :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AudioEffectEQ21MethodTable { pub class_constructor : sys :: godot_class_constructor , } impl AudioEffectEQ21MethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AudioEffectEQ21MethodTable = AudioEffectEQ21MethodTable { class_constructor : None , } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { AudioEffectEQ21MethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AudioEffectEQ21\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 [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:345:3693 [INFO] [stdout] | [INFO] [stdout] 345 | ...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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 345 | # ! [doc = "This module contains types related to the API class [`AudioEffectEQ6`][super::AudioEffectEQ6]."] pub (crate) mod private { # [doc = "`core class AudioEffectEQ6` inherits `AudioEffectEQ` (reference-counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_audioeffecteq6.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\nAudioEffectEQ6 inherits methods from:\n - [AudioEffectEQ](struct.AudioEffectEQ.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 `Ownership` in these types tracks whether\nownership 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 AudioEffectEQ6 { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AudioEffectEQ6 ; impl AudioEffectEQ6 { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AudioEffectEQ6MethodTable :: 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 AudioEffectEQ6 { } unsafe impl GodotObject for AudioEffectEQ6 { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AudioEffectEQ6" } } impl std :: ops :: Deref for AudioEffectEQ6 { type Target = crate :: generated :: AudioEffectEQ ; # [inline] fn deref (& self) -> & crate :: generated :: AudioEffectEQ { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AudioEffectEQ6 { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: AudioEffectEQ { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: AudioEffectEQ > for AudioEffectEQ6 { } unsafe impl SubClass < crate :: generated :: AudioEffect > for AudioEffectEQ6 { } unsafe impl SubClass < crate :: generated :: Resource > for AudioEffectEQ6 { } unsafe impl SubClass < crate :: generated :: Reference > for AudioEffectEQ6 { } unsafe impl SubClass < crate :: generated :: Object > for AudioEffectEQ6 { } impl Instanciable for AudioEffectEQ6 { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { AudioEffectEQ6 :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AudioEffectEQ6MethodTable { pub class_constructor : sys :: godot_class_constructor , } impl AudioEffectEQ6MethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AudioEffectEQ6MethodTable = AudioEffectEQ6MethodTable { class_constructor : None , } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { AudioEffectEQ6MethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AudioEffectEQ6\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 [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:351:8418 [INFO] [stdout] | [INFO] [stdout] 351 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 351 | # ! [doc = "This module contains types related to the API class [`AudioEffectFilter`][super::AudioEffectFilter]."] pub (crate) mod private { # [doc = "`core class AudioEffectFilter` inherits `AudioEffect` (reference-counted).\n\nThis class has related types in the [`audio_effect_filter`][super::audio_effect_filter] module."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_audioeffectfilter.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\nAudioEffectFilter 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 `Ownership` in these types tracks whether\nownership 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 AudioEffectFilter { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AudioEffectFilter ; # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct FilterDb (pub i64) ; impl FilterDb { pub const _6DB : FilterDb = FilterDb (0i64) ; pub const _12DB : FilterDb = FilterDb (1i64) ; pub const _18DB : FilterDb = FilterDb (2i64) ; pub const _24DB : FilterDb = FilterDb (3i64) ; } impl From < i64 > for FilterDb { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < FilterDb > for i64 { # [inline] fn from (v : FilterDb) -> Self { v . 0 } } impl FromVariant for FilterDb { # [inline] fn from_variant (v : & Variant) -> Result < Self , FromVariantError > { i64 :: from_variant (v) . map (Self :: from) } } # [doc = "Constants"] # [allow (non_upper_case_globals)] impl AudioEffectFilter { pub const FILTER_6DB : i64 = 0i64 ; pub const FILTER_12DB : i64 = 1i64 ; pub const FILTER_18DB : i64 = 2i64 ; pub const FILTER_24DB : i64 = 3i64 ; } impl AudioEffectFilter { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AudioEffectFilterMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "Threshold frequency for the filter, in Hz."] # [doc = ""] # [inline] pub fn cutoff (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectFilterMethodTable :: get (get_api ()) . get_cutoff ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = ""] # [doc = ""] # [inline] pub fn db (& self) -> crate :: generated :: audio_effect_filter :: FilterDb { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectFilterMethodTable :: get (get_api ()) . get_db ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < crate :: generated :: audio_effect_filter :: FilterDb > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Gain amount of the frequencies after the filter."] # [doc = ""] # [inline] pub fn gain (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectFilterMethodTable :: get (get_api ()) . get_gain ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Amount of boost in the frequency range near the cutoff frequency."] # [doc = ""] # [inline] pub fn resonance (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectFilterMethodTable :: get (get_api ()) . get_resonance ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Threshold frequency for the filter, in Hz."] # [doc = ""] # [inline] pub fn set_cutoff (& self , freq : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectFilterMethodTable :: get (get_api ()) . set_cutoff ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , freq as _) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn set_db (& self , amount : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectFilterMethodTable :: get (get_api ()) . set_db ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , amount as _) ; } } # [doc = "Gain amount of the frequencies after the filter."] # [doc = ""] # [inline] pub fn set_gain (& self , amount : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectFilterMethodTable :: get (get_api ()) . set_gain ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , amount as _) ; } } # [doc = "Amount of boost in the frequency range near the cutoff frequency."] # [doc = ""] # [inline] pub fn set_resonance (& self , amount : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectFilterMethodTable :: get (get_api ()) . set_resonance ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , amount as _) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for AudioEffectFilter { } unsafe impl GodotObject for AudioEffectFilter { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AudioEffectFilter" } } impl std :: ops :: Deref for AudioEffectFilter { type Target = crate :: generated :: AudioEffect ; # [inline] fn deref (& self) -> & crate :: generated :: AudioEffect { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AudioEffectFilter { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: AudioEffect { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: AudioEffect > for AudioEffectFilter { } unsafe impl SubClass < crate :: generated :: Resource > for AudioEffectFilter { } unsafe impl SubClass < crate :: generated :: Reference > for AudioEffectFilter { } unsafe impl SubClass < crate :: generated :: Object > for AudioEffectFilter { } impl Instanciable for AudioEffectFilter { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { AudioEffectFilter :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AudioEffectFilterMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_cutoff : * mut sys :: godot_method_bind , pub get_db : * mut sys :: godot_method_bind , pub get_gain : * mut sys :: godot_method_bind , pub get_resonance : * mut sys :: godot_method_bind , pub set_cutoff : * mut sys :: godot_method_bind , pub set_db : * mut sys :: godot_method_bind , pub set_gain : * mut sys :: godot_method_bind , pub set_resonance : * mut sys :: godot_method_bind } impl AudioEffectFilterMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AudioEffectFilterMethodTable = AudioEffectFilterMethodTable { class_constructor : None , get_cutoff : 0 as * mut sys :: godot_method_bind , get_db : 0 as * mut sys :: godot_method_bind , get_gain : 0 as * mut sys :: godot_method_bind , get_resonance : 0 as * mut sys :: godot_method_bind , set_cutoff : 0 as * mut sys :: godot_method_bind , set_db : 0 as * mut sys :: godot_method_bind , set_gain : 0 as * mut sys :: godot_method_bind , set_resonance : 0 as * mut sys :: godot_method_bind } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { AudioEffectFilterMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AudioEffectFilter\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_cutoff = (gd_api . godot_method_bind_get_method) (class_name , "get_cutoff\0" . as_ptr () as * const c_char) ; table . get_db = (gd_api . godot_method_bind_get_method) (class_name , "get_db\0" . as_ptr () as * const c_char) ; table . get_gain = (gd_api . godot_method_bind_get_method) (class_name , "get_gain\0" . as_ptr () as * const c_char) ; table . get_resonance = (gd_api . godot_method_bind_get_method) (class_name , "get_resonance\0" . as_ptr () as * const c_char) ; table . set_cutoff = (gd_api . godot_method_bind_get_method) (class_name , "set_cutoff\0" . as_ptr () as * const c_char) ; table . set_db = (gd_api . godot_method_bind_get_method) (class_name , "set_db\0" . as_ptr () as * const c_char) ; table . set_gain = (gd_api . godot_method_bind_get_method) (class_name , "set_gain\0" . as_ptr () as * const c_char) ; table . set_resonance = (gd_api . godot_method_bind_get_method) (class_name , "set_resonance\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:357:3996 [INFO] [stdout] | [INFO] [stdout] 357 | ...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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 357 | # ! [doc = "This module contains types related to the API class [`AudioEffectHighPassFilter`][super::AudioEffectHighPassFilter]."] pub (crate) mod private { # [doc = "`core class AudioEffectHighPassFilter` inherits `AudioEffectFilter` (reference-counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_audioeffecthighpassfilter.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\nAudioEffectHighPassFilter 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 `Ownership` in these types tracks whether\nownership 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 AudioEffectHighPassFilter { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AudioEffectHighPassFilter ; impl AudioEffectHighPassFilter { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AudioEffectHighPassFilterMethodTable :: 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 AudioEffectHighPassFilter { } unsafe impl GodotObject for AudioEffectHighPassFilter { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AudioEffectHighPassFilter" } } impl std :: ops :: Deref for AudioEffectHighPassFilter { type Target = crate :: generated :: AudioEffectFilter ; # [inline] fn deref (& self) -> & crate :: generated :: AudioEffectFilter { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AudioEffectHighPassFilter { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: AudioEffectFilter { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: AudioEffectFilter > for AudioEffectHighPassFilter { } unsafe impl SubClass < crate :: generated :: AudioEffect > for AudioEffectHighPassFilter { } unsafe impl SubClass < crate :: generated :: Resource > for AudioEffectHighPassFilter { } unsafe impl SubClass < crate :: generated :: Reference > for AudioEffectHighPassFilter { } unsafe impl SubClass < crate :: generated :: Object > for AudioEffectHighPassFilter { } impl Instanciable for AudioEffectHighPassFilter { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { AudioEffectHighPassFilter :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AudioEffectHighPassFilterMethodTable { pub class_constructor : sys :: godot_class_constructor , } impl AudioEffectHighPassFilterMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AudioEffectHighPassFilterMethodTable = AudioEffectHighPassFilterMethodTable { class_constructor : None , } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { AudioEffectHighPassFilterMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AudioEffectHighPassFilter\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 [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:363:4021 [INFO] [stdout] | [INFO] [stdout] 363 | ...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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 363 | # ! [doc = "This module contains types related to the API class [`AudioEffectHighShelfFilter`][super::AudioEffectHighShelfFilter]."] pub (crate) mod private { # [doc = "`core class AudioEffectHighShelfFilter` inherits `AudioEffectFilter` (reference-counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_audioeffecthighshelffilter.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\nAudioEffectHighShelfFilter 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 `Ownership` in these types tracks whether\nownership 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 AudioEffectHighShelfFilter { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AudioEffectHighShelfFilter ; impl AudioEffectHighShelfFilter { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AudioEffectHighShelfFilterMethodTable :: 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 AudioEffectHighShelfFilter { } unsafe impl GodotObject for AudioEffectHighShelfFilter { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AudioEffectHighShelfFilter" } } impl std :: ops :: Deref for AudioEffectHighShelfFilter { type Target = crate :: generated :: AudioEffectFilter ; # [inline] fn deref (& self) -> & crate :: generated :: AudioEffectFilter { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AudioEffectHighShelfFilter { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: AudioEffectFilter { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: AudioEffectFilter > for AudioEffectHighShelfFilter { } unsafe impl SubClass < crate :: generated :: AudioEffect > for AudioEffectHighShelfFilter { } unsafe impl SubClass < crate :: generated :: Resource > for AudioEffectHighShelfFilter { } unsafe impl SubClass < crate :: generated :: Reference > for AudioEffectHighShelfFilter { } unsafe impl SubClass < crate :: generated :: Object > for AudioEffectHighShelfFilter { } impl Instanciable for AudioEffectHighShelfFilter { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { AudioEffectHighShelfFilter :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AudioEffectHighShelfFilterMethodTable { pub class_constructor : sys :: godot_class_constructor , } impl AudioEffectHighShelfFilterMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AudioEffectHighShelfFilterMethodTable = AudioEffectHighShelfFilterMethodTable { class_constructor : None , } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { AudioEffectHighShelfFilterMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AudioEffectHighShelfFilter\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 [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:375:7796 [INFO] [stdout] | [INFO] [stdout] 375 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 375 | # ! [doc = "This module contains types related to the API class [`AudioEffectLimiter`][super::AudioEffectLimiter]."] pub (crate) mod private { # [doc = "`core class AudioEffectLimiter` inherits `AudioEffect` (reference-counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_audioeffectlimiter.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\nAudioEffectLimiter 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 `Ownership` in these types tracks whether\nownership 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 AudioEffectLimiter { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AudioEffectLimiter ; impl AudioEffectLimiter { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AudioEffectLimiterMethodTable :: 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 waveform's maximum allowed value, in decibels. Value can range from -20 to -0.1."] # [doc = ""] # [inline] pub fn ceiling_db (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectLimiterMethodTable :: get (get_api ()) . get_ceiling_db ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Applies a gain to the limited waves, in decibels. Value can range from 0 to 6."] # [doc = ""] # [inline] pub fn soft_clip_db (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectLimiterMethodTable :: get (get_api ()) . get_soft_clip_db ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = ""] # [doc = ""] # [inline] pub fn soft_clip_ratio (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectLimiterMethodTable :: get (get_api ()) . get_soft_clip_ratio ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Threshold from which the limiter begins to be active, in decibels. Value can range from -30 to 0."] # [doc = ""] # [inline] pub fn threshold_db (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectLimiterMethodTable :: get (get_api ()) . get_threshold_db ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "The waveform's maximum allowed value, in decibels. Value can range from -20 to -0.1."] # [doc = ""] # [inline] pub fn set_ceiling_db (& self , ceiling : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectLimiterMethodTable :: get (get_api ()) . set_ceiling_db ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , ceiling as _) ; } } # [doc = "Applies a gain to the limited waves, in decibels. Value can range from 0 to 6."] # [doc = ""] # [inline] pub fn set_soft_clip_db (& self , soft_clip : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectLimiterMethodTable :: get (get_api ()) . set_soft_clip_db ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , soft_clip as _) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn set_soft_clip_ratio (& self , soft_clip : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectLimiterMethodTable :: get (get_api ()) . set_soft_clip_ratio ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , soft_clip as _) ; } } # [doc = "Threshold from which the limiter begins to be active, in decibels. Value can range from -30 to 0."] # [doc = ""] # [inline] pub fn set_threshold_db (& self , threshold : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectLimiterMethodTable :: get (get_api ()) . set_threshold_db ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , threshold as _) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for AudioEffectLimiter { } unsafe impl GodotObject for AudioEffectLimiter { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AudioEffectLimiter" } } impl std :: ops :: Deref for AudioEffectLimiter { type Target = crate :: generated :: AudioEffect ; # [inline] fn deref (& self) -> & crate :: generated :: AudioEffect { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AudioEffectLimiter { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: AudioEffect { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: AudioEffect > for AudioEffectLimiter { } unsafe impl SubClass < crate :: generated :: Resource > for AudioEffectLimiter { } unsafe impl SubClass < crate :: generated :: Reference > for AudioEffectLimiter { } unsafe impl SubClass < crate :: generated :: Object > for AudioEffectLimiter { } impl Instanciable for AudioEffectLimiter { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { AudioEffectLimiter :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AudioEffectLimiterMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_ceiling_db : * mut sys :: godot_method_bind , pub get_soft_clip_db : * mut sys :: godot_method_bind , pub get_soft_clip_ratio : * mut sys :: godot_method_bind , pub get_threshold_db : * mut sys :: godot_method_bind , pub set_ceiling_db : * mut sys :: godot_method_bind , pub set_soft_clip_db : * mut sys :: godot_method_bind , pub set_soft_clip_ratio : * mut sys :: godot_method_bind , pub set_threshold_db : * mut sys :: godot_method_bind } impl AudioEffectLimiterMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AudioEffectLimiterMethodTable = AudioEffectLimiterMethodTable { class_constructor : None , get_ceiling_db : 0 as * mut sys :: godot_method_bind , get_soft_clip_db : 0 as * mut sys :: godot_method_bind , get_soft_clip_ratio : 0 as * mut sys :: godot_method_bind , get_threshold_db : 0 as * mut sys :: godot_method_bind , set_ceiling_db : 0 as * mut sys :: godot_method_bind , set_soft_clip_db : 0 as * mut sys :: godot_method_bind , set_soft_clip_ratio : 0 as * mut sys :: godot_method_bind , set_threshold_db : 0 as * mut sys :: godot_method_bind } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { AudioEffectLimiterMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AudioEffectLimiter\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_ceiling_db = (gd_api . godot_method_bind_get_method) (class_name , "get_ceiling_db\0" . as_ptr () as * const c_char) ; table . get_soft_clip_db = (gd_api . godot_method_bind_get_method) (class_name , "get_soft_clip_db\0" . as_ptr () as * const c_char) ; table . get_soft_clip_ratio = (gd_api . godot_method_bind_get_method) (class_name , "get_soft_clip_ratio\0" . as_ptr () as * const c_char) ; table . get_threshold_db = (gd_api . godot_method_bind_get_method) (class_name , "get_threshold_db\0" . as_ptr () as * const c_char) ; table . set_ceiling_db = (gd_api . godot_method_bind_get_method) (class_name , "set_ceiling_db\0" . as_ptr () as * const c_char) ; table . set_soft_clip_db = (gd_api . godot_method_bind_get_method) (class_name , "set_soft_clip_db\0" . as_ptr () as * const c_char) ; table . set_soft_clip_ratio = (gd_api . godot_method_bind_get_method) (class_name , "set_soft_clip_ratio\0" . as_ptr () as * const c_char) ; table . set_threshold_db = (gd_api . godot_method_bind_get_method) (class_name , "set_threshold_db\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:381:3971 [INFO] [stdout] | [INFO] [stdout] 381 | ...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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 381 | # ! [doc = "This module contains types related to the API class [`AudioEffectLowPassFilter`][super::AudioEffectLowPassFilter]."] pub (crate) mod private { # [doc = "`core class AudioEffectLowPassFilter` inherits `AudioEffectFilter` (reference-counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_audioeffectlowpassfilter.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\nAudioEffectLowPassFilter 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 `Ownership` in these types tracks whether\nownership 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 AudioEffectLowPassFilter { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AudioEffectLowPassFilter ; impl AudioEffectLowPassFilter { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AudioEffectLowPassFilterMethodTable :: 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 AudioEffectLowPassFilter { } unsafe impl GodotObject for AudioEffectLowPassFilter { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AudioEffectLowPassFilter" } } impl std :: ops :: Deref for AudioEffectLowPassFilter { type Target = crate :: generated :: AudioEffectFilter ; # [inline] fn deref (& self) -> & crate :: generated :: AudioEffectFilter { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AudioEffectLowPassFilter { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: AudioEffectFilter { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: AudioEffectFilter > for AudioEffectLowPassFilter { } unsafe impl SubClass < crate :: generated :: AudioEffect > for AudioEffectLowPassFilter { } unsafe impl SubClass < crate :: generated :: Resource > for AudioEffectLowPassFilter { } unsafe impl SubClass < crate :: generated :: Reference > for AudioEffectLowPassFilter { } unsafe impl SubClass < crate :: generated :: Object > for AudioEffectLowPassFilter { } impl Instanciable for AudioEffectLowPassFilter { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { AudioEffectLowPassFilter :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AudioEffectLowPassFilterMethodTable { pub class_constructor : sys :: godot_class_constructor , } impl AudioEffectLowPassFilterMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AudioEffectLowPassFilterMethodTable = AudioEffectLowPassFilterMethodTable { class_constructor : None , } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { AudioEffectLowPassFilterMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AudioEffectLowPassFilter\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 [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:387:3996 [INFO] [stdout] | [INFO] [stdout] 387 | ...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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 387 | # ! [doc = "This module contains types related to the API class [`AudioEffectLowShelfFilter`][super::AudioEffectLowShelfFilter]."] pub (crate) mod private { # [doc = "`core class AudioEffectLowShelfFilter` inherits `AudioEffectFilter` (reference-counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/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 `Ownership` in these types tracks whether\nownership 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 { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AudioEffectLowShelfFilter ; 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 , ownership :: 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 Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AudioEffectLowShelfFilter" } } impl std :: ops :: Deref for AudioEffectLowShelfFilter { type Target = crate :: generated :: AudioEffectFilter ; # [inline] fn deref (& self) -> & crate :: generated :: AudioEffectFilter { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AudioEffectLowShelfFilter { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: AudioEffectFilter { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: AudioEffectFilter > for AudioEffectLowShelfFilter { } unsafe impl SubClass < crate :: generated :: AudioEffect > for AudioEffectLowShelfFilter { } unsafe impl SubClass < crate :: generated :: Resource > for AudioEffectLowShelfFilter { } unsafe impl SubClass < crate :: generated :: Reference > for AudioEffectLowShelfFilter { } unsafe impl SubClass < crate :: generated :: Object > for AudioEffectLowShelfFilter { } impl Instanciable for AudioEffectLowShelfFilter { # [inline] fn construct () -> Ref < Self , ownership :: 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 , } ; &raw 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 = std :: sync :: 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 [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:393:3921 [INFO] [stdout] | [INFO] [stdout] 393 | ...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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 393 | # ! [doc = "This module contains types related to the API class [`AudioEffectNotchFilter`][super::AudioEffectNotchFilter]."] pub (crate) mod private { # [doc = "`core class AudioEffectNotchFilter` inherits `AudioEffectFilter` (reference-counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_audioeffectnotchfilter.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\nAudioEffectNotchFilter 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 `Ownership` in these types tracks whether\nownership 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 AudioEffectNotchFilter { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AudioEffectNotchFilter ; impl AudioEffectNotchFilter { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AudioEffectNotchFilterMethodTable :: 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 AudioEffectNotchFilter { } unsafe impl GodotObject for AudioEffectNotchFilter { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AudioEffectNotchFilter" } } impl std :: ops :: Deref for AudioEffectNotchFilter { type Target = crate :: generated :: AudioEffectFilter ; # [inline] fn deref (& self) -> & crate :: generated :: AudioEffectFilter { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AudioEffectNotchFilter { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: AudioEffectFilter { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: AudioEffectFilter > for AudioEffectNotchFilter { } unsafe impl SubClass < crate :: generated :: AudioEffect > for AudioEffectNotchFilter { } unsafe impl SubClass < crate :: generated :: Resource > for AudioEffectNotchFilter { } unsafe impl SubClass < crate :: generated :: Reference > for AudioEffectNotchFilter { } unsafe impl SubClass < crate :: generated :: Object > for AudioEffectNotchFilter { } impl Instanciable for AudioEffectNotchFilter { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { AudioEffectNotchFilter :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AudioEffectNotchFilterMethodTable { pub class_constructor : sys :: godot_class_constructor , } impl AudioEffectNotchFilterMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AudioEffectNotchFilterMethodTable = AudioEffectNotchFilterMethodTable { class_constructor : None , } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { AudioEffectNotchFilterMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AudioEffectNotchFilter\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 [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:399:4591 [INFO] [stdout] | [INFO] [stdout] 399 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 399 | # ! [doc = "This module contains types related to the API class [`AudioEffectPanner`][super::AudioEffectPanner]."] pub (crate) mod private { # [doc = "`core class AudioEffectPanner` inherits `AudioEffect` (reference-counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_audioeffectpanner.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\nAudioEffectPanner 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 `Ownership` in these types tracks whether\nownership 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 AudioEffectPanner { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AudioEffectPanner ; impl AudioEffectPanner { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AudioEffectPannerMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "Pan position. Value can range from -1 (fully left) to 1 (fully right)."] # [doc = ""] # [inline] pub fn pan (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectPannerMethodTable :: get (get_api ()) . get_pan ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Pan position. Value can range from -1 (fully left) to 1 (fully right)."] # [doc = ""] # [inline] pub fn set_pan (& self , cpanume : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectPannerMethodTable :: get (get_api ()) . set_pan ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , cpanume as _) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for AudioEffectPanner { } unsafe impl GodotObject for AudioEffectPanner { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AudioEffectPanner" } } impl std :: ops :: Deref for AudioEffectPanner { type Target = crate :: generated :: AudioEffect ; # [inline] fn deref (& self) -> & crate :: generated :: AudioEffect { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AudioEffectPanner { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: AudioEffect { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: AudioEffect > for AudioEffectPanner { } unsafe impl SubClass < crate :: generated :: Resource > for AudioEffectPanner { } unsafe impl SubClass < crate :: generated :: Reference > for AudioEffectPanner { } unsafe impl SubClass < crate :: generated :: Object > for AudioEffectPanner { } impl Instanciable for AudioEffectPanner { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { AudioEffectPanner :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AudioEffectPannerMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_pan : * mut sys :: godot_method_bind , pub set_pan : * mut sys :: godot_method_bind } impl AudioEffectPannerMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AudioEffectPannerMethodTable = AudioEffectPannerMethodTable { class_constructor : None , get_pan : 0 as * mut sys :: godot_method_bind , set_pan : 0 as * mut sys :: godot_method_bind } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { AudioEffectPannerMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AudioEffectPanner\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_pan = (gd_api . godot_method_bind_get_method) (class_name , "get_pan\0" . as_ptr () as * const c_char) ; table . set_pan = (gd_api . godot_method_bind_get_method) (class_name , "set_pan\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:405:9031 [INFO] [stdout] | [INFO] [stdout] 405 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 405 | # ! [doc = "This module contains types related to the API class [`AudioEffectPhaser`][super::AudioEffectPhaser]."] pub (crate) mod private { # [doc = "`core class AudioEffectPhaser` inherits `AudioEffect` (reference-counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/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 `Ownership` in these types tracks whether\nownership 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 { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AudioEffectPhaser ; 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 , ownership :: 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 :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [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 :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [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 :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [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 :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [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 :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [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 :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , depth as _) ; } } # [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 :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , fbk as _) ; } } # [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 :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , hz as _) ; } } # [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 :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , hz as _) ; } } # [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 :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , hz as _) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for AudioEffectPhaser { } unsafe impl GodotObject for AudioEffectPhaser { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AudioEffectPhaser" } } impl std :: ops :: Deref for AudioEffectPhaser { type Target = crate :: generated :: AudioEffect ; # [inline] fn deref (& self) -> & crate :: generated :: AudioEffect { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AudioEffectPhaser { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: AudioEffect { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: AudioEffect > for AudioEffectPhaser { } unsafe impl SubClass < crate :: generated :: Resource > for AudioEffectPhaser { } unsafe impl SubClass < crate :: generated :: Reference > for AudioEffectPhaser { } unsafe impl SubClass < crate :: generated :: Object > for AudioEffectPhaser { } impl Instanciable for AudioEffectPhaser { # [inline] fn construct () -> Ref < Self , ownership :: 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 } ; &raw 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 = std :: sync :: 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 [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:411:9000 [INFO] [stdout] | [INFO] [stdout] 411 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 411 | # ! [doc = "This module contains types related to the API class [`AudioEffectPitchShift`][super::AudioEffectPitchShift]."] pub (crate) mod private { # [doc = "`core class AudioEffectPitchShift` inherits `AudioEffect` (reference-counted).\n\nThis class has related types in the [`audio_effect_pitch_shift`][super::audio_effect_pitch_shift] module."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_audioeffectpitchshift.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\nAudioEffectPitchShift 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 `Ownership` in these types tracks whether\nownership 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 AudioEffectPitchShift { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AudioEffectPitchShift ; # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct FftSize (pub i64) ; impl FftSize { pub const _256 : FftSize = FftSize (0i64) ; pub const _512 : FftSize = FftSize (1i64) ; pub const _1024 : FftSize = FftSize (2i64) ; pub const _2048 : FftSize = FftSize (3i64) ; pub const _4096 : FftSize = FftSize (4i64) ; pub const MAX : FftSize = FftSize (5i64) ; } impl From < i64 > for FftSize { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < FftSize > for i64 { # [inline] fn from (v : FftSize) -> Self { v . 0 } } impl FromVariant for FftSize { # [inline] fn from_variant (v : & Variant) -> Result < Self , FromVariantError > { i64 :: from_variant (v) . map (Self :: from) } } # [doc = "Constants"] # [allow (non_upper_case_globals)] impl AudioEffectPitchShift { pub const FFT_SIZE_256 : i64 = 0i64 ; pub const FFT_SIZE_512 : i64 = 1i64 ; pub const FFT_SIZE_1024 : i64 = 2i64 ; pub const FFT_SIZE_2048 : i64 = 3i64 ; pub const FFT_SIZE_4096 : i64 = 4i64 ; pub const FFT_SIZE_MAX : i64 = 5i64 ; } impl AudioEffectPitchShift { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AudioEffectPitchShiftMethodTable :: 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 size of the [Fast Fourier transform](https://en.wikipedia.org/wiki/Fast_Fourier_transform) buffer. Higher values smooth out the effect over time, but have greater latency. The effects of this higher latency are especially noticeable on sounds that have sudden amplitude changes."] # [doc = ""] # [inline] pub fn fft_size (& self) -> crate :: generated :: audio_effect_pitch_shift :: FftSize { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectPitchShiftMethodTable :: get (get_api ()) . get_fft_size ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < crate :: generated :: audio_effect_pitch_shift :: FftSize > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "The oversampling factor to use. Higher values result in better quality, but are more demanding on the CPU and may cause audio cracking if the CPU can't keep up."] # [doc = ""] # [inline] pub fn oversampling (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectPitchShiftMethodTable :: get (get_api ()) . get_oversampling ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "The pitch scale to use. `1.0` is the default pitch and plays sounds unaltered. [`pitch_scale`][Self::pitch_scale] can range from `0.0` (infinitely low pitch, inaudible) to `16` (16 times higher than the initial pitch)."] # [doc = ""] # [inline] pub fn pitch_scale (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectPitchShiftMethodTable :: get (get_api ()) . get_pitch_scale ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "The size of the [Fast Fourier transform](https://en.wikipedia.org/wiki/Fast_Fourier_transform) buffer. Higher values smooth out the effect over time, but have greater latency. The effects of this higher latency are especially noticeable on sounds that have sudden amplitude changes."] # [doc = ""] # [inline] pub fn set_fft_size (& self , size : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectPitchShiftMethodTable :: get (get_api ()) . set_fft_size ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , size as _) ; } } # [doc = "The oversampling factor to use. Higher values result in better quality, but are more demanding on the CPU and may cause audio cracking if the CPU can't keep up."] # [doc = ""] # [inline] pub fn set_oversampling (& self , amount : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectPitchShiftMethodTable :: get (get_api ()) . set_oversampling ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , amount as _) ; } } # [doc = "The pitch scale to use. `1.0` is the default pitch and plays sounds unaltered. [`pitch_scale`][Self::pitch_scale] can range from `0.0` (infinitely low pitch, inaudible) to `16` (16 times higher than the initial pitch)."] # [doc = ""] # [inline] pub fn set_pitch_scale (& self , rate : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectPitchShiftMethodTable :: get (get_api ()) . set_pitch_scale ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , rate as _) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for AudioEffectPitchShift { } unsafe impl GodotObject for AudioEffectPitchShift { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AudioEffectPitchShift" } } impl std :: ops :: Deref for AudioEffectPitchShift { type Target = crate :: generated :: AudioEffect ; # [inline] fn deref (& self) -> & crate :: generated :: AudioEffect { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AudioEffectPitchShift { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: AudioEffect { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: AudioEffect > for AudioEffectPitchShift { } unsafe impl SubClass < crate :: generated :: Resource > for AudioEffectPitchShift { } unsafe impl SubClass < crate :: generated :: Reference > for AudioEffectPitchShift { } unsafe impl SubClass < crate :: generated :: Object > for AudioEffectPitchShift { } impl Instanciable for AudioEffectPitchShift { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { AudioEffectPitchShift :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AudioEffectPitchShiftMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_fft_size : * mut sys :: godot_method_bind , pub get_oversampling : * mut sys :: godot_method_bind , pub get_pitch_scale : * mut sys :: godot_method_bind , pub set_fft_size : * mut sys :: godot_method_bind , pub set_oversampling : * mut sys :: godot_method_bind , pub set_pitch_scale : * mut sys :: godot_method_bind } impl AudioEffectPitchShiftMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AudioEffectPitchShiftMethodTable = AudioEffectPitchShiftMethodTable { class_constructor : None , get_fft_size : 0 as * mut sys :: godot_method_bind , get_oversampling : 0 as * mut sys :: godot_method_bind , get_pitch_scale : 0 as * mut sys :: godot_method_bind , set_fft_size : 0 as * mut sys :: godot_method_bind , set_oversampling : 0 as * mut sys :: godot_method_bind , set_pitch_scale : 0 as * mut sys :: godot_method_bind } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { AudioEffectPitchShiftMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AudioEffectPitchShift\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_fft_size = (gd_api . godot_method_bind_get_method) (class_name , "get_fft_size\0" . as_ptr () as * const c_char) ; table . get_oversampling = (gd_api . godot_method_bind_get_method) (class_name , "get_oversampling\0" . as_ptr () as * const c_char) ; table . get_pitch_scale = (gd_api . godot_method_bind_get_method) (class_name , "get_pitch_scale\0" . as_ptr () as * const c_char) ; table . set_fft_size = (gd_api . godot_method_bind_get_method) (class_name , "set_fft_size\0" . as_ptr () as * const c_char) ; table . set_oversampling = (gd_api . godot_method_bind_get_method) (class_name , "set_oversampling\0" . as_ptr () as * const c_char) ; table . set_pitch_scale = (gd_api . godot_method_bind_get_method) (class_name , "set_pitch_scale\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:417:6587 [INFO] [stdout] | [INFO] [stdout] 417 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 417 | # ! [doc = "This module contains types related to the API class [`AudioEffectRecord`][super::AudioEffectRecord]."] pub (crate) mod private { # [doc = "`core class AudioEffectRecord` inherits `AudioEffect` (reference-counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_audioeffectrecord.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\nAudioEffectRecord 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 `Ownership` in these types tracks whether\nownership 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 AudioEffectRecord { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AudioEffectRecord ; impl AudioEffectRecord { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AudioEffectRecordMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "Specifies the format in which the sample will be recorded. See [enum AudioStreamSample.Format] for available formats."] # [doc = ""] # [inline] pub fn format (& self) -> crate :: generated :: audio_stream_sample :: Format { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectRecordMethodTable :: get (get_api ()) . get_format ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < crate :: generated :: audio_stream_sample :: Format > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns the recorded sample."] # [doc = ""] # [inline] pub fn get_recording (& self) -> Option < Ref < crate :: generated :: AudioStreamSample , ownership :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectRecordMethodTable :: get (get_api ()) . get_recording ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < Option < Ref < crate :: generated :: AudioStreamSample , ownership :: Shared > > > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns whether the recording is active or not."] # [doc = ""] # [inline] pub fn is_recording_active (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectRecordMethodTable :: get (get_api ()) . is_recording_active ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "Specifies the format in which the sample will be recorded. See [enum AudioStreamSample.Format] for available formats."] # [doc = ""] # [inline] pub fn set_format (& self , format : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectRecordMethodTable :: get (get_api ()) . set_format ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , format as _) ; } } # [doc = "If `true`, the sound will be recorded. Note that restarting the recording will remove the previously recorded sample."] # [doc = ""] # [inline] pub fn set_recording_active (& self , record : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectRecordMethodTable :: get (get_api ()) . set_recording_active ; let ret = crate :: icalls :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , record as _) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for AudioEffectRecord { } unsafe impl GodotObject for AudioEffectRecord { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AudioEffectRecord" } } impl std :: ops :: Deref for AudioEffectRecord { type Target = crate :: generated :: AudioEffect ; # [inline] fn deref (& self) -> & crate :: generated :: AudioEffect { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AudioEffectRecord { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: AudioEffect { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: AudioEffect > for AudioEffectRecord { } unsafe impl SubClass < crate :: generated :: Resource > for AudioEffectRecord { } unsafe impl SubClass < crate :: generated :: Reference > for AudioEffectRecord { } unsafe impl SubClass < crate :: generated :: Object > for AudioEffectRecord { } impl Instanciable for AudioEffectRecord { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { AudioEffectRecord :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AudioEffectRecordMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_format : * mut sys :: godot_method_bind , pub get_recording : * mut sys :: godot_method_bind , pub is_recording_active : * mut sys :: godot_method_bind , pub set_format : * mut sys :: godot_method_bind , pub set_recording_active : * mut sys :: godot_method_bind } impl AudioEffectRecordMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AudioEffectRecordMethodTable = AudioEffectRecordMethodTable { class_constructor : None , get_format : 0 as * mut sys :: godot_method_bind , get_recording : 0 as * mut sys :: godot_method_bind , is_recording_active : 0 as * mut sys :: godot_method_bind , set_format : 0 as * mut sys :: godot_method_bind , set_recording_active : 0 as * mut sys :: godot_method_bind } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { AudioEffectRecordMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AudioEffectRecord\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_format = (gd_api . godot_method_bind_get_method) (class_name , "get_format\0" . as_ptr () as * const c_char) ; table . get_recording = (gd_api . godot_method_bind_get_method) (class_name , "get_recording\0" . as_ptr () as * const c_char) ; table . is_recording_active = (gd_api . godot_method_bind_get_method) (class_name , "is_recording_active\0" . as_ptr () as * const c_char) ; table . set_format = (gd_api . godot_method_bind_get_method) (class_name , "set_format\0" . as_ptr () as * const c_char) ; table . set_recording_active = (gd_api . godot_method_bind_get_method) (class_name , "set_recording_active\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:423:12166 [INFO] [stdout] | [INFO] [stdout] 423 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 423 | # ! [doc = "This module contains types related to the API class [`AudioEffectReverb`][super::AudioEffectReverb]."] pub (crate) mod private { # [doc = "`core class AudioEffectReverb` inherits `AudioEffect` (reference-counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/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 `Ownership` in these types tracks whether\nownership 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 { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AudioEffectReverb ; 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 , ownership :: 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 :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [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 :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [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 :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [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 :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [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 :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [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 :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [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 :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [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 :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [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 :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , amount 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 set_dry (& self , amount : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectReverbMethodTable :: get (get_api ()) . set_dry ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , amount 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 set_hpf (& self , amount : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectReverbMethodTable :: get (get_api ()) . set_hpf ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , amount as _) ; } } # [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 :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , feedback as _) ; } } # [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 :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , msec as _) ; } } # [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 :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , size 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 set_spread (& self , amount : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectReverbMethodTable :: get (get_api ()) . set_spread ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , amount 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 set_wet (& self , amount : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectReverbMethodTable :: get (get_api ()) . set_wet ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , amount as _) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for AudioEffectReverb { } unsafe impl GodotObject for AudioEffectReverb { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AudioEffectReverb" } } impl std :: ops :: Deref for AudioEffectReverb { type Target = crate :: generated :: AudioEffect ; # [inline] fn deref (& self) -> & crate :: generated :: AudioEffect { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AudioEffectReverb { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: AudioEffect { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: AudioEffect > for AudioEffectReverb { } unsafe impl SubClass < crate :: generated :: Resource > for AudioEffectReverb { } unsafe impl SubClass < crate :: generated :: Reference > for AudioEffectReverb { } unsafe impl SubClass < crate :: generated :: Object > for AudioEffectReverb { } impl Instanciable for AudioEffectReverb { # [inline] fn construct () -> Ref < Self , ownership :: 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 } ; &raw 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 = std :: sync :: 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 [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:429:8698 [INFO] [stdout] | [INFO] [stdout] 429 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 429 | # ! [doc = "This module contains types related to the API class [`AudioEffectSpectrumAnalyzer`][super::AudioEffectSpectrumAnalyzer]."] pub (crate) mod private { # [doc = "`core class AudioEffectSpectrumAnalyzer` inherits `AudioEffect` (reference-counted).\n\nThis class has related types in the [`audio_effect_spectrum_analyzer`][super::audio_effect_spectrum_analyzer] module."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_audioeffectspectrumanalyzer.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\nAudioEffectSpectrumAnalyzer 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 `Ownership` in these types tracks whether\nownership 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 AudioEffectSpectrumAnalyzer { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AudioEffectSpectrumAnalyzer ; # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct FftSize (pub i64) ; impl FftSize { pub const _256 : FftSize = FftSize (0i64) ; pub const _512 : FftSize = FftSize (1i64) ; pub const _1024 : FftSize = FftSize (2i64) ; pub const _2048 : FftSize = FftSize (3i64) ; pub const _4096 : FftSize = FftSize (4i64) ; pub const MAX : FftSize = FftSize (5i64) ; } impl From < i64 > for FftSize { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < FftSize > for i64 { # [inline] fn from (v : FftSize) -> Self { v . 0 } } impl FromVariant for FftSize { # [inline] fn from_variant (v : & Variant) -> Result < Self , FromVariantError > { i64 :: from_variant (v) . map (Self :: from) } } # [doc = "Constants"] # [allow (non_upper_case_globals)] impl AudioEffectSpectrumAnalyzer { pub const FFT_SIZE_256 : i64 = 0i64 ; pub const FFT_SIZE_512 : i64 = 1i64 ; pub const FFT_SIZE_1024 : i64 = 2i64 ; pub const FFT_SIZE_2048 : i64 = 3i64 ; pub const FFT_SIZE_4096 : i64 = 4i64 ; pub const FFT_SIZE_MAX : i64 = 5i64 ; } impl AudioEffectSpectrumAnalyzer { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AudioEffectSpectrumAnalyzerMethodTable :: 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 length of the buffer to keep (in seconds). Higher values keep data around for longer, but require more memory."] # [doc = ""] # [inline] pub fn buffer_length (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectSpectrumAnalyzerMethodTable :: get (get_api ()) . get_buffer_length ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "The size of the [Fast Fourier transform](https://en.wikipedia.org/wiki/Fast_Fourier_transform) buffer. Higher values smooth out the spectrum analysis over time, but have greater latency. The effects of this higher latency are especially noticeable with sudden amplitude changes."] # [doc = ""] # [inline] pub fn fft_size (& self) -> crate :: generated :: audio_effect_spectrum_analyzer :: FftSize { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectSpectrumAnalyzerMethodTable :: get (get_api ()) . get_fft_size ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < crate :: generated :: audio_effect_spectrum_analyzer :: FftSize > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = ""] # [doc = ""] # [inline] pub fn tap_back_pos (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectSpectrumAnalyzerMethodTable :: get (get_api ()) . get_tap_back_pos ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "The length of the buffer to keep (in seconds). Higher values keep data around for longer, but require more memory."] # [doc = ""] # [inline] pub fn set_buffer_length (& self , seconds : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectSpectrumAnalyzerMethodTable :: get (get_api ()) . set_buffer_length ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , seconds as _) ; } } # [doc = "The size of the [Fast Fourier transform](https://en.wikipedia.org/wiki/Fast_Fourier_transform) buffer. Higher values smooth out the spectrum analysis over time, but have greater latency. The effects of this higher latency are especially noticeable with sudden amplitude changes."] # [doc = ""] # [inline] pub fn set_fft_size (& self , size : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectSpectrumAnalyzerMethodTable :: get (get_api ()) . set_fft_size ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , size as _) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn set_tap_back_pos (& self , seconds : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectSpectrumAnalyzerMethodTable :: get (get_api ()) . set_tap_back_pos ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , seconds as _) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for AudioEffectSpectrumAnalyzer { } unsafe impl GodotObject for AudioEffectSpectrumAnalyzer { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AudioEffectSpectrumAnalyzer" } } impl std :: ops :: Deref for AudioEffectSpectrumAnalyzer { type Target = crate :: generated :: AudioEffect ; # [inline] fn deref (& self) -> & crate :: generated :: AudioEffect { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AudioEffectSpectrumAnalyzer { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: AudioEffect { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: AudioEffect > for AudioEffectSpectrumAnalyzer { } unsafe impl SubClass < crate :: generated :: Resource > for AudioEffectSpectrumAnalyzer { } unsafe impl SubClass < crate :: generated :: Reference > for AudioEffectSpectrumAnalyzer { } unsafe impl SubClass < crate :: generated :: Object > for AudioEffectSpectrumAnalyzer { } impl Instanciable for AudioEffectSpectrumAnalyzer { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { AudioEffectSpectrumAnalyzer :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AudioEffectSpectrumAnalyzerMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_buffer_length : * mut sys :: godot_method_bind , pub get_fft_size : * mut sys :: godot_method_bind , pub get_tap_back_pos : * mut sys :: godot_method_bind , pub set_buffer_length : * mut sys :: godot_method_bind , pub set_fft_size : * mut sys :: godot_method_bind , pub set_tap_back_pos : * mut sys :: godot_method_bind } impl AudioEffectSpectrumAnalyzerMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AudioEffectSpectrumAnalyzerMethodTable = AudioEffectSpectrumAnalyzerMethodTable { class_constructor : None , get_buffer_length : 0 as * mut sys :: godot_method_bind , get_fft_size : 0 as * mut sys :: godot_method_bind , get_tap_back_pos : 0 as * mut sys :: godot_method_bind , set_buffer_length : 0 as * mut sys :: godot_method_bind , set_fft_size : 0 as * mut sys :: godot_method_bind , set_tap_back_pos : 0 as * mut sys :: godot_method_bind } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { AudioEffectSpectrumAnalyzerMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AudioEffectSpectrumAnalyzer\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_buffer_length = (gd_api . godot_method_bind_get_method) (class_name , "get_buffer_length\0" . as_ptr () as * const c_char) ; table . get_fft_size = (gd_api . godot_method_bind_get_method) (class_name , "get_fft_size\0" . as_ptr () as * const c_char) ; table . get_tap_back_pos = (gd_api . godot_method_bind_get_method) (class_name , "get_tap_back_pos\0" . as_ptr () as * const c_char) ; table . set_buffer_length = (gd_api . godot_method_bind_get_method) (class_name , "set_buffer_length\0" . as_ptr () as * const c_char) ; table . set_fft_size = (gd_api . godot_method_bind_get_method) (class_name , "set_fft_size\0" . as_ptr () as * const c_char) ; table . set_tap_back_pos = (gd_api . godot_method_bind_get_method) (class_name , "set_tap_back_pos\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:435:4962 [INFO] [stdout] | [INFO] [stdout] 435 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 435 | # ! [doc = "This module contains types related to the API class [`AudioEffectSpectrumAnalyzerInstance`][super::AudioEffectSpectrumAnalyzerInstance]."] pub (crate) mod private { # [doc = "`core class AudioEffectSpectrumAnalyzerInstance` inherits `AudioEffectInstance` (reference-counted).\n\nThis class has related types in the [`audio_effect_spectrum_analyzer_instance`][super::audio_effect_spectrum_analyzer_instance] module."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_audioeffectspectrumanalyzerinstance.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\nAudioEffectSpectrumAnalyzerInstance inherits methods from:\n - [AudioEffectInstance](struct.AudioEffectInstance.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 `Ownership` in these types tracks whether\nownership 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 AudioEffectSpectrumAnalyzerInstance { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AudioEffectSpectrumAnalyzerInstance ; # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct MagnitudeMode (pub i64) ; impl MagnitudeMode { pub const AVERAGE : MagnitudeMode = MagnitudeMode (0i64) ; pub const MAX : MagnitudeMode = MagnitudeMode (1i64) ; } impl From < i64 > for MagnitudeMode { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < MagnitudeMode > for i64 { # [inline] fn from (v : MagnitudeMode) -> Self { v . 0 } } impl FromVariant for MagnitudeMode { # [inline] fn from_variant (v : & Variant) -> Result < Self , FromVariantError > { i64 :: from_variant (v) . map (Self :: from) } } # [doc = "Constants"] # [allow (non_upper_case_globals)] impl AudioEffectSpectrumAnalyzerInstance { pub const MAGNITUDE_AVERAGE : i64 = 0i64 ; pub const MAGNITUDE_MAX : i64 = 1i64 ; } impl AudioEffectSpectrumAnalyzerInstance { # [doc = "\n# Default Arguments\n* `mode` - `1`"] # [doc = ""] # [inline] pub fn get_magnitude_for_frequency_range (& self , from_hz : f64 , to_hz : f64 , mode : i64) -> Vector2 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectSpectrumAnalyzerInstanceMethodTable :: get (get_api ()) . get_magnitude_for_frequency_range ; let ret = crate :: icalls :: icallvar__f64_f64_i64 (method_bind , self . this . sys () . as_ptr () , from_hz as _ , to_hz as _ , mode as _) ; < Vector2 > :: from_variant (& ret) . expect ("Unexpected variant type") } } } impl gdnative_core :: private :: godot_object :: Sealed for AudioEffectSpectrumAnalyzerInstance { } unsafe impl GodotObject for AudioEffectSpectrumAnalyzerInstance { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AudioEffectSpectrumAnalyzerInstance" } } impl std :: ops :: Deref for AudioEffectSpectrumAnalyzerInstance { type Target = crate :: generated :: AudioEffectInstance ; # [inline] fn deref (& self) -> & crate :: generated :: AudioEffectInstance { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AudioEffectSpectrumAnalyzerInstance { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: AudioEffectInstance { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: AudioEffectInstance > for AudioEffectSpectrumAnalyzerInstance { } unsafe impl SubClass < crate :: generated :: Reference > for AudioEffectSpectrumAnalyzerInstance { } unsafe impl SubClass < crate :: generated :: Object > for AudioEffectSpectrumAnalyzerInstance { } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AudioEffectSpectrumAnalyzerInstanceMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_magnitude_for_frequency_range : * mut sys :: godot_method_bind } impl AudioEffectSpectrumAnalyzerInstanceMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AudioEffectSpectrumAnalyzerInstanceMethodTable = AudioEffectSpectrumAnalyzerInstanceMethodTable { class_constructor : None , get_magnitude_for_frequency_range : 0 as * mut sys :: godot_method_bind } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { AudioEffectSpectrumAnalyzerInstanceMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AudioEffectSpectrumAnalyzerInstance\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_magnitude_for_frequency_range = (gd_api . godot_method_bind_get_method) (class_name , "get_magnitude_for_frequency_range\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:441:6489 [INFO] [stdout] | [INFO] [stdout] 441 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 441 | # ! [doc = "This module contains types related to the API class [`AudioEffectStereoEnhance`][super::AudioEffectStereoEnhance]."] pub (crate) mod private { # [doc = "`core class AudioEffectStereoEnhance` inherits `AudioEffect` (reference-counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_audioeffectstereoenhance.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\nAudioEffectStereoEnhance 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 `Ownership` in these types tracks whether\nownership 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 AudioEffectStereoEnhance { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AudioEffectStereoEnhance ; impl AudioEffectStereoEnhance { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AudioEffectStereoEnhanceMethodTable :: 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 pan_pullout (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectStereoEnhanceMethodTable :: get (get_api ()) . get_pan_pullout ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = ""] # [doc = ""] # [inline] pub fn surround (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectStereoEnhanceMethodTable :: get (get_api ()) . get_surround ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = ""] # [doc = ""] # [inline] pub fn time_pullout (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectStereoEnhanceMethodTable :: get (get_api ()) . get_time_pullout ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = ""] # [doc = ""] # [inline] pub fn set_pan_pullout (& self , amount : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectStereoEnhanceMethodTable :: get (get_api ()) . set_pan_pullout ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , amount as _) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn set_surround (& self , amount : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectStereoEnhanceMethodTable :: get (get_api ()) . set_surround ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , amount as _) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn set_time_pullout (& self , amount : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioEffectStereoEnhanceMethodTable :: get (get_api ()) . set_time_pullout ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , amount as _) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for AudioEffectStereoEnhance { } unsafe impl GodotObject for AudioEffectStereoEnhance { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AudioEffectStereoEnhance" } } impl std :: ops :: Deref for AudioEffectStereoEnhance { type Target = crate :: generated :: AudioEffect ; # [inline] fn deref (& self) -> & crate :: generated :: AudioEffect { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AudioEffectStereoEnhance { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: AudioEffect { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: AudioEffect > for AudioEffectStereoEnhance { } unsafe impl SubClass < crate :: generated :: Resource > for AudioEffectStereoEnhance { } unsafe impl SubClass < crate :: generated :: Reference > for AudioEffectStereoEnhance { } unsafe impl SubClass < crate :: generated :: Object > for AudioEffectStereoEnhance { } impl Instanciable for AudioEffectStereoEnhance { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { AudioEffectStereoEnhance :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AudioEffectStereoEnhanceMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_pan_pullout : * mut sys :: godot_method_bind , pub get_surround : * mut sys :: godot_method_bind , pub get_time_pullout : * mut sys :: godot_method_bind , pub set_pan_pullout : * mut sys :: godot_method_bind , pub set_surround : * mut sys :: godot_method_bind , pub set_time_pullout : * mut sys :: godot_method_bind } impl AudioEffectStereoEnhanceMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AudioEffectStereoEnhanceMethodTable = AudioEffectStereoEnhanceMethodTable { class_constructor : None , get_pan_pullout : 0 as * mut sys :: godot_method_bind , get_surround : 0 as * mut sys :: godot_method_bind , get_time_pullout : 0 as * mut sys :: godot_method_bind , set_pan_pullout : 0 as * mut sys :: godot_method_bind , set_surround : 0 as * mut sys :: godot_method_bind , set_time_pullout : 0 as * mut sys :: godot_method_bind } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { AudioEffectStereoEnhanceMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AudioEffectStereoEnhance\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_pan_pullout = (gd_api . godot_method_bind_get_method) (class_name , "get_pan_pullout\0" . as_ptr () as * const c_char) ; table . get_surround = (gd_api . godot_method_bind_get_method) (class_name , "get_surround\0" . as_ptr () as * const c_char) ; table . get_time_pullout = (gd_api . godot_method_bind_get_method) (class_name , "get_time_pullout\0" . as_ptr () as * const c_char) ; table . set_pan_pullout = (gd_api . godot_method_bind_get_method) (class_name , "set_pan_pullout\0" . as_ptr () as * const c_char) ; table . set_surround = (gd_api . godot_method_bind_get_method) (class_name , "set_surround\0" . as_ptr () as * const c_char) ; table . set_time_pullout = (gd_api . godot_method_bind_get_method) (class_name , "set_time_pullout\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:447:31901 [INFO] [stdout] | [INFO] [stdout] 447 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 447 | # ! [doc = "This module contains types related to the API class [`AudioServer`][super::AudioServer]."] pub (crate) mod private { # [doc = "`core singleton class AudioServer` inherits `Object` (manually managed).\n\nThis class has related types in the [`audio_server`][super::audio_server] module."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/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 `Ownership` in these types tracks whether\nownership 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 { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AudioServer ; # [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 } } impl FromVariant for SpeakerMode { # [inline] fn from_variant (v : & Variant) -> Result < Self , FromVariantError > { i64 :: from_variant (v) . map (Self :: from) } } # [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 :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , at_position as _) ; } } # [doc = "Adds an [`AudioEffect`][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 :: AudioEffect > , at_position : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioServerMethodTable :: get (get_api ()) . add_bus_effect ; let ret = crate :: icalls :: icallvar__i64_obj_i64 (method_bind , self . this . sys () . as_ptr () , bus_idx as _ , effect . as_arg_ptr () , at_position as _) ; } } # [doc = "Name of the current device for audio input (see [`capture_get_device_list`][Self::capture_get_device_list]). On systems with multiple audio inputs (such as analog, USB and HDMI audio), this can be used to select the audio input device. The value `\"Default\"` will record audio on the system-wide default audio input. If an invalid device name is set, the value will be reverted back to `\"Default\"`.\n**Note:** [member ProjectSettings.audio/enable_audio_input] must be `true` for audio input to work. See also that setting's description for caveats related to permissions and operating system privacy settings."] # [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 :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < GodotString > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns the names of all audio input devices detected on the system.\n**Note:** [member ProjectSettings.audio/enable_audio_input] must be `true` for audio input to work. See also that setting's description for caveats related to permissions and operating system privacy settings."] # [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 = "Name of the current device for audio input (see [`capture_get_device_list`][Self::capture_get_device_list]). On systems with multiple audio inputs (such as analog, USB and HDMI audio), this can be used to select the audio input device. The value `\"Default\"` will record audio on the system-wide default audio input. If an invalid device name is set, the value will be reverted back to `\"Default\"`.\n**Note:** [member ProjectSettings.audio/enable_audio_input] must be `true` for audio input to work. See also that setting's description for caveats related to permissions and operating system privacy settings."] # [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 :: icallvar__str (method_bind , self . this . sys () . as_ptr () , name . into ()) ; } } # [doc = "Generates an [`AudioBusLayout`][AudioBusLayout] using the available buses and effects."] # [doc = ""] # [inline] pub fn generate_bus_layout (& self) -> Option < Ref < crate :: generated :: AudioBusLayout , ownership :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioServerMethodTable :: get (get_api ()) . generate_bus_layout ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < Option < Ref < crate :: generated :: AudioBusLayout , ownership :: Shared > > > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [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 :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , bus_idx as _) ; < i64 > :: coerce_from_variant (& ret) } } # [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 :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "Returns the [`AudioEffect`][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 :: AudioEffect , ownership :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioServerMethodTable :: get (get_api ()) . get_bus_effect ; let ret = crate :: icalls :: icallvar__i64_i64 (method_bind , self . this . sys () . as_ptr () , bus_idx as _ , effect_idx as _) ; < Option < Ref < crate :: generated :: AudioEffect , ownership :: Shared > > > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [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 :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , bus_idx as _) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "Returns the [`AudioEffectInstance`][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 :: AudioEffectInstance , ownership :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioServerMethodTable :: get (get_api ()) . get_bus_effect_instance ; let ret = crate :: icalls :: icallvar__i64_i64_i64 (method_bind , self . this . sys () . as_ptr () , bus_idx as _ , effect_idx as _ , channel as _) ; < Option < Ref < crate :: generated :: AudioEffectInstance , ownership :: Shared > > > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [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 :: icallvar__str (method_bind , self . this . sys () . as_ptr () , bus_name . into ()) ; < i64 > :: coerce_from_variant (& ret) } } # [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 :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , bus_idx as _) ; < GodotString > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [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 :: icallvar__i64_i64 (method_bind , self . this . sys () . as_ptr () , bus_idx as _ , channel as _) ; < f64 > :: coerce_from_variant (& ret) } } # [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 :: icallvar__i64_i64 (method_bind , self . this . sys () . as_ptr () , bus_idx as _ , channel as _) ; < f64 > :: coerce_from_variant (& ret) } } # [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 :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , bus_idx as _) ; < GodotString > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [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 :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , bus_idx as _) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Name of the current device for audio output (see [`get_device_list`][Self::get_device_list]). On systems with multiple audio outputs (such as analog, USB and HDMI audio), this can be used to select the audio output device. The value `\"Default\"` will play audio on the system-wide default audio output. If an invalid device name is set, the value will be reverted back to `\"Default\"`."] # [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 :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < GodotString > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [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 :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Returns the sample rate at the output of the [`AudioServer`][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 :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [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 :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [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 :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < crate :: generated :: audio_server :: SpeakerMode > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [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 :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [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 :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [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 :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , bus_idx as _) ; < bool > :: coerce_from_variant (& ret) } } # [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 :: icallvar__i64_i64 (method_bind , self . this . sys () . as_ptr () , bus_idx as _ , effect_idx as _) ; < bool > :: coerce_from_variant (& ret) } } # [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 :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , bus_idx as _) ; < bool > :: coerce_from_variant (& ret) } } # [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 :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , bus_idx as _) ; < bool > :: coerce_from_variant (& ret) } } # [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 :: icallvar_ (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 :: icallvar__i64_i64 (method_bind , self . this . sys () . as_ptr () , index as _ , to_index as _) ; } } # [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 :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , index as _) ; } } # [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 :: icallvar__i64_i64 (method_bind , self . this . sys () . as_ptr () , bus_idx as _ , effect_idx as _) ; } } # [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 :: icallvar__i64_bool (method_bind , self . this . sys () . as_ptr () , bus_idx as _ , enable as _) ; } } # [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 :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , amount as _) ; } } # [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 :: icallvar__i64_i64_bool (method_bind , self . this . sys () . as_ptr () , bus_idx as _ , effect_idx as _ , enabled as _) ; } } # [doc = "Overwrites the currently used [`AudioBusLayout`][AudioBusLayout]."] # [doc = ""] # [inline] pub fn set_bus_layout (& self , bus_layout : impl AsArg < crate :: generated :: AudioBusLayout >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioServerMethodTable :: get (get_api ()) . set_bus_layout ; let ret = crate :: icalls :: icallvar__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 :: icallvar__i64_bool (method_bind , self . this . sys () . as_ptr () , bus_idx as _ , enable as _) ; } } # [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 :: icallvar__i64_str (method_bind , self . this . sys () . as_ptr () , bus_idx as _ , 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 :: icallvar__i64_str (method_bind , self . this . sys () . as_ptr () , bus_idx as _ , 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 :: icallvar__i64_bool (method_bind , self . this . sys () . as_ptr () , bus_idx as _ , enable as _) ; } } # [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 :: icallvar__i64_f64 (method_bind , self . this . sys () . as_ptr () , bus_idx as _ , volume_db as _) ; } } # [doc = "Name of the current device for audio output (see [`get_device_list`][Self::get_device_list]). On systems with multiple audio outputs (such as analog, USB and HDMI audio), this can be used to select the audio output device. The value `\"Default\"` will play audio on the system-wide default audio output. If an invalid device name is set, the value will be reverted back to `\"Default\"`."] # [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 :: icallvar__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 :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , scale as _) ; } } # [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 :: icallvar__i64_i64_i64 (method_bind , self . this . sys () . as_ptr () , bus_idx as _ , effect_idx as _ , by_effect_idx as _) ; } } # [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 :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for AudioServer { } unsafe impl GodotObject for AudioServer { type Memory = memory :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "AudioServer" } } impl std :: ops :: Deref for AudioServer { type Target = crate :: generated :: Object ; # [inline] fn deref (& self) -> & crate :: generated :: Object { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AudioServer { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: Object { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: 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 } ; &raw 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 = std :: sync :: 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 [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:453:3239 [INFO] [stdout] | [INFO] [stdout] 453 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 453 | # ! [doc = "This module contains types related to the API class [`AudioStream`][super::AudioStream]."] pub (crate) mod private { # [doc = "`core class AudioStream` inherits `Resource` (reference-counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_audiostream.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\nAudioStream 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 `Ownership` in these types tracks whether\nownership 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 AudioStream { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AudioStream ; impl AudioStream { # [doc = "Returns the length of the audio stream in seconds."] # [doc = ""] # [inline] pub fn get_length (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamMethodTable :: get (get_api ()) . get_length ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } } impl gdnative_core :: private :: godot_object :: Sealed for AudioStream { } unsafe impl GodotObject for AudioStream { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AudioStream" } } impl std :: ops :: Deref for AudioStream { type Target = crate :: generated :: Resource ; # [inline] fn deref (& self) -> & crate :: generated :: Resource { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AudioStream { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: Resource { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: Resource > for AudioStream { } unsafe impl SubClass < crate :: generated :: Reference > for AudioStream { } unsafe impl SubClass < crate :: generated :: Object > for AudioStream { } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AudioStreamMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_length : * mut sys :: godot_method_bind } impl AudioStreamMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AudioStreamMethodTable = AudioStreamMethodTable { class_constructor : None , get_length : 0 as * mut sys :: godot_method_bind } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { AudioStreamMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AudioStream\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_length = (gd_api . godot_method_bind_get_method) (class_name , "get_length\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:459:7194 [INFO] [stdout] | [INFO] [stdout] 459 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 459 | # ! [doc = "This module contains types related to the API class [`AudioStreamGenerator`][super::AudioStreamGenerator]."] pub (crate) mod private { # [doc = "`core class AudioStreamGenerator` inherits `AudioStream` (reference-counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_audiostreamgenerator.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\nAudioStreamGenerator 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 `Ownership` in these types tracks whether\nownership 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 AudioStreamGenerator { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AudioStreamGenerator ; impl AudioStreamGenerator { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AudioStreamGeneratorMethodTable :: 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 length of the buffer to generate (in seconds). Lower values result in less latency, but require the script to generate audio data faster, resulting in increased CPU usage and more risk for audio cracking if the CPU can't keep up."] # [doc = ""] # [inline] pub fn buffer_length (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamGeneratorMethodTable :: get (get_api ()) . get_buffer_length ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "The sample rate to use (in Hz). Higher values are more demanding for the CPU to generate, but result in better quality.\nIn games, common sample rates in use are `11025`, `16000`, `22050`, `32000`, `44100`, and `48000`.\nAccording to the [Nyquist-Shannon sampling theorem](https://en.wikipedia.org/wiki/Nyquist%E2%80%93Shannon_sampling_theorem), there is no quality difference to human hearing when going past 40,000 Hz (since most humans can only hear up to ~20,000 Hz, often less). If you are generating lower-pitched sounds such as voices, lower sample rates such as `32000` or `22050` may be usable with no loss in quality."] # [doc = ""] # [inline] pub fn mix_rate (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamGeneratorMethodTable :: get (get_api ()) . get_mix_rate ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "The length of the buffer to generate (in seconds). Lower values result in less latency, but require the script to generate audio data faster, resulting in increased CPU usage and more risk for audio cracking if the CPU can't keep up."] # [doc = ""] # [inline] pub fn set_buffer_length (& self , seconds : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamGeneratorMethodTable :: get (get_api ()) . set_buffer_length ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , seconds as _) ; } } # [doc = "The sample rate to use (in Hz). Higher values are more demanding for the CPU to generate, but result in better quality.\nIn games, common sample rates in use are `11025`, `16000`, `22050`, `32000`, `44100`, and `48000`.\nAccording to the [Nyquist-Shannon sampling theorem](https://en.wikipedia.org/wiki/Nyquist%E2%80%93Shannon_sampling_theorem), there is no quality difference to human hearing when going past 40,000 Hz (since most humans can only hear up to ~20,000 Hz, often less). If you are generating lower-pitched sounds such as voices, lower sample rates such as `32000` or `22050` may be usable with no loss in quality."] # [doc = ""] # [inline] pub fn set_mix_rate (& self , hz : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamGeneratorMethodTable :: get (get_api ()) . set_mix_rate ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , hz as _) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for AudioStreamGenerator { } unsafe impl GodotObject for AudioStreamGenerator { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AudioStreamGenerator" } } impl std :: ops :: Deref for AudioStreamGenerator { type Target = crate :: generated :: AudioStream ; # [inline] fn deref (& self) -> & crate :: generated :: AudioStream { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AudioStreamGenerator { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: AudioStream { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: AudioStream > for AudioStreamGenerator { } unsafe impl SubClass < crate :: generated :: Resource > for AudioStreamGenerator { } unsafe impl SubClass < crate :: generated :: Reference > for AudioStreamGenerator { } unsafe impl SubClass < crate :: generated :: Object > for AudioStreamGenerator { } impl Instanciable for AudioStreamGenerator { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { AudioStreamGenerator :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AudioStreamGeneratorMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_buffer_length : * mut sys :: godot_method_bind , pub get_mix_rate : * mut sys :: godot_method_bind , pub set_buffer_length : * mut sys :: godot_method_bind , pub set_mix_rate : * mut sys :: godot_method_bind } impl AudioStreamGeneratorMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AudioStreamGeneratorMethodTable = AudioStreamGeneratorMethodTable { class_constructor : None , get_buffer_length : 0 as * mut sys :: godot_method_bind , get_mix_rate : 0 as * mut sys :: godot_method_bind , set_buffer_length : 0 as * mut sys :: godot_method_bind , set_mix_rate : 0 as * mut sys :: godot_method_bind } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { AudioStreamGeneratorMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AudioStreamGenerator\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_buffer_length = (gd_api . godot_method_bind_get_method) (class_name , "get_buffer_length\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 . set_buffer_length = (gd_api . godot_method_bind_get_method) (class_name , "set_buffer_length\0" . as_ptr () as * const c_char) ; table . set_mix_rate = (gd_api . godot_method_bind_get_method) (class_name , "set_mix_rate\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:465:7113 [INFO] [stdout] | [INFO] [stdout] 465 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 465 | # ! [doc = "This module contains types related to the API class [`AudioStreamGeneratorPlayback`][super::AudioStreamGeneratorPlayback]."] pub (crate) mod private { # [doc = "`core class AudioStreamGeneratorPlayback` inherits `AudioStreamPlaybackResampled` (reference-counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_audiostreamgeneratorplayback.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\nAudioStreamGeneratorPlayback inherits methods from:\n - [AudioStreamPlaybackResampled](struct.AudioStreamPlaybackResampled.html)\n - [AudioStreamPlayback](struct.AudioStreamPlayback.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 `Ownership` in these types tracks whether\nownership 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 AudioStreamGeneratorPlayback { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AudioStreamGeneratorPlayback ; impl AudioStreamGeneratorPlayback { # [doc = "Returns `true` if a buffer of the size `amount` can be pushed to the audio sample data buffer without overflowing it, `false` otherwise."] # [doc = ""] # [inline] pub fn can_push_buffer (& self , amount : i64) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamGeneratorPlaybackMethodTable :: get (get_api ()) . can_push_buffer ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , amount as _) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "Clears the audio sample data buffer."] # [doc = ""] # [inline] pub fn clear_buffer (& self) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamGeneratorPlaybackMethodTable :: get (get_api ()) . clear_buffer ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; } } # [doc = "Returns the number of audio data frames left to play. If this returned number reaches `0`, the audio will stop playing until frames are added again. Therefore, make sure your script can always generate and push new audio frames fast enough to avoid audio cracking."] # [doc = ""] # [inline] pub fn get_frames_available (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamGeneratorPlaybackMethodTable :: get (get_api ()) . get_frames_available ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = ""] # [doc = ""] # [inline] pub fn get_skips (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamGeneratorPlaybackMethodTable :: get (get_api ()) . get_skips ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "Pushes several audio data frames to the buffer. This is usually more efficient than [`push_frame`][Self::push_frame] in C# and compiled languages via GDNative, but [`push_buffer`][Self::push_buffer] may be _less_ efficient in GDScript."] # [doc = ""] # [inline] pub fn push_buffer (& self , frames : PoolArray < Vector2 >) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamGeneratorPlaybackMethodTable :: get (get_api ()) . push_buffer ; let ret = crate :: icalls :: icallvar__vec2arr (method_bind , self . this . sys () . as_ptr () , frames) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "Pushes a single audio data frame to the buffer. This is usually less efficient than [`push_buffer`][Self::push_buffer] in C# and compiled languages via GDNative, but [`push_frame`][Self::push_frame] may be _more_ efficient in GDScript."] # [doc = ""] # [inline] pub fn push_frame (& self , frame : Vector2) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamGeneratorPlaybackMethodTable :: get (get_api ()) . push_frame ; let ret = crate :: icalls :: icallvar__vec2 (method_bind , self . this . sys () . as_ptr () , frame) ; < bool > :: coerce_from_variant (& ret) } } } impl gdnative_core :: private :: godot_object :: Sealed for AudioStreamGeneratorPlayback { } unsafe impl GodotObject for AudioStreamGeneratorPlayback { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AudioStreamGeneratorPlayback" } } impl std :: ops :: Deref for AudioStreamGeneratorPlayback { type Target = crate :: generated :: AudioStreamPlaybackResampled ; # [inline] fn deref (& self) -> & crate :: generated :: AudioStreamPlaybackResampled { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AudioStreamGeneratorPlayback { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: AudioStreamPlaybackResampled { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: AudioStreamPlaybackResampled > for AudioStreamGeneratorPlayback { } unsafe impl SubClass < crate :: generated :: AudioStreamPlayback > for AudioStreamGeneratorPlayback { } unsafe impl SubClass < crate :: generated :: Reference > for AudioStreamGeneratorPlayback { } unsafe impl SubClass < crate :: generated :: Object > for AudioStreamGeneratorPlayback { } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AudioStreamGeneratorPlaybackMethodTable { pub class_constructor : sys :: godot_class_constructor , pub can_push_buffer : * mut sys :: godot_method_bind , pub clear_buffer : * mut sys :: godot_method_bind , pub get_frames_available : * mut sys :: godot_method_bind , pub get_skips : * mut sys :: godot_method_bind , pub push_buffer : * mut sys :: godot_method_bind , pub push_frame : * mut sys :: godot_method_bind } impl AudioStreamGeneratorPlaybackMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AudioStreamGeneratorPlaybackMethodTable = AudioStreamGeneratorPlaybackMethodTable { class_constructor : None , can_push_buffer : 0 as * mut sys :: godot_method_bind , clear_buffer : 0 as * mut sys :: godot_method_bind , get_frames_available : 0 as * mut sys :: godot_method_bind , get_skips : 0 as * mut sys :: godot_method_bind , push_buffer : 0 as * mut sys :: godot_method_bind , push_frame : 0 as * mut sys :: godot_method_bind } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { AudioStreamGeneratorPlaybackMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AudioStreamGeneratorPlayback\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . can_push_buffer = (gd_api . godot_method_bind_get_method) (class_name , "can_push_buffer\0" . as_ptr () as * const c_char) ; table . clear_buffer = (gd_api . godot_method_bind_get_method) (class_name , "clear_buffer\0" . as_ptr () as * const c_char) ; table . get_frames_available = (gd_api . godot_method_bind_get_method) (class_name , "get_frames_available\0" . as_ptr () as * const c_char) ; table . get_skips = (gd_api . godot_method_bind_get_method) (class_name , "get_skips\0" . as_ptr () as * const c_char) ; table . push_buffer = (gd_api . godot_method_bind_get_method) (class_name , "push_buffer\0" . as_ptr () as * const c_char) ; table . push_frame = (gd_api . godot_method_bind_get_method) (class_name , "push_frame\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:471:6167 [INFO] [stdout] | [INFO] [stdout] 471 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 471 | # ! [doc = "This module contains types related to the API class [`AudioStreamMP3`][super::AudioStreamMP3]."] pub (crate) mod private { # [doc = "`core class AudioStreamMP3` inherits `AudioStream` (reference-counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_audiostreammp3.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\nAudioStreamMP3 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 `Ownership` in these types tracks whether\nownership 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 AudioStreamMP3 { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AudioStreamMP3 ; impl AudioStreamMP3 { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AudioStreamMP3MethodTable :: 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 data (& self) -> PoolArray < u8 > { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamMP3MethodTable :: get (get_api ()) . get_data ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < PoolArray < u8 > > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = ""] # [doc = ""] # [inline] pub fn loop_offset (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamMP3MethodTable :: get (get_api ()) . get_loop_offset ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = ""] # [doc = ""] # [inline] pub fn has_loop (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamMP3MethodTable :: get (get_api ()) . has_loop ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = ""] # [doc = ""] # [inline] pub fn set_data (& self , data : PoolArray < u8 >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamMP3MethodTable :: get (get_api ()) . set_data ; let ret = crate :: icalls :: icallvar__bytearr (method_bind , self . this . sys () . as_ptr () , data) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn set_loop (& self , enable : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamMP3MethodTable :: get (get_api ()) . set_loop ; let ret = crate :: icalls :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , enable as _) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn set_loop_offset (& self , seconds : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamMP3MethodTable :: get (get_api ()) . set_loop_offset ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , seconds as _) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for AudioStreamMP3 { } unsafe impl GodotObject for AudioStreamMP3 { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AudioStreamMP3" } } impl std :: ops :: Deref for AudioStreamMP3 { type Target = crate :: generated :: AudioStream ; # [inline] fn deref (& self) -> & crate :: generated :: AudioStream { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AudioStreamMP3 { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: AudioStream { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: AudioStream > for AudioStreamMP3 { } unsafe impl SubClass < crate :: generated :: Resource > for AudioStreamMP3 { } unsafe impl SubClass < crate :: generated :: Reference > for AudioStreamMP3 { } unsafe impl SubClass < crate :: generated :: Object > for AudioStreamMP3 { } impl Instanciable for AudioStreamMP3 { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { AudioStreamMP3 :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AudioStreamMP3MethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_data : * mut sys :: godot_method_bind , pub get_loop_offset : * mut sys :: godot_method_bind , pub has_loop : * mut sys :: godot_method_bind , pub set_data : * mut sys :: godot_method_bind , pub set_loop : * mut sys :: godot_method_bind , pub set_loop_offset : * mut sys :: godot_method_bind } impl AudioStreamMP3MethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AudioStreamMP3MethodTable = AudioStreamMP3MethodTable { class_constructor : None , get_data : 0 as * mut sys :: godot_method_bind , get_loop_offset : 0 as * mut sys :: godot_method_bind , has_loop : 0 as * mut sys :: godot_method_bind , set_data : 0 as * mut sys :: godot_method_bind , set_loop : 0 as * mut sys :: godot_method_bind , set_loop_offset : 0 as * mut sys :: godot_method_bind } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { AudioStreamMP3MethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AudioStreamMP3\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_data = (gd_api . godot_method_bind_get_method) (class_name , "get_data\0" . as_ptr () as * const c_char) ; table . get_loop_offset = (gd_api . godot_method_bind_get_method) (class_name , "get_loop_offset\0" . as_ptr () as * const c_char) ; table . has_loop = (gd_api . godot_method_bind_get_method) (class_name , "has_loop\0" . as_ptr () as * const c_char) ; table . set_data = (gd_api . godot_method_bind_get_method) (class_name , "set_data\0" . as_ptr () as * const c_char) ; table . set_loop = (gd_api . godot_method_bind_get_method) (class_name , "set_loop\0" . as_ptr () as * const c_char) ; table . set_loop_offset = (gd_api . godot_method_bind_get_method) (class_name , "set_loop_offset\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:477:3722 [INFO] [stdout] | [INFO] [stdout] 477 | ...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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 477 | # ! [doc = "This module contains types related to the API class [`AudioStreamMicrophone`][super::AudioStreamMicrophone]."] pub (crate) mod private { # [doc = "`core class AudioStreamMicrophone` inherits `AudioStream` (reference-counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_audiostreammicrophone.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\nAudioStreamMicrophone 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 `Ownership` in these types tracks whether\nownership 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 AudioStreamMicrophone { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AudioStreamMicrophone ; impl AudioStreamMicrophone { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AudioStreamMicrophoneMethodTable :: 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 AudioStreamMicrophone { } unsafe impl GodotObject for AudioStreamMicrophone { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AudioStreamMicrophone" } } impl std :: ops :: Deref for AudioStreamMicrophone { type Target = crate :: generated :: AudioStream ; # [inline] fn deref (& self) -> & crate :: generated :: AudioStream { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AudioStreamMicrophone { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: AudioStream { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: AudioStream > for AudioStreamMicrophone { } unsafe impl SubClass < crate :: generated :: Resource > for AudioStreamMicrophone { } unsafe impl SubClass < crate :: generated :: Reference > for AudioStreamMicrophone { } unsafe impl SubClass < crate :: generated :: Object > for AudioStreamMicrophone { } impl Instanciable for AudioStreamMicrophone { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { AudioStreamMicrophone :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AudioStreamMicrophoneMethodTable { pub class_constructor : sys :: godot_class_constructor , } impl AudioStreamMicrophoneMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AudioStreamMicrophoneMethodTable = AudioStreamMicrophoneMethodTable { class_constructor : None , } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { AudioStreamMicrophoneMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AudioStreamMicrophone\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 [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:483:6347 [INFO] [stdout] | [INFO] [stdout] 483 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 483 | # ! [doc = "This module contains types related to the API class [`AudioStreamOGGVorbis`][super::AudioStreamOGGVorbis]."] pub (crate) mod private { # [doc = "`core class AudioStreamOGGVorbis` inherits `AudioStream` (reference-counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_audiostreamoggvorbis.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\nAudioStreamOGGVorbis 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 `Ownership` in these types tracks whether\nownership 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 AudioStreamOGGVorbis { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AudioStreamOGGVorbis ; impl AudioStreamOGGVorbis { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AudioStreamOGGVorbisMethodTable :: 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 data (& self) -> PoolArray < u8 > { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamOGGVorbisMethodTable :: get (get_api ()) . get_data ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < PoolArray < u8 > > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = ""] # [doc = ""] # [inline] pub fn loop_offset (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamOGGVorbisMethodTable :: get (get_api ()) . get_loop_offset ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = ""] # [doc = ""] # [inline] pub fn has_loop (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamOGGVorbisMethodTable :: get (get_api ()) . has_loop ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = ""] # [doc = ""] # [inline] pub fn set_data (& self , data : PoolArray < u8 >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamOGGVorbisMethodTable :: get (get_api ()) . set_data ; let ret = crate :: icalls :: icallvar__bytearr (method_bind , self . this . sys () . as_ptr () , data) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn set_loop (& self , enable : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamOGGVorbisMethodTable :: get (get_api ()) . set_loop ; let ret = crate :: icalls :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , enable as _) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn set_loop_offset (& self , seconds : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamOGGVorbisMethodTable :: get (get_api ()) . set_loop_offset ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , seconds as _) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for AudioStreamOGGVorbis { } unsafe impl GodotObject for AudioStreamOGGVorbis { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AudioStreamOGGVorbis" } } impl std :: ops :: Deref for AudioStreamOGGVorbis { type Target = crate :: generated :: AudioStream ; # [inline] fn deref (& self) -> & crate :: generated :: AudioStream { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AudioStreamOGGVorbis { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: AudioStream { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: AudioStream > for AudioStreamOGGVorbis { } unsafe impl SubClass < crate :: generated :: Resource > for AudioStreamOGGVorbis { } unsafe impl SubClass < crate :: generated :: Reference > for AudioStreamOGGVorbis { } unsafe impl SubClass < crate :: generated :: Object > for AudioStreamOGGVorbis { } impl Instanciable for AudioStreamOGGVorbis { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { AudioStreamOGGVorbis :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AudioStreamOGGVorbisMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_data : * mut sys :: godot_method_bind , pub get_loop_offset : * mut sys :: godot_method_bind , pub has_loop : * mut sys :: godot_method_bind , pub set_data : * mut sys :: godot_method_bind , pub set_loop : * mut sys :: godot_method_bind , pub set_loop_offset : * mut sys :: godot_method_bind } impl AudioStreamOGGVorbisMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AudioStreamOGGVorbisMethodTable = AudioStreamOGGVorbisMethodTable { class_constructor : None , get_data : 0 as * mut sys :: godot_method_bind , get_loop_offset : 0 as * mut sys :: godot_method_bind , has_loop : 0 as * mut sys :: godot_method_bind , set_data : 0 as * mut sys :: godot_method_bind , set_loop : 0 as * mut sys :: godot_method_bind , set_loop_offset : 0 as * mut sys :: godot_method_bind } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { AudioStreamOGGVorbisMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AudioStreamOGGVorbis\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_data = (gd_api . godot_method_bind_get_method) (class_name , "get_data\0" . as_ptr () as * const c_char) ; table . get_loop_offset = (gd_api . godot_method_bind_get_method) (class_name , "get_loop_offset\0" . as_ptr () as * const c_char) ; table . has_loop = (gd_api . godot_method_bind_get_method) (class_name , "has_loop\0" . as_ptr () as * const c_char) ; table . set_data = (gd_api . godot_method_bind_get_method) (class_name , "set_data\0" . as_ptr () as * const c_char) ; table . set_loop = (gd_api . godot_method_bind_get_method) (class_name , "set_loop\0" . as_ptr () as * const c_char) ; table . set_loop_offset = (gd_api . godot_method_bind_get_method) (class_name , "set_loop_offset\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:501:16580 [INFO] [stdout] | [INFO] [stdout] 501 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 501 | # ! [doc = "This module contains types related to the API class [`AudioStreamPlayer`][super::AudioStreamPlayer]."] pub (crate) mod private { # [doc = "`core class AudioStreamPlayer` inherits `Node` (manually managed).\n\nThis class has related types in the [`audio_stream_player`][super::audio_stream_player] module."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_audiostreamplayer.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`AudioStreamPlayer` 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\nAudioStreamPlayer inherits methods from:\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 `Ownership` in these types tracks whether\nownership 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 AudioStreamPlayer { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AudioStreamPlayer ; # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct MixTarget (pub i64) ; impl MixTarget { pub const STEREO : MixTarget = MixTarget (0i64) ; pub const SURROUND : MixTarget = MixTarget (1i64) ; pub const CENTER : MixTarget = MixTarget (2i64) ; } impl From < i64 > for MixTarget { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < MixTarget > for i64 { # [inline] fn from (v : MixTarget) -> Self { v . 0 } } impl FromVariant for MixTarget { # [inline] fn from_variant (v : & Variant) -> Result < Self , FromVariantError > { i64 :: from_variant (v) . map (Self :: from) } } # [doc = "Constants"] # [allow (non_upper_case_globals)] impl AudioStreamPlayer { pub const MIX_TARGET_STEREO : i64 = 0i64 ; pub const MIX_TARGET_SURROUND : i64 = 1i64 ; pub const MIX_TARGET_CENTER : i64 = 2i64 ; } impl AudioStreamPlayer { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AudioStreamPlayerMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "Bus on which this audio is playing.\n**Note:** When setting this property, keep in mind that no validation is performed to see if the given name matches an existing bus. This is because audio bus layouts might be loaded after this property is set. If this given name can't be resolved at runtime, it will fall back to `\"Master\"`."] # [doc = ""] # [inline] pub fn bus (& self) -> GodotString { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayerMethodTable :: get (get_api ()) . get_bus ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < GodotString > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "If the audio configuration has more than two speakers, this sets the target channels. See [`MixTarget`][MixTarget] constants."] # [doc = ""] # [inline] pub fn mix_target (& self) -> crate :: generated :: audio_stream_player :: MixTarget { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayerMethodTable :: get (get_api ()) . get_mix_target ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < crate :: generated :: audio_stream_player :: MixTarget > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "The pitch and the tempo of the audio, as a multiplier of the audio sample's sample rate."] # [doc = ""] # [inline] pub fn pitch_scale (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayerMethodTable :: get (get_api ()) . get_pitch_scale ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Returns the position in the [`AudioStream`][AudioStream] in seconds."] # [doc = ""] # [inline] pub fn get_playback_position (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayerMethodTable :: get (get_api ()) . get_playback_position ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "The [`AudioStream`][AudioStream] object to be played."] # [doc = ""] # [inline] pub fn stream (& self) -> Option < Ref < crate :: generated :: AudioStream , ownership :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayerMethodTable :: get (get_api ()) . get_stream ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < Option < Ref < crate :: generated :: AudioStream , ownership :: Shared > > > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "If `true`, the playback is paused. You can resume it by setting `stream_paused` to `false`."] # [doc = ""] # [inline] pub fn stream_paused (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayerMethodTable :: get (get_api ()) . get_stream_paused ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "Returns the [`AudioStreamPlayback`][AudioStreamPlayback] object associated with this [`AudioStreamPlayer`][AudioStreamPlayer]."] # [doc = ""] # [inline] pub fn get_stream_playback (& self) -> Option < Ref < crate :: generated :: AudioStreamPlayback , ownership :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayerMethodTable :: get (get_api ()) . get_stream_playback ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < Option < Ref < crate :: generated :: AudioStreamPlayback , ownership :: Shared > > > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Volume of sound, in dB."] # [doc = ""] # [inline] pub fn volume_db (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayerMethodTable :: get (get_api ()) . get_volume_db ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "If `true`, audio plays when added to scene tree."] # [doc = ""] # [inline] pub fn is_autoplay_enabled (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayerMethodTable :: get (get_api ()) . is_autoplay_enabled ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "If `true`, audio is playing."] # [doc = ""] # [inline] pub fn is_playing (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayerMethodTable :: get (get_api ()) . is_playing ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "Plays the audio from the given `from_position`, in seconds.\n# Default Arguments\n* `from_position` - `0.0`"] # [doc = ""] # [inline] pub fn play (& self , from_position : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayerMethodTable :: get (get_api ()) . play ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , from_position as _) ; } } # [doc = "Sets the position from which audio will be played, in seconds."] # [doc = ""] # [inline] pub fn seek (& self , to_position : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayerMethodTable :: get (get_api ()) . seek ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , to_position as _) ; } } # [doc = "If `true`, audio plays when added to scene tree."] # [doc = ""] # [inline] pub fn set_autoplay (& self , enable : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayerMethodTable :: get (get_api ()) . set_autoplay ; let ret = crate :: icalls :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , enable as _) ; } } # [doc = "Bus on which this audio is playing.\n**Note:** When setting this property, keep in mind that no validation is performed to see if the given name matches an existing bus. This is because audio bus layouts might be loaded after this property is set. If this given name can't be resolved at runtime, it will fall back to `\"Master\"`."] # [doc = ""] # [inline] pub fn set_bus (& self , bus : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayerMethodTable :: get (get_api ()) . set_bus ; let ret = crate :: icalls :: icallvar__str (method_bind , self . this . sys () . as_ptr () , bus . into ()) ; } } # [doc = "If the audio configuration has more than two speakers, this sets the target channels. See [`MixTarget`][MixTarget] constants."] # [doc = ""] # [inline] pub fn set_mix_target (& self , mix_target : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayerMethodTable :: get (get_api ()) . set_mix_target ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , mix_target as _) ; } } # [doc = "The pitch and the tempo of the audio, as a multiplier of the audio sample's sample rate."] # [doc = ""] # [inline] pub fn set_pitch_scale (& self , pitch_scale : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayerMethodTable :: get (get_api ()) . set_pitch_scale ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , pitch_scale as _) ; } } # [doc = "The [`AudioStream`][AudioStream] object to be played."] # [doc = ""] # [inline] pub fn set_stream (& self , stream : impl AsArg < crate :: generated :: AudioStream >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayerMethodTable :: get (get_api ()) . set_stream ; let ret = crate :: icalls :: icallvar__obj (method_bind , self . this . sys () . as_ptr () , stream . as_arg_ptr ()) ; } } # [doc = "If `true`, the playback is paused. You can resume it by setting `stream_paused` to `false`."] # [doc = ""] # [inline] pub fn set_stream_paused (& self , pause : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayerMethodTable :: get (get_api ()) . set_stream_paused ; let ret = crate :: icalls :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , pause as _) ; } } # [doc = "Volume of sound, in dB."] # [doc = ""] # [inline] pub fn set_volume_db (& self , volume_db : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayerMethodTable :: get (get_api ()) . set_volume_db ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , volume_db as _) ; } } # [doc = "Stops the audio."] # [doc = ""] # [inline] pub fn stop (& self) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayerMethodTable :: get (get_api ()) . stop ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for AudioStreamPlayer { } unsafe impl GodotObject for AudioStreamPlayer { type Memory = memory :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "AudioStreamPlayer" } } impl QueueFree for AudioStreamPlayer { # [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 :: icallvar_ (method_bind , obj) ; } } impl std :: ops :: Deref for AudioStreamPlayer { type Target = crate :: generated :: Node ; # [inline] fn deref (& self) -> & crate :: generated :: Node { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AudioStreamPlayer { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: Node { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: Node > for AudioStreamPlayer { } unsafe impl SubClass < crate :: generated :: Object > for AudioStreamPlayer { } impl Instanciable for AudioStreamPlayer { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { AudioStreamPlayer :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AudioStreamPlayerMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_bus : * mut sys :: godot_method_bind , pub get_mix_target : * mut sys :: godot_method_bind , pub get_pitch_scale : * mut sys :: godot_method_bind , pub get_playback_position : * mut sys :: godot_method_bind , pub get_stream : * mut sys :: godot_method_bind , pub get_stream_paused : * mut sys :: godot_method_bind , pub get_stream_playback : * mut sys :: godot_method_bind , pub get_volume_db : * mut sys :: godot_method_bind , pub is_autoplay_enabled : * mut sys :: godot_method_bind , pub is_playing : * mut sys :: godot_method_bind , pub play : * mut sys :: godot_method_bind , pub seek : * mut sys :: godot_method_bind , pub set_autoplay : * mut sys :: godot_method_bind , pub set_bus : * mut sys :: godot_method_bind , pub set_mix_target : * mut sys :: godot_method_bind , pub set_pitch_scale : * mut sys :: godot_method_bind , pub set_stream : * mut sys :: godot_method_bind , pub set_stream_paused : * mut sys :: godot_method_bind , pub set_volume_db : * mut sys :: godot_method_bind , pub stop : * mut sys :: godot_method_bind } impl AudioStreamPlayerMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AudioStreamPlayerMethodTable = AudioStreamPlayerMethodTable { class_constructor : None , get_bus : 0 as * mut sys :: godot_method_bind , get_mix_target : 0 as * mut sys :: godot_method_bind , get_pitch_scale : 0 as * mut sys :: godot_method_bind , get_playback_position : 0 as * mut sys :: godot_method_bind , get_stream : 0 as * mut sys :: godot_method_bind , get_stream_paused : 0 as * mut sys :: godot_method_bind , get_stream_playback : 0 as * mut sys :: godot_method_bind , get_volume_db : 0 as * mut sys :: godot_method_bind , is_autoplay_enabled : 0 as * mut sys :: godot_method_bind , is_playing : 0 as * mut sys :: godot_method_bind , play : 0 as * mut sys :: godot_method_bind , seek : 0 as * mut sys :: godot_method_bind , set_autoplay : 0 as * mut sys :: godot_method_bind , set_bus : 0 as * mut sys :: godot_method_bind , set_mix_target : 0 as * mut sys :: godot_method_bind , set_pitch_scale : 0 as * mut sys :: godot_method_bind , set_stream : 0 as * mut sys :: godot_method_bind , set_stream_paused : 0 as * mut sys :: godot_method_bind , set_volume_db : 0 as * mut sys :: godot_method_bind , stop : 0 as * mut sys :: godot_method_bind } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { AudioStreamPlayerMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AudioStreamPlayer\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_bus = (gd_api . godot_method_bind_get_method) (class_name , "get_bus\0" . as_ptr () as * const c_char) ; table . get_mix_target = (gd_api . godot_method_bind_get_method) (class_name , "get_mix_target\0" . as_ptr () as * const c_char) ; table . get_pitch_scale = (gd_api . godot_method_bind_get_method) (class_name , "get_pitch_scale\0" . as_ptr () as * const c_char) ; table . get_playback_position = (gd_api . godot_method_bind_get_method) (class_name , "get_playback_position\0" . as_ptr () as * const c_char) ; table . get_stream = (gd_api . godot_method_bind_get_method) (class_name , "get_stream\0" . as_ptr () as * const c_char) ; table . get_stream_paused = (gd_api . godot_method_bind_get_method) (class_name , "get_stream_paused\0" . as_ptr () as * const c_char) ; table . get_stream_playback = (gd_api . godot_method_bind_get_method) (class_name , "get_stream_playback\0" . as_ptr () as * const c_char) ; table . get_volume_db = (gd_api . godot_method_bind_get_method) (class_name , "get_volume_db\0" . as_ptr () as * const c_char) ; table . is_autoplay_enabled = (gd_api . godot_method_bind_get_method) (class_name , "is_autoplay_enabled\0" . as_ptr () as * const c_char) ; table . is_playing = (gd_api . godot_method_bind_get_method) (class_name , "is_playing\0" . as_ptr () as * const c_char) ; table . play = (gd_api . godot_method_bind_get_method) (class_name , "play\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_autoplay = (gd_api . godot_method_bind_get_method) (class_name , "set_autoplay\0" . as_ptr () as * const c_char) ; table . set_bus = (gd_api . godot_method_bind_get_method) (class_name , "set_bus\0" . as_ptr () as * const c_char) ; table . set_mix_target = (gd_api . godot_method_bind_get_method) (class_name , "set_mix_target\0" . as_ptr () as * const c_char) ; table . set_pitch_scale = (gd_api . godot_method_bind_get_method) (class_name , "set_pitch_scale\0" . as_ptr () as * const c_char) ; table . set_stream = (gd_api . godot_method_bind_get_method) (class_name , "set_stream\0" . as_ptr () as * const c_char) ; table . set_stream_paused = (gd_api . godot_method_bind_get_method) (class_name , "set_stream_paused\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) ; table . stop = (gd_api . godot_method_bind_get_method) (class_name , "stop\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:507:18381 [INFO] [stdout] | [INFO] [stdout] 507 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 507 | # ! [doc = "This module contains types related to the API class [`AudioStreamPlayer2D`][super::AudioStreamPlayer2D]."] pub (crate) mod private { # [doc = "`core class AudioStreamPlayer2D` inherits `Node2D` (manually managed)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_audiostreamplayer2d.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`AudioStreamPlayer2D` 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\nAudioStreamPlayer2D 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 `Ownership` in these types tracks whether\nownership 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 AudioStreamPlayer2D { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AudioStreamPlayer2D ; impl AudioStreamPlayer2D { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AudioStreamPlayer2DMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "Determines which [`Area2D`][Area2D] layers affect the sound for reverb and audio bus effects. Areas can be used to redirect [`AudioStream`][AudioStream]s so that they play in a certain audio bus. An example of how you might use this is making a \"water\" area so that sounds played in the water are redirected through an audio bus to make them sound like they are being played underwater."] # [doc = ""] # [inline] pub fn area_mask (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer2DMethodTable :: get (get_api ()) . get_area_mask ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "Dampens audio over distance with this as an exponent."] # [doc = ""] # [inline] pub fn attenuation (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer2DMethodTable :: get (get_api ()) . get_attenuation ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Bus on which this audio is playing.\n**Note:** When setting this property, keep in mind that no validation is performed to see if the given name matches an existing bus. This is because audio bus layouts might be loaded after this property is set. If this given name can't be resolved at runtime, it will fall back to `\"Master\"`."] # [doc = ""] # [inline] pub fn bus (& self) -> GodotString { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer2DMethodTable :: get (get_api ()) . get_bus ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < GodotString > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Maximum distance from which audio is still hearable."] # [doc = ""] # [inline] pub fn max_distance (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer2DMethodTable :: get (get_api ()) . get_max_distance ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "The pitch and the tempo of the audio, as a multiplier of the audio sample's sample rate."] # [doc = ""] # [inline] pub fn pitch_scale (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer2DMethodTable :: get (get_api ()) . get_pitch_scale ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Returns the position in the [`AudioStream`][AudioStream]."] # [doc = ""] # [inline] pub fn get_playback_position (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer2DMethodTable :: get (get_api ()) . get_playback_position ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "The [`AudioStream`][AudioStream] object to be played."] # [doc = ""] # [inline] pub fn stream (& self) -> Option < Ref < crate :: generated :: AudioStream , ownership :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer2DMethodTable :: get (get_api ()) . get_stream ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < Option < Ref < crate :: generated :: AudioStream , ownership :: Shared > > > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "If `true`, the playback is paused. You can resume it by setting `stream_paused` to `false`."] # [doc = ""] # [inline] pub fn stream_paused (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer2DMethodTable :: get (get_api ()) . get_stream_paused ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "Returns the [`AudioStreamPlayback`][AudioStreamPlayback] object associated with this [`AudioStreamPlayer2D`][AudioStreamPlayer2D]."] # [doc = ""] # [inline] pub fn get_stream_playback (& self) -> Option < Ref < crate :: generated :: AudioStreamPlayback , ownership :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer2DMethodTable :: get (get_api ()) . get_stream_playback ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < Option < Ref < crate :: generated :: AudioStreamPlayback , ownership :: Shared > > > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Base volume without dampening."] # [doc = ""] # [inline] pub fn volume_db (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer2DMethodTable :: get (get_api ()) . get_volume_db ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "If `true`, audio plays when added to scene tree."] # [doc = ""] # [inline] pub fn is_autoplay_enabled (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer2DMethodTable :: get (get_api ()) . is_autoplay_enabled ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "If `true`, audio is playing."] # [doc = ""] # [inline] pub fn is_playing (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer2DMethodTable :: get (get_api ()) . is_playing ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "Plays the audio from the given position `from_position`, in seconds.\n# Default Arguments\n* `from_position` - `0.0`"] # [doc = ""] # [inline] pub fn play (& self , from_position : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer2DMethodTable :: get (get_api ()) . play ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , from_position as _) ; } } # [doc = "Sets the position from which audio will be played, in seconds."] # [doc = ""] # [inline] pub fn seek (& self , to_position : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer2DMethodTable :: get (get_api ()) . seek ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , to_position as _) ; } } # [doc = "Determines which [`Area2D`][Area2D] layers affect the sound for reverb and audio bus effects. Areas can be used to redirect [`AudioStream`][AudioStream]s so that they play in a certain audio bus. An example of how you might use this is making a \"water\" area so that sounds played in the water are redirected through an audio bus to make them sound like they are being played underwater."] # [doc = ""] # [inline] pub fn set_area_mask (& self , mask : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer2DMethodTable :: get (get_api ()) . set_area_mask ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , mask as _) ; } } # [doc = "Dampens audio over distance with this as an exponent."] # [doc = ""] # [inline] pub fn set_attenuation (& self , curve : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer2DMethodTable :: get (get_api ()) . set_attenuation ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , curve as _) ; } } # [doc = "If `true`, audio plays when added to scene tree."] # [doc = ""] # [inline] pub fn set_autoplay (& self , enable : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer2DMethodTable :: get (get_api ()) . set_autoplay ; let ret = crate :: icalls :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , enable as _) ; } } # [doc = "Bus on which this audio is playing.\n**Note:** When setting this property, keep in mind that no validation is performed to see if the given name matches an existing bus. This is because audio bus layouts might be loaded after this property is set. If this given name can't be resolved at runtime, it will fall back to `\"Master\"`."] # [doc = ""] # [inline] pub fn set_bus (& self , bus : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer2DMethodTable :: get (get_api ()) . set_bus ; let ret = crate :: icalls :: icallvar__str (method_bind , self . this . sys () . as_ptr () , bus . into ()) ; } } # [doc = "Maximum distance from which audio is still hearable."] # [doc = ""] # [inline] pub fn set_max_distance (& self , pixels : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer2DMethodTable :: get (get_api ()) . set_max_distance ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , pixels as _) ; } } # [doc = "The pitch and the tempo of the audio, as a multiplier of the audio sample's sample rate."] # [doc = ""] # [inline] pub fn set_pitch_scale (& self , pitch_scale : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer2DMethodTable :: get (get_api ()) . set_pitch_scale ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , pitch_scale as _) ; } } # [doc = "The [`AudioStream`][AudioStream] object to be played."] # [doc = ""] # [inline] pub fn set_stream (& self , stream : impl AsArg < crate :: generated :: AudioStream >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer2DMethodTable :: get (get_api ()) . set_stream ; let ret = crate :: icalls :: icallvar__obj (method_bind , self . this . sys () . as_ptr () , stream . as_arg_ptr ()) ; } } # [doc = "If `true`, the playback is paused. You can resume it by setting `stream_paused` to `false`."] # [doc = ""] # [inline] pub fn set_stream_paused (& self , pause : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer2DMethodTable :: get (get_api ()) . set_stream_paused ; let ret = crate :: icalls :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , pause as _) ; } } # [doc = "Base volume without dampening."] # [doc = ""] # [inline] pub fn set_volume_db (& self , volume_db : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer2DMethodTable :: get (get_api ()) . set_volume_db ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , volume_db as _) ; } } # [doc = "Stops the audio."] # [doc = ""] # [inline] pub fn stop (& self) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer2DMethodTable :: get (get_api ()) . stop ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for AudioStreamPlayer2D { } unsafe impl GodotObject for AudioStreamPlayer2D { type Memory = memory :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "AudioStreamPlayer2D" } } impl QueueFree for AudioStreamPlayer2D { # [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 :: icallvar_ (method_bind , obj) ; } } impl std :: ops :: Deref for AudioStreamPlayer2D { type Target = crate :: generated :: Node2D ; # [inline] fn deref (& self) -> & crate :: generated :: Node2D { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AudioStreamPlayer2D { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: Node2D { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: Node2D > for AudioStreamPlayer2D { } unsafe impl SubClass < crate :: generated :: CanvasItem > for AudioStreamPlayer2D { } unsafe impl SubClass < crate :: generated :: Node > for AudioStreamPlayer2D { } unsafe impl SubClass < crate :: generated :: Object > for AudioStreamPlayer2D { } impl Instanciable for AudioStreamPlayer2D { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { AudioStreamPlayer2D :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AudioStreamPlayer2DMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_area_mask : * mut sys :: godot_method_bind , pub get_attenuation : * mut sys :: godot_method_bind , pub get_bus : * mut sys :: godot_method_bind , pub get_max_distance : * mut sys :: godot_method_bind , pub get_pitch_scale : * mut sys :: godot_method_bind , pub get_playback_position : * mut sys :: godot_method_bind , pub get_stream : * mut sys :: godot_method_bind , pub get_stream_paused : * mut sys :: godot_method_bind , pub get_stream_playback : * mut sys :: godot_method_bind , pub get_volume_db : * mut sys :: godot_method_bind , pub is_autoplay_enabled : * mut sys :: godot_method_bind , pub is_playing : * mut sys :: godot_method_bind , pub play : * mut sys :: godot_method_bind , pub seek : * mut sys :: godot_method_bind , pub set_area_mask : * mut sys :: godot_method_bind , pub set_attenuation : * mut sys :: godot_method_bind , pub set_autoplay : * mut sys :: godot_method_bind , pub set_bus : * mut sys :: godot_method_bind , pub set_max_distance : * mut sys :: godot_method_bind , pub set_pitch_scale : * mut sys :: godot_method_bind , pub set_stream : * mut sys :: godot_method_bind , pub set_stream_paused : * mut sys :: godot_method_bind , pub set_volume_db : * mut sys :: godot_method_bind , pub stop : * mut sys :: godot_method_bind } impl AudioStreamPlayer2DMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AudioStreamPlayer2DMethodTable = AudioStreamPlayer2DMethodTable { class_constructor : None , get_area_mask : 0 as * mut sys :: godot_method_bind , get_attenuation : 0 as * mut sys :: godot_method_bind , get_bus : 0 as * mut sys :: godot_method_bind , get_max_distance : 0 as * mut sys :: godot_method_bind , get_pitch_scale : 0 as * mut sys :: godot_method_bind , get_playback_position : 0 as * mut sys :: godot_method_bind , get_stream : 0 as * mut sys :: godot_method_bind , get_stream_paused : 0 as * mut sys :: godot_method_bind , get_stream_playback : 0 as * mut sys :: godot_method_bind , get_volume_db : 0 as * mut sys :: godot_method_bind , is_autoplay_enabled : 0 as * mut sys :: godot_method_bind , is_playing : 0 as * mut sys :: godot_method_bind , play : 0 as * mut sys :: godot_method_bind , seek : 0 as * mut sys :: godot_method_bind , set_area_mask : 0 as * mut sys :: godot_method_bind , set_attenuation : 0 as * mut sys :: godot_method_bind , set_autoplay : 0 as * mut sys :: godot_method_bind , set_bus : 0 as * mut sys :: godot_method_bind , set_max_distance : 0 as * mut sys :: godot_method_bind , set_pitch_scale : 0 as * mut sys :: godot_method_bind , set_stream : 0 as * mut sys :: godot_method_bind , set_stream_paused : 0 as * mut sys :: godot_method_bind , set_volume_db : 0 as * mut sys :: godot_method_bind , stop : 0 as * mut sys :: godot_method_bind } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { AudioStreamPlayer2DMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AudioStreamPlayer2D\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_area_mask = (gd_api . godot_method_bind_get_method) (class_name , "get_area_mask\0" . as_ptr () as * const c_char) ; table . get_attenuation = (gd_api . godot_method_bind_get_method) (class_name , "get_attenuation\0" . as_ptr () as * const c_char) ; table . get_bus = (gd_api . godot_method_bind_get_method) (class_name , "get_bus\0" . as_ptr () as * const c_char) ; table . get_max_distance = (gd_api . godot_method_bind_get_method) (class_name , "get_max_distance\0" . as_ptr () as * const c_char) ; table . get_pitch_scale = (gd_api . godot_method_bind_get_method) (class_name , "get_pitch_scale\0" . as_ptr () as * const c_char) ; table . get_playback_position = (gd_api . godot_method_bind_get_method) (class_name , "get_playback_position\0" . as_ptr () as * const c_char) ; table . get_stream = (gd_api . godot_method_bind_get_method) (class_name , "get_stream\0" . as_ptr () as * const c_char) ; table . get_stream_paused = (gd_api . godot_method_bind_get_method) (class_name , "get_stream_paused\0" . as_ptr () as * const c_char) ; table . get_stream_playback = (gd_api . godot_method_bind_get_method) (class_name , "get_stream_playback\0" . as_ptr () as * const c_char) ; table . get_volume_db = (gd_api . godot_method_bind_get_method) (class_name , "get_volume_db\0" . as_ptr () as * const c_char) ; table . is_autoplay_enabled = (gd_api . godot_method_bind_get_method) (class_name , "is_autoplay_enabled\0" . as_ptr () as * const c_char) ; table . is_playing = (gd_api . godot_method_bind_get_method) (class_name , "is_playing\0" . as_ptr () as * const c_char) ; table . play = (gd_api . godot_method_bind_get_method) (class_name , "play\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_area_mask = (gd_api . godot_method_bind_get_method) (class_name , "set_area_mask\0" . as_ptr () as * const c_char) ; table . set_attenuation = (gd_api . godot_method_bind_get_method) (class_name , "set_attenuation\0" . as_ptr () as * const c_char) ; table . set_autoplay = (gd_api . godot_method_bind_get_method) (class_name , "set_autoplay\0" . as_ptr () as * const c_char) ; table . set_bus = (gd_api . godot_method_bind_get_method) (class_name , "set_bus\0" . as_ptr () as * const c_char) ; table . set_max_distance = (gd_api . godot_method_bind_get_method) (class_name , "set_max_distance\0" . as_ptr () as * const c_char) ; table . set_pitch_scale = (gd_api . godot_method_bind_get_method) (class_name , "set_pitch_scale\0" . as_ptr () as * const c_char) ; table . set_stream = (gd_api . godot_method_bind_get_method) (class_name , "set_stream\0" . as_ptr () as * const c_char) ; table . set_stream_paused = (gd_api . godot_method_bind_get_method) (class_name , "set_stream_paused\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) ; table . stop = (gd_api . godot_method_bind_get_method) (class_name , "stop\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:513:32945 [INFO] [stdout] | [INFO] [stdout] 513 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 513 | # ! [doc = "This module contains types related to the API class [`AudioStreamPlayer3D`][super::AudioStreamPlayer3D]."] pub (crate) mod private { # [doc = "`core class AudioStreamPlayer3D` inherits `Spatial` (manually managed).\n\nThis class has related types in the [`audio_stream_player_3d`][super::audio_stream_player_3d] module."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_audiostreamplayer3d.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`AudioStreamPlayer3D` 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\nAudioStreamPlayer3D 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 `Ownership` in these types tracks whether\nownership 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 AudioStreamPlayer3D { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AudioStreamPlayer3D ; # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct AttenuationModel (pub i64) ; impl AttenuationModel { pub const INVERSE_DISTANCE : AttenuationModel = AttenuationModel (0i64) ; pub const INVERSE_SQUARE_DISTANCE : AttenuationModel = AttenuationModel (1i64) ; pub const LOGARITHMIC : AttenuationModel = AttenuationModel (2i64) ; pub const DISABLED : AttenuationModel = AttenuationModel (3i64) ; } impl From < i64 > for AttenuationModel { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < AttenuationModel > for i64 { # [inline] fn from (v : AttenuationModel) -> Self { v . 0 } } impl FromVariant for AttenuationModel { # [inline] fn from_variant (v : & Variant) -> Result < Self , FromVariantError > { i64 :: from_variant (v) . map (Self :: from) } } # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct DopplerTracking (pub i64) ; impl DopplerTracking { pub const DISABLED : DopplerTracking = DopplerTracking (0i64) ; pub const IDLE_STEP : DopplerTracking = DopplerTracking (1i64) ; pub const PHYSICS_STEP : DopplerTracking = DopplerTracking (2i64) ; } impl From < i64 > for DopplerTracking { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < DopplerTracking > for i64 { # [inline] fn from (v : DopplerTracking) -> Self { v . 0 } } impl FromVariant for DopplerTracking { # [inline] fn from_variant (v : & Variant) -> Result < Self , FromVariantError > { i64 :: from_variant (v) . map (Self :: from) } } # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct OutOfRangeMode (pub i64) ; impl OutOfRangeMode { pub const MIX : OutOfRangeMode = OutOfRangeMode (0i64) ; pub const PAUSE : OutOfRangeMode = OutOfRangeMode (1i64) ; } impl From < i64 > for OutOfRangeMode { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < OutOfRangeMode > for i64 { # [inline] fn from (v : OutOfRangeMode) -> Self { v . 0 } } impl FromVariant for OutOfRangeMode { # [inline] fn from_variant (v : & Variant) -> Result < Self , FromVariantError > { i64 :: from_variant (v) . map (Self :: from) } } # [doc = "Constants"] # [allow (non_upper_case_globals)] impl AudioStreamPlayer3D { pub const ATTENUATION_INVERSE_DISTANCE : i64 = 0i64 ; pub const DOPPLER_TRACKING_DISABLED : i64 = 0i64 ; pub const OUT_OF_RANGE_MIX : i64 = 0i64 ; pub const ATTENUATION_INVERSE_SQUARE_DISTANCE : i64 = 1i64 ; pub const DOPPLER_TRACKING_IDLE_STEP : i64 = 1i64 ; pub const OUT_OF_RANGE_PAUSE : i64 = 1i64 ; pub const ATTENUATION_LOGARITHMIC : i64 = 2i64 ; pub const DOPPLER_TRACKING_PHYSICS_STEP : i64 = 2i64 ; pub const ATTENUATION_DISABLED : i64 = 3i64 ; } impl AudioStreamPlayer3D { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AudioStreamPlayer3DMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "Determines which [`Area`][Area] layers affect the sound for reverb and audio bus effects. Areas can be used to redirect [`AudioStream`][AudioStream]s so that they play in a certain audio bus. An example of how you might use this is making a \"water\" area so that sounds played in the water are redirected through an audio bus to make them sound like they are being played underwater."] # [doc = ""] # [inline] pub fn area_mask (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer3DMethodTable :: get (get_api ()) . get_area_mask ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "Dampens audio using a low-pass filter above this frequency, in Hz. To disable the dampening effect entirely, set this to `20500` as this frequency is above the human hearing limit."] # [doc = ""] # [inline] pub fn attenuation_filter_cutoff_hz (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer3DMethodTable :: get (get_api ()) . get_attenuation_filter_cutoff_hz ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Amount how much the filter affects the loudness, in decibels."] # [doc = ""] # [inline] pub fn attenuation_filter_db (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer3DMethodTable :: get (get_api ()) . get_attenuation_filter_db ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Decides if audio should get quieter with distance linearly, quadratically, logarithmically, or not be affected by distance, effectively disabling attenuation."] # [doc = ""] # [inline] pub fn attenuation_model (& self) -> crate :: generated :: audio_stream_player_3d :: AttenuationModel { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer3DMethodTable :: get (get_api ()) . get_attenuation_model ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < crate :: generated :: audio_stream_player_3d :: AttenuationModel > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "The bus on which this audio is playing.\n**Note:** When setting this property, keep in mind that no validation is performed to see if the given name matches an existing bus. This is because audio bus layouts might be loaded after this property is set. If this given name can't be resolved at runtime, it will fall back to `\"Master\"`."] # [doc = ""] # [inline] pub fn bus (& self) -> GodotString { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer3DMethodTable :: get (get_api ()) . get_bus ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < GodotString > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Decides in which step the [Doppler effect](https://en.wikipedia.org/wiki/Doppler_effect) should be calculated.\n**Note:** Only effective if the current [`Camera`][Camera]'s [`Camera.doppler_tracking`][Camera::doppler_tracking] property is set to a value other than [`Camera.DOPPLER_TRACKING_DISABLED`][Camera::DOPPLER_TRACKING_DISABLED]."] # [doc = ""] # [inline] pub fn doppler_tracking (& self) -> crate :: generated :: audio_stream_player_3d :: DopplerTracking { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer3DMethodTable :: get (get_api ()) . get_doppler_tracking ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < crate :: generated :: audio_stream_player_3d :: DopplerTracking > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "The angle in which the audio reaches cameras undampened."] # [doc = ""] # [inline] pub fn emission_angle (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer3DMethodTable :: get (get_api ()) . get_emission_angle ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Dampens audio if camera is outside of [`emission_angle_degrees`][Self::emission_angle_degrees] and [`emission_angle_enabled`][Self::emission_angle_enabled] is set by this factor, in decibels."] # [doc = ""] # [inline] pub fn emission_angle_filter_attenuation_db (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer3DMethodTable :: get (get_api ()) . get_emission_angle_filter_attenuation_db ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Sets the absolute maximum of the soundlevel, in decibels."] # [doc = ""] # [inline] pub fn max_db (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer3DMethodTable :: get (get_api ()) . get_max_db ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Sets the distance from which the [`out_of_range_mode`][Self::out_of_range_mode] takes effect. Has no effect if set to 0."] # [doc = ""] # [inline] pub fn max_distance (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer3DMethodTable :: get (get_api ()) . get_max_distance ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Decides if audio should pause when source is outside of [`max_distance`][Self::max_distance] range."] # [doc = ""] # [inline] pub fn out_of_range_mode (& self) -> crate :: generated :: audio_stream_player_3d :: OutOfRangeMode { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer3DMethodTable :: get (get_api ()) . get_out_of_range_mode ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < crate :: generated :: audio_stream_player_3d :: OutOfRangeMode > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "The pitch and the tempo of the audio, as a multiplier of the audio sample's sample rate."] # [doc = ""] # [inline] pub fn pitch_scale (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer3DMethodTable :: get (get_api ()) . get_pitch_scale ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Returns the position in the [`AudioStream`][AudioStream]."] # [doc = ""] # [inline] pub fn get_playback_position (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer3DMethodTable :: get (get_api ()) . get_playback_position ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "The [`AudioStream`][AudioStream] resource to be played."] # [doc = ""] # [inline] pub fn stream (& self) -> Option < Ref < crate :: generated :: AudioStream , ownership :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer3DMethodTable :: get (get_api ()) . get_stream ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < Option < Ref < crate :: generated :: AudioStream , ownership :: Shared > > > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "If `true`, the playback is paused. You can resume it by setting [`stream_paused`][Self::stream_paused] to `false`."] # [doc = ""] # [inline] pub fn stream_paused (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer3DMethodTable :: get (get_api ()) . get_stream_paused ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "Returns the [`AudioStreamPlayback`][AudioStreamPlayback] object associated with this [`AudioStreamPlayer3D`][AudioStreamPlayer3D]."] # [doc = ""] # [inline] pub fn get_stream_playback (& self) -> Option < Ref < crate :: generated :: AudioStreamPlayback , ownership :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer3DMethodTable :: get (get_api ()) . get_stream_playback ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < Option < Ref < crate :: generated :: AudioStreamPlayback , ownership :: Shared > > > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "The base sound level unaffected by dampening, in decibels."] # [doc = ""] # [inline] pub fn unit_db (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer3DMethodTable :: get (get_api ()) . get_unit_db ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "The factor for the attenuation effect. Higher values make the sound audible over a larger distance."] # [doc = ""] # [inline] pub fn unit_size (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer3DMethodTable :: get (get_api ()) . get_unit_size ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "If `true`, audio plays when the AudioStreamPlayer3D node is added to scene tree."] # [doc = ""] # [inline] pub fn is_autoplay_enabled (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer3DMethodTable :: get (get_api ()) . is_autoplay_enabled ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "If `true`, the audio should be dampened according to the direction of the sound."] # [doc = ""] # [inline] pub fn is_emission_angle_enabled (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer3DMethodTable :: get (get_api ()) . is_emission_angle_enabled ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "If `true`, audio is playing."] # [doc = ""] # [inline] pub fn is_playing (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer3DMethodTable :: get (get_api ()) . is_playing ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "Plays the audio from the given position `from_position`, in seconds.\n# Default Arguments\n* `from_position` - `0.0`"] # [doc = ""] # [inline] pub fn play (& self , from_position : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer3DMethodTable :: get (get_api ()) . play ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , from_position as _) ; } } # [doc = "Sets the position from which audio will be played, in seconds."] # [doc = ""] # [inline] pub fn seek (& self , to_position : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer3DMethodTable :: get (get_api ()) . seek ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , to_position as _) ; } } # [doc = "Determines which [`Area`][Area] layers affect the sound for reverb and audio bus effects. Areas can be used to redirect [`AudioStream`][AudioStream]s so that they play in a certain audio bus. An example of how you might use this is making a \"water\" area so that sounds played in the water are redirected through an audio bus to make them sound like they are being played underwater."] # [doc = ""] # [inline] pub fn set_area_mask (& self , mask : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer3DMethodTable :: get (get_api ()) . set_area_mask ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , mask as _) ; } } # [doc = "Dampens audio using a low-pass filter above this frequency, in Hz. To disable the dampening effect entirely, set this to `20500` as this frequency is above the human hearing limit."] # [doc = ""] # [inline] pub fn set_attenuation_filter_cutoff_hz (& self , degrees : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer3DMethodTable :: get (get_api ()) . set_attenuation_filter_cutoff_hz ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , degrees as _) ; } } # [doc = "Amount how much the filter affects the loudness, in decibels."] # [doc = ""] # [inline] pub fn set_attenuation_filter_db (& self , db : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer3DMethodTable :: get (get_api ()) . set_attenuation_filter_db ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , db as _) ; } } # [doc = "Decides if audio should get quieter with distance linearly, quadratically, logarithmically, or not be affected by distance, effectively disabling attenuation."] # [doc = ""] # [inline] pub fn set_attenuation_model (& self , model : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer3DMethodTable :: get (get_api ()) . set_attenuation_model ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , model as _) ; } } # [doc = "If `true`, audio plays when the AudioStreamPlayer3D node is added to scene tree."] # [doc = ""] # [inline] pub fn set_autoplay (& self , enable : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer3DMethodTable :: get (get_api ()) . set_autoplay ; let ret = crate :: icalls :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , enable as _) ; } } # [doc = "The bus on which this audio is playing.\n**Note:** When setting this property, keep in mind that no validation is performed to see if the given name matches an existing bus. This is because audio bus layouts might be loaded after this property is set. If this given name can't be resolved at runtime, it will fall back to `\"Master\"`."] # [doc = ""] # [inline] pub fn set_bus (& self , bus : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer3DMethodTable :: get (get_api ()) . set_bus ; let ret = crate :: icalls :: icallvar__str (method_bind , self . this . sys () . as_ptr () , bus . into ()) ; } } # [doc = "Decides in which step the [Doppler effect](https://en.wikipedia.org/wiki/Doppler_effect) should be calculated.\n**Note:** Only effective if the current [`Camera`][Camera]'s [`Camera.doppler_tracking`][Camera::doppler_tracking] property is set to a value other than [`Camera.DOPPLER_TRACKING_DISABLED`][Camera::DOPPLER_TRACKING_DISABLED]."] # [doc = ""] # [inline] pub fn set_doppler_tracking (& self , mode : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer3DMethodTable :: get (get_api ()) . set_doppler_tracking ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , mode as _) ; } } # [doc = "The angle in which the audio reaches cameras undampened."] # [doc = ""] # [inline] pub fn set_emission_angle (& self , degrees : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer3DMethodTable :: get (get_api ()) . set_emission_angle ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , degrees as _) ; } } # [doc = "If `true`, the audio should be dampened according to the direction of the sound."] # [doc = ""] # [inline] pub fn set_emission_angle_enabled (& self , enabled : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer3DMethodTable :: get (get_api ()) . set_emission_angle_enabled ; let ret = crate :: icalls :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , enabled as _) ; } } # [doc = "Dampens audio if camera is outside of [`emission_angle_degrees`][Self::emission_angle_degrees] and [`emission_angle_enabled`][Self::emission_angle_enabled] is set by this factor, in decibels."] # [doc = ""] # [inline] pub fn set_emission_angle_filter_attenuation_db (& self , db : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer3DMethodTable :: get (get_api ()) . set_emission_angle_filter_attenuation_db ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , db as _) ; } } # [doc = "Sets the absolute maximum of the soundlevel, in decibels."] # [doc = ""] # [inline] pub fn set_max_db (& self , max_db : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer3DMethodTable :: get (get_api ()) . set_max_db ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , max_db as _) ; } } # [doc = "Sets the distance from which the [`out_of_range_mode`][Self::out_of_range_mode] takes effect. Has no effect if set to 0."] # [doc = ""] # [inline] pub fn set_max_distance (& self , metres : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer3DMethodTable :: get (get_api ()) . set_max_distance ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , metres as _) ; } } # [doc = "Decides if audio should pause when source is outside of [`max_distance`][Self::max_distance] range."] # [doc = ""] # [inline] pub fn set_out_of_range_mode (& self , mode : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer3DMethodTable :: get (get_api ()) . set_out_of_range_mode ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , mode as _) ; } } # [doc = "The pitch and the tempo of the audio, as a multiplier of the audio sample's sample rate."] # [doc = ""] # [inline] pub fn set_pitch_scale (& self , pitch_scale : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer3DMethodTable :: get (get_api ()) . set_pitch_scale ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , pitch_scale as _) ; } } # [doc = "The [`AudioStream`][AudioStream] resource to be played."] # [doc = ""] # [inline] pub fn set_stream (& self , stream : impl AsArg < crate :: generated :: AudioStream >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer3DMethodTable :: get (get_api ()) . set_stream ; let ret = crate :: icalls :: icallvar__obj (method_bind , self . this . sys () . as_ptr () , stream . as_arg_ptr ()) ; } } # [doc = "If `true`, the playback is paused. You can resume it by setting [`stream_paused`][Self::stream_paused] to `false`."] # [doc = ""] # [inline] pub fn set_stream_paused (& self , pause : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer3DMethodTable :: get (get_api ()) . set_stream_paused ; let ret = crate :: icalls :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , pause as _) ; } } # [doc = "The base sound level unaffected by dampening, in decibels."] # [doc = ""] # [inline] pub fn set_unit_db (& self , unit_db : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer3DMethodTable :: get (get_api ()) . set_unit_db ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , unit_db as _) ; } } # [doc = "The factor for the attenuation effect. Higher values make the sound audible over a larger distance."] # [doc = ""] # [inline] pub fn set_unit_size (& self , unit_size : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer3DMethodTable :: get (get_api ()) . set_unit_size ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , unit_size as _) ; } } # [doc = "Stops the audio."] # [doc = ""] # [inline] pub fn stop (& self) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamPlayer3DMethodTable :: get (get_api ()) . stop ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for AudioStreamPlayer3D { } unsafe impl GodotObject for AudioStreamPlayer3D { type Memory = memory :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "AudioStreamPlayer3D" } } impl QueueFree for AudioStreamPlayer3D { # [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 :: icallvar_ (method_bind , obj) ; } } impl std :: ops :: Deref for AudioStreamPlayer3D { type Target = crate :: generated :: Spatial ; # [inline] fn deref (& self) -> & crate :: generated :: Spatial { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AudioStreamPlayer3D { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: Spatial { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: Spatial > for AudioStreamPlayer3D { } unsafe impl SubClass < crate :: generated :: Node > for AudioStreamPlayer3D { } unsafe impl SubClass < crate :: generated :: Object > for AudioStreamPlayer3D { } impl Instanciable for AudioStreamPlayer3D { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { AudioStreamPlayer3D :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AudioStreamPlayer3DMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_area_mask : * mut sys :: godot_method_bind , pub get_attenuation_filter_cutoff_hz : * mut sys :: godot_method_bind , pub get_attenuation_filter_db : * mut sys :: godot_method_bind , pub get_attenuation_model : * mut sys :: godot_method_bind , pub get_bus : * mut sys :: godot_method_bind , pub get_doppler_tracking : * mut sys :: godot_method_bind , pub get_emission_angle : * mut sys :: godot_method_bind , pub get_emission_angle_filter_attenuation_db : * mut sys :: godot_method_bind , pub get_max_db : * mut sys :: godot_method_bind , pub get_max_distance : * mut sys :: godot_method_bind , pub get_out_of_range_mode : * mut sys :: godot_method_bind , pub get_pitch_scale : * mut sys :: godot_method_bind , pub get_playback_position : * mut sys :: godot_method_bind , pub get_stream : * mut sys :: godot_method_bind , pub get_stream_paused : * mut sys :: godot_method_bind , pub get_stream_playback : * mut sys :: godot_method_bind , pub get_unit_db : * mut sys :: godot_method_bind , pub get_unit_size : * mut sys :: godot_method_bind , pub is_autoplay_enabled : * mut sys :: godot_method_bind , pub is_emission_angle_enabled : * mut sys :: godot_method_bind , pub is_playing : * mut sys :: godot_method_bind , pub play : * mut sys :: godot_method_bind , pub seek : * mut sys :: godot_method_bind , pub set_area_mask : * mut sys :: godot_method_bind , pub set_attenuation_filter_cutoff_hz : * mut sys :: godot_method_bind , pub set_attenuation_filter_db : * mut sys :: godot_method_bind , pub set_attenuation_model : * mut sys :: godot_method_bind , pub set_autoplay : * mut sys :: godot_method_bind , pub set_bus : * mut sys :: godot_method_bind , pub set_doppler_tracking : * mut sys :: godot_method_bind , pub set_emission_angle : * mut sys :: godot_method_bind , pub set_emission_angle_enabled : * mut sys :: godot_method_bind , pub set_emission_angle_filter_attenuation_db : * mut sys :: godot_method_bind , pub set_max_db : * mut sys :: godot_method_bind , pub set_max_distance : * mut sys :: godot_method_bind , pub set_out_of_range_mode : * mut sys :: godot_method_bind , pub set_pitch_scale : * mut sys :: godot_method_bind , pub set_stream : * mut sys :: godot_method_bind , pub set_stream_paused : * mut sys :: godot_method_bind , pub set_unit_db : * mut sys :: godot_method_bind , pub set_unit_size : * mut sys :: godot_method_bind , pub stop : * mut sys :: godot_method_bind } impl AudioStreamPlayer3DMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AudioStreamPlayer3DMethodTable = AudioStreamPlayer3DMethodTable { class_constructor : None , get_area_mask : 0 as * mut sys :: godot_method_bind , get_attenuation_filter_cutoff_hz : 0 as * mut sys :: godot_method_bind , get_attenuation_filter_db : 0 as * mut sys :: godot_method_bind , get_attenuation_model : 0 as * mut sys :: godot_method_bind , get_bus : 0 as * mut sys :: godot_method_bind , get_doppler_tracking : 0 as * mut sys :: godot_method_bind , get_emission_angle : 0 as * mut sys :: godot_method_bind , get_emission_angle_filter_attenuation_db : 0 as * mut sys :: godot_method_bind , get_max_db : 0 as * mut sys :: godot_method_bind , get_max_distance : 0 as * mut sys :: godot_method_bind , get_out_of_range_mode : 0 as * mut sys :: godot_method_bind , get_pitch_scale : 0 as * mut sys :: godot_method_bind , get_playback_position : 0 as * mut sys :: godot_method_bind , get_stream : 0 as * mut sys :: godot_method_bind , get_stream_paused : 0 as * mut sys :: godot_method_bind , get_stream_playback : 0 as * mut sys :: godot_method_bind , get_unit_db : 0 as * mut sys :: godot_method_bind , get_unit_size : 0 as * mut sys :: godot_method_bind , is_autoplay_enabled : 0 as * mut sys :: godot_method_bind , is_emission_angle_enabled : 0 as * mut sys :: godot_method_bind , is_playing : 0 as * mut sys :: godot_method_bind , play : 0 as * mut sys :: godot_method_bind , seek : 0 as * mut sys :: godot_method_bind , set_area_mask : 0 as * mut sys :: godot_method_bind , set_attenuation_filter_cutoff_hz : 0 as * mut sys :: godot_method_bind , set_attenuation_filter_db : 0 as * mut sys :: godot_method_bind , set_attenuation_model : 0 as * mut sys :: godot_method_bind , set_autoplay : 0 as * mut sys :: godot_method_bind , set_bus : 0 as * mut sys :: godot_method_bind , set_doppler_tracking : 0 as * mut sys :: godot_method_bind , set_emission_angle : 0 as * mut sys :: godot_method_bind , set_emission_angle_enabled : 0 as * mut sys :: godot_method_bind , set_emission_angle_filter_attenuation_db : 0 as * mut sys :: godot_method_bind , set_max_db : 0 as * mut sys :: godot_method_bind , set_max_distance : 0 as * mut sys :: godot_method_bind , set_out_of_range_mode : 0 as * mut sys :: godot_method_bind , set_pitch_scale : 0 as * mut sys :: godot_method_bind , set_stream : 0 as * mut sys :: godot_method_bind , set_stream_paused : 0 as * mut sys :: godot_method_bind , set_unit_db : 0 as * mut sys :: godot_method_bind , set_unit_size : 0 as * mut sys :: godot_method_bind , stop : 0 as * mut sys :: godot_method_bind } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { AudioStreamPlayer3DMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AudioStreamPlayer3D\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_area_mask = (gd_api . godot_method_bind_get_method) (class_name , "get_area_mask\0" . as_ptr () as * const c_char) ; table . get_attenuation_filter_cutoff_hz = (gd_api . godot_method_bind_get_method) (class_name , "get_attenuation_filter_cutoff_hz\0" . as_ptr () as * const c_char) ; table . get_attenuation_filter_db = (gd_api . godot_method_bind_get_method) (class_name , "get_attenuation_filter_db\0" . as_ptr () as * const c_char) ; table . get_attenuation_model = (gd_api . godot_method_bind_get_method) (class_name , "get_attenuation_model\0" . as_ptr () as * const c_char) ; table . get_bus = (gd_api . godot_method_bind_get_method) (class_name , "get_bus\0" . as_ptr () as * const c_char) ; table . get_doppler_tracking = (gd_api . godot_method_bind_get_method) (class_name , "get_doppler_tracking\0" . as_ptr () as * const c_char) ; table . get_emission_angle = (gd_api . godot_method_bind_get_method) (class_name , "get_emission_angle\0" . as_ptr () as * const c_char) ; table . get_emission_angle_filter_attenuation_db = (gd_api . godot_method_bind_get_method) (class_name , "get_emission_angle_filter_attenuation_db\0" . as_ptr () as * const c_char) ; table . get_max_db = (gd_api . godot_method_bind_get_method) (class_name , "get_max_db\0" . as_ptr () as * const c_char) ; table . get_max_distance = (gd_api . godot_method_bind_get_method) (class_name , "get_max_distance\0" . as_ptr () as * const c_char) ; table . get_out_of_range_mode = (gd_api . godot_method_bind_get_method) (class_name , "get_out_of_range_mode\0" . as_ptr () as * const c_char) ; table . get_pitch_scale = (gd_api . godot_method_bind_get_method) (class_name , "get_pitch_scale\0" . as_ptr () as * const c_char) ; table . get_playback_position = (gd_api . godot_method_bind_get_method) (class_name , "get_playback_position\0" . as_ptr () as * const c_char) ; table . get_stream = (gd_api . godot_method_bind_get_method) (class_name , "get_stream\0" . as_ptr () as * const c_char) ; table . get_stream_paused = (gd_api . godot_method_bind_get_method) (class_name , "get_stream_paused\0" . as_ptr () as * const c_char) ; table . get_stream_playback = (gd_api . godot_method_bind_get_method) (class_name , "get_stream_playback\0" . as_ptr () as * const c_char) ; table . get_unit_db = (gd_api . godot_method_bind_get_method) (class_name , "get_unit_db\0" . as_ptr () as * const c_char) ; table . get_unit_size = (gd_api . godot_method_bind_get_method) (class_name , "get_unit_size\0" . as_ptr () as * const c_char) ; table . is_autoplay_enabled = (gd_api . godot_method_bind_get_method) (class_name , "is_autoplay_enabled\0" . as_ptr () as * const c_char) ; table . is_emission_angle_enabled = (gd_api . godot_method_bind_get_method) (class_name , "is_emission_angle_enabled\0" . as_ptr () as * const c_char) ; table . is_playing = (gd_api . godot_method_bind_get_method) (class_name , "is_playing\0" . as_ptr () as * const c_char) ; table . play = (gd_api . godot_method_bind_get_method) (class_name , "play\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_area_mask = (gd_api . godot_method_bind_get_method) (class_name , "set_area_mask\0" . as_ptr () as * const c_char) ; table . set_attenuation_filter_cutoff_hz = (gd_api . godot_method_bind_get_method) (class_name , "set_attenuation_filter_cutoff_hz\0" . as_ptr () as * const c_char) ; table . set_attenuation_filter_db = (gd_api . godot_method_bind_get_method) (class_name , "set_attenuation_filter_db\0" . as_ptr () as * const c_char) ; table . set_attenuation_model = (gd_api . godot_method_bind_get_method) (class_name , "set_attenuation_model\0" . as_ptr () as * const c_char) ; table . set_autoplay = (gd_api . godot_method_bind_get_method) (class_name , "set_autoplay\0" . as_ptr () as * const c_char) ; table . set_bus = (gd_api . godot_method_bind_get_method) (class_name , "set_bus\0" . as_ptr () as * const c_char) ; table . set_doppler_tracking = (gd_api . godot_method_bind_get_method) (class_name , "set_doppler_tracking\0" . as_ptr () as * const c_char) ; table . set_emission_angle = (gd_api . godot_method_bind_get_method) (class_name , "set_emission_angle\0" . as_ptr () as * const c_char) ; table . set_emission_angle_enabled = (gd_api . godot_method_bind_get_method) (class_name , "set_emission_angle_enabled\0" . as_ptr () as * const c_char) ; table . set_emission_angle_filter_attenuation_db = (gd_api . godot_method_bind_get_method) (class_name , "set_emission_angle_filter_attenuation_db\0" . as_ptr () as * const c_char) ; table . set_max_db = (gd_api . godot_method_bind_get_method) (class_name , "set_max_db\0" . as_ptr () as * const c_char) ; table . set_max_distance = (gd_api . godot_method_bind_get_method) (class_name , "set_max_distance\0" . as_ptr () as * const c_char) ; table . set_out_of_range_mode = (gd_api . godot_method_bind_get_method) (class_name , "set_out_of_range_mode\0" . as_ptr () as * const c_char) ; table . set_pitch_scale = (gd_api . godot_method_bind_get_method) (class_name , "set_pitch_scale\0" . as_ptr () as * const c_char) ; table . set_stream = (gd_api . godot_method_bind_get_method) (class_name , "set_stream\0" . as_ptr () as * const c_char) ; table . set_stream_paused = (gd_api . godot_method_bind_get_method) (class_name , "set_stream_paused\0" . as_ptr () as * const c_char) ; table . set_unit_db = (gd_api . godot_method_bind_get_method) (class_name , "set_unit_db\0" . as_ptr () as * const c_char) ; table . set_unit_size = (gd_api . godot_method_bind_get_method) (class_name , "set_unit_size\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) ; } } } [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:519:5948 [INFO] [stdout] | [INFO] [stdout] 519 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 519 | # ! [doc = "This module contains types related to the API class [`AudioStreamRandomPitch`][super::AudioStreamRandomPitch]."] pub (crate) mod private { # [doc = "`core class AudioStreamRandomPitch` inherits `AudioStream` (reference-counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/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 `Ownership` in these types tracks whether\nownership 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 { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AudioStreamRandomPitch ; 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 , ownership :: 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`][AudioStream]."] # [doc = ""] # [inline] pub fn audio_stream (& self) -> Option < Ref < crate :: generated :: AudioStream , ownership :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamRandomPitchMethodTable :: get (get_api ()) . get_audio_stream ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < Option < Ref < crate :: generated :: AudioStream , ownership :: Shared > > > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [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 :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "The current [`AudioStream`][AudioStream]."] # [doc = ""] # [inline] pub fn set_audio_stream (& self , stream : impl AsArg < crate :: generated :: AudioStream >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamRandomPitchMethodTable :: get (get_api ()) . set_audio_stream ; let ret = crate :: icalls :: icallvar__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 :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , scale as _) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for AudioStreamRandomPitch { } unsafe impl GodotObject for AudioStreamRandomPitch { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AudioStreamRandomPitch" } } impl std :: ops :: Deref for AudioStreamRandomPitch { type Target = crate :: generated :: AudioStream ; # [inline] fn deref (& self) -> & crate :: generated :: AudioStream { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AudioStreamRandomPitch { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: AudioStream { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: AudioStream > for AudioStreamRandomPitch { } unsafe impl SubClass < crate :: generated :: Resource > for AudioStreamRandomPitch { } unsafe impl SubClass < crate :: generated :: Reference > for AudioStreamRandomPitch { } unsafe impl SubClass < crate :: generated :: Object > for AudioStreamRandomPitch { } impl Instanciable for AudioStreamRandomPitch { # [inline] fn construct () -> Ref < Self , ownership :: 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 } ; &raw 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 = std :: sync :: 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 [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:525:15097 [INFO] [stdout] | [INFO] [stdout] 525 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 525 | # ! [doc = "This module contains types related to the API class [`AudioStreamSample`][super::AudioStreamSample]."] pub (crate) mod private { # [doc = "`core class AudioStreamSample` inherits `AudioStream` (reference-counted).\n\nThis class has related types in the [`audio_stream_sample`][super::audio_stream_sample] module."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_audiostreamsample.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\nAudioStreamSample 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 `Ownership` in these types tracks whether\nownership 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 AudioStreamSample { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: AudioStreamSample ; # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct Format (pub i64) ; impl Format { pub const _8_BITS : Format = Format (0i64) ; pub const _16_BITS : Format = Format (1i64) ; pub const IMA_ADPCM : Format = Format (2i64) ; } impl From < i64 > for Format { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < Format > for i64 { # [inline] fn from (v : Format) -> Self { v . 0 } } impl FromVariant for Format { # [inline] fn from_variant (v : & Variant) -> Result < Self , FromVariantError > { i64 :: from_variant (v) . map (Self :: from) } } # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct LoopMode (pub i64) ; impl LoopMode { pub const DISABLED : LoopMode = LoopMode (0i64) ; pub const FORWARD : LoopMode = LoopMode (1i64) ; pub const PING_PONG : LoopMode = LoopMode (2i64) ; pub const BACKWARD : LoopMode = LoopMode (3i64) ; } impl From < i64 > for LoopMode { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < LoopMode > for i64 { # [inline] fn from (v : LoopMode) -> Self { v . 0 } } impl FromVariant for LoopMode { # [inline] fn from_variant (v : & Variant) -> Result < Self , FromVariantError > { i64 :: from_variant (v) . map (Self :: from) } } # [doc = "Constants"] # [allow (non_upper_case_globals)] impl AudioStreamSample { pub const FORMAT_8_BITS : i64 = 0i64 ; pub const LOOP_DISABLED : i64 = 0i64 ; pub const FORMAT_16_BITS : i64 = 1i64 ; pub const LOOP_FORWARD : i64 = 1i64 ; pub const FORMAT_IMA_ADPCM : i64 = 2i64 ; pub const LOOP_PING_PONG : i64 = 2i64 ; pub const LOOP_BACKWARD : i64 = 3i64 ; } impl AudioStreamSample { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = AudioStreamSampleMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "Contains the audio data in bytes.\n**Note:** This property expects signed PCM8 data. To convert unsigned PCM8 to signed PCM8, subtract 128 from each byte."] # [doc = ""] # [inline] pub fn data (& self) -> PoolArray < u8 > { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamSampleMethodTable :: get (get_api ()) . get_data ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < PoolArray < u8 > > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Audio format. See [`Format`][Format] constants for values."] # [doc = ""] # [inline] pub fn format (& self) -> crate :: generated :: audio_stream_sample :: Format { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamSampleMethodTable :: get (get_api ()) . get_format ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < crate :: generated :: audio_stream_sample :: Format > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "The loop start point (in number of samples, relative to the beginning of the sample). This information will be imported automatically from the WAV file if present."] # [doc = ""] # [inline] pub fn loop_begin (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamSampleMethodTable :: get (get_api ()) . get_loop_begin ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "The loop end point (in number of samples, relative to the beginning of the sample). This information will be imported automatically from the WAV file if present."] # [doc = ""] # [inline] pub fn loop_end (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamSampleMethodTable :: get (get_api ()) . get_loop_end ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "The loop mode. This information will be imported automatically from the WAV file if present. See [`LoopMode`][LoopMode] constants for values."] # [doc = ""] # [inline] pub fn loop_mode (& self) -> crate :: generated :: audio_stream_sample :: LoopMode { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamSampleMethodTable :: get (get_api ()) . get_loop_mode ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < crate :: generated :: audio_stream_sample :: LoopMode > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "The sample rate for mixing this audio. Higher values require more storage space, but result in better quality.\nIn games, common sample rates in use are `11025`, `16000`, `22050`, `32000`, `44100`, and `48000`.\nAccording to the [Nyquist-Shannon sampling theorem](https://en.wikipedia.org/wiki/Nyquist%E2%80%93Shannon_sampling_theorem), there is no quality difference to human hearing when going past 40,000 Hz (since most humans can only hear up to ~20,000 Hz, often less). If you are using lower-pitched sounds such as voices, lower sample rates such as `32000` or `22050` may be usable with no loss in quality."] # [doc = ""] # [inline] pub fn mix_rate (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamSampleMethodTable :: get (get_api ()) . get_mix_rate ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "If `true`, audio is stereo."] # [doc = ""] # [inline] pub fn is_stereo (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamSampleMethodTable :: get (get_api ()) . is_stereo ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "Saves the AudioStreamSample as a WAV file to `path`. Samples with IMA ADPCM format can't be saved.\n**Note:** A `.wav` extension is automatically appended to `path` if it is missing."] # [doc = ""] # [inline] pub fn save_to_wav (& self , path : impl Into < GodotString >) -> GodotResult { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamSampleMethodTable :: get (get_api ()) . save_to_wav ; let ret = crate :: icalls :: icallvar__str (method_bind , self . this . sys () . as_ptr () , path . into ()) ; GodotError :: result_from_sys (sys :: godot_error :: from_variant (& ret) . expect ("Unexpected variant type")) } } # [doc = "Contains the audio data in bytes.\n**Note:** This property expects signed PCM8 data. To convert unsigned PCM8 to signed PCM8, subtract 128 from each byte."] # [doc = ""] # [inline] pub fn set_data (& self , data : PoolArray < u8 >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamSampleMethodTable :: get (get_api ()) . set_data ; let ret = crate :: icalls :: icallvar__bytearr (method_bind , self . this . sys () . as_ptr () , data) ; } } # [doc = "Audio format. See [`Format`][Format] constants for values."] # [doc = ""] # [inline] pub fn set_format (& self , format : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamSampleMethodTable :: get (get_api ()) . set_format ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , format as _) ; } } # [doc = "The loop start point (in number of samples, relative to the beginning of the sample). This information will be imported automatically from the WAV file if present."] # [doc = ""] # [inline] pub fn set_loop_begin (& self , loop_begin : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamSampleMethodTable :: get (get_api ()) . set_loop_begin ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , loop_begin as _) ; } } # [doc = "The loop end point (in number of samples, relative to the beginning of the sample). This information will be imported automatically from the WAV file if present."] # [doc = ""] # [inline] pub fn set_loop_end (& self , loop_end : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamSampleMethodTable :: get (get_api ()) . set_loop_end ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , loop_end as _) ; } } # [doc = "The loop mode. This information will be imported automatically from the WAV file if present. See [`LoopMode`][LoopMode] constants for values."] # [doc = ""] # [inline] pub fn set_loop_mode (& self , loop_mode : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamSampleMethodTable :: get (get_api ()) . set_loop_mode ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , loop_mode as _) ; } } # [doc = "The sample rate for mixing this audio. Higher values require more storage space, but result in better quality.\nIn games, common sample rates in use are `11025`, `16000`, `22050`, `32000`, `44100`, and `48000`.\nAccording to the [Nyquist-Shannon sampling theorem](https://en.wikipedia.org/wiki/Nyquist%E2%80%93Shannon_sampling_theorem), there is no quality difference to human hearing when going past 40,000 Hz (since most humans can only hear up to ~20,000 Hz, often less). If you are using lower-pitched sounds such as voices, lower sample rates such as `32000` or `22050` may be usable with no loss in quality."] # [doc = ""] # [inline] pub fn set_mix_rate (& self , mix_rate : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamSampleMethodTable :: get (get_api ()) . set_mix_rate ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , mix_rate as _) ; } } # [doc = "If `true`, audio is stereo."] # [doc = ""] # [inline] pub fn set_stereo (& self , stereo : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = AudioStreamSampleMethodTable :: get (get_api ()) . set_stereo ; let ret = crate :: icalls :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , stereo as _) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for AudioStreamSample { } unsafe impl GodotObject for AudioStreamSample { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "AudioStreamSample" } } impl std :: ops :: Deref for AudioStreamSample { type Target = crate :: generated :: AudioStream ; # [inline] fn deref (& self) -> & crate :: generated :: AudioStream { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for AudioStreamSample { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: AudioStream { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: AudioStream > for AudioStreamSample { } unsafe impl SubClass < crate :: generated :: Resource > for AudioStreamSample { } unsafe impl SubClass < crate :: generated :: Reference > for AudioStreamSample { } unsafe impl SubClass < crate :: generated :: Object > for AudioStreamSample { } impl Instanciable for AudioStreamSample { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { AudioStreamSample :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct AudioStreamSampleMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_data : * mut sys :: godot_method_bind , pub get_format : * mut sys :: godot_method_bind , pub get_loop_begin : * mut sys :: godot_method_bind , pub get_loop_end : * mut sys :: godot_method_bind , pub get_loop_mode : * mut sys :: godot_method_bind , pub get_mix_rate : * mut sys :: godot_method_bind , pub is_stereo : * mut sys :: godot_method_bind , pub save_to_wav : * mut sys :: godot_method_bind , pub set_data : * mut sys :: godot_method_bind , pub set_format : * mut sys :: godot_method_bind , pub set_loop_begin : * mut sys :: godot_method_bind , pub set_loop_end : * mut sys :: godot_method_bind , pub set_loop_mode : * mut sys :: godot_method_bind , pub set_mix_rate : * mut sys :: godot_method_bind , pub set_stereo : * mut sys :: godot_method_bind } impl AudioStreamSampleMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : AudioStreamSampleMethodTable = AudioStreamSampleMethodTable { class_constructor : None , get_data : 0 as * mut sys :: godot_method_bind , get_format : 0 as * mut sys :: godot_method_bind , get_loop_begin : 0 as * mut sys :: godot_method_bind , get_loop_end : 0 as * mut sys :: godot_method_bind , get_loop_mode : 0 as * mut sys :: godot_method_bind , get_mix_rate : 0 as * mut sys :: godot_method_bind , is_stereo : 0 as * mut sys :: godot_method_bind , save_to_wav : 0 as * mut sys :: godot_method_bind , set_data : 0 as * mut sys :: godot_method_bind , set_format : 0 as * mut sys :: godot_method_bind , set_loop_begin : 0 as * mut sys :: godot_method_bind , set_loop_end : 0 as * mut sys :: godot_method_bind , set_loop_mode : 0 as * mut sys :: godot_method_bind , set_mix_rate : 0 as * mut sys :: godot_method_bind , set_stereo : 0 as * mut sys :: godot_method_bind } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { AudioStreamSampleMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "AudioStreamSample\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_data = (gd_api . godot_method_bind_get_method) (class_name , "get_data\0" . as_ptr () as * const c_char) ; table . get_format = (gd_api . godot_method_bind_get_method) (class_name , "get_format\0" . as_ptr () as * const c_char) ; table . get_loop_begin = (gd_api . godot_method_bind_get_method) (class_name , "get_loop_begin\0" . as_ptr () as * const c_char) ; table . get_loop_end = (gd_api . godot_method_bind_get_method) (class_name , "get_loop_end\0" . as_ptr () as * const c_char) ; table . get_loop_mode = (gd_api . godot_method_bind_get_method) (class_name , "get_loop_mode\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 . is_stereo = (gd_api . godot_method_bind_get_method) (class_name , "is_stereo\0" . as_ptr () as * const c_char) ; table . save_to_wav = (gd_api . godot_method_bind_get_method) (class_name , "save_to_wav\0" . as_ptr () as * const c_char) ; table . set_data = (gd_api . godot_method_bind_get_method) (class_name , "set_data\0" . as_ptr () as * const c_char) ; table . set_format = (gd_api . godot_method_bind_get_method) (class_name , "set_format\0" . as_ptr () as * const c_char) ; table . set_loop_begin = (gd_api . godot_method_bind_get_method) (class_name , "set_loop_begin\0" . as_ptr () as * const c_char) ; table . set_loop_end = (gd_api . godot_method_bind_get_method) (class_name , "set_loop_end\0" . as_ptr () as * const c_char) ; table . set_loop_mode = (gd_api . godot_method_bind_get_method) (class_name , "set_loop_mode\0" . as_ptr () as * const c_char) ; table . set_mix_rate = (gd_api . godot_method_bind_get_method) (class_name , "set_mix_rate\0" . as_ptr () as * const c_char) ; table . set_stereo = (gd_api . godot_method_bind_get_method) (class_name , "set_stereo\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:531:7665 [INFO] [stdout] | [INFO] [stdout] 531 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 531 | # ! [doc = "This module contains types related to the API class [`BackBufferCopy`][super::BackBufferCopy]."] pub (crate) mod private { # [doc = "`core class BackBufferCopy` inherits `Node2D` (manually managed).\n\nThis class has related types in the [`back_buffer_copy`][super::back_buffer_copy] module."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_backbuffercopy.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`BackBufferCopy` 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\nBackBufferCopy 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 `Ownership` in these types tracks whether\nownership 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 BackBufferCopy { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: BackBufferCopy ; # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct CopyMode (pub i64) ; impl CopyMode { pub const DISABLED : CopyMode = CopyMode (0i64) ; pub const RECT : CopyMode = CopyMode (1i64) ; pub const VIEWPORT : CopyMode = CopyMode (2i64) ; } impl From < i64 > for CopyMode { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < CopyMode > for i64 { # [inline] fn from (v : CopyMode) -> Self { v . 0 } } impl FromVariant for CopyMode { # [inline] fn from_variant (v : & Variant) -> Result < Self , FromVariantError > { i64 :: from_variant (v) . map (Self :: from) } } # [doc = "Constants"] # [allow (non_upper_case_globals)] impl BackBufferCopy { pub const COPY_MODE_DISABLED : i64 = 0i64 ; pub const COPY_MODE_RECT : i64 = 1i64 ; pub const COPY_MODE_VIEWPORT : i64 = 2i64 ; } impl BackBufferCopy { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = BackBufferCopyMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "Buffer mode. See [`CopyMode`][CopyMode] constants."] # [doc = ""] # [inline] pub fn copy_mode (& self) -> crate :: generated :: back_buffer_copy :: CopyMode { unsafe { let method_bind : * mut sys :: godot_method_bind = BackBufferCopyMethodTable :: get (get_api ()) . get_copy_mode ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < crate :: generated :: back_buffer_copy :: CopyMode > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "The area covered by the BackBufferCopy. Only used if [`copy_mode`][Self::copy_mode] is [`COPY_MODE_RECT`][Self::COPY_MODE_RECT]."] # [doc = ""] # [inline] pub fn rect (& self) -> Rect2 { unsafe { let method_bind : * mut sys :: godot_method_bind = BackBufferCopyMethodTable :: get (get_api ()) . get_rect ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < Rect2 > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Buffer mode. See [`CopyMode`][CopyMode] constants."] # [doc = ""] # [inline] pub fn set_copy_mode (& self , copy_mode : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = BackBufferCopyMethodTable :: get (get_api ()) . set_copy_mode ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , copy_mode as _) ; } } # [doc = "The area covered by the BackBufferCopy. Only used if [`copy_mode`][Self::copy_mode] is [`COPY_MODE_RECT`][Self::COPY_MODE_RECT]."] # [doc = ""] # [inline] pub fn set_rect (& self , rect : Rect2) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = BackBufferCopyMethodTable :: get (get_api ()) . set_rect ; let ret = crate :: icalls :: icallvar__rect2 (method_bind , self . this . sys () . as_ptr () , rect) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for BackBufferCopy { } unsafe impl GodotObject for BackBufferCopy { type Memory = memory :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "BackBufferCopy" } } impl QueueFree for BackBufferCopy { # [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 :: icallvar_ (method_bind , obj) ; } } impl std :: ops :: Deref for BackBufferCopy { type Target = crate :: generated :: Node2D ; # [inline] fn deref (& self) -> & crate :: generated :: Node2D { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for BackBufferCopy { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: Node2D { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: Node2D > for BackBufferCopy { } unsafe impl SubClass < crate :: generated :: CanvasItem > for BackBufferCopy { } unsafe impl SubClass < crate :: generated :: Node > for BackBufferCopy { } unsafe impl SubClass < crate :: generated :: Object > for BackBufferCopy { } impl Instanciable for BackBufferCopy { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { BackBufferCopy :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct BackBufferCopyMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_copy_mode : * mut sys :: godot_method_bind , pub get_rect : * mut sys :: godot_method_bind , pub set_copy_mode : * mut sys :: godot_method_bind , pub set_rect : * mut sys :: godot_method_bind } impl BackBufferCopyMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : BackBufferCopyMethodTable = BackBufferCopyMethodTable { class_constructor : None , get_copy_mode : 0 as * mut sys :: godot_method_bind , get_rect : 0 as * mut sys :: godot_method_bind , set_copy_mode : 0 as * mut sys :: godot_method_bind , set_rect : 0 as * mut sys :: godot_method_bind } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { BackBufferCopyMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "BackBufferCopy\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_copy_mode = (gd_api . godot_method_bind_get_method) (class_name , "get_copy_mode\0" . as_ptr () as * const c_char) ; table . get_rect = (gd_api . godot_method_bind_get_method) (class_name , "get_rect\0" . as_ptr () as * const c_char) ; table . set_copy_mode = (gd_api . godot_method_bind_get_method) (class_name , "set_copy_mode\0" . as_ptr () as * const c_char) ; table . set_rect = (gd_api . godot_method_bind_get_method) (class_name , "set_rect\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:537:40224 [INFO] [stdout] | [INFO] [stdout] 537 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 537 | # ! [doc = "This module contains types related to the API class [`BakedLightmap`][super::BakedLightmap]."] pub (crate) mod private { # [doc = "`core class BakedLightmap` inherits `VisualInstance` (manually managed).\n\nThis class has related types in the [`baked_lightmap`][super::baked_lightmap] module."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_bakedlightmap.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`BakedLightmap` 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\nBakedLightmap inherits methods from:\n - [VisualInstance](struct.VisualInstance.html)\n - [CullInstance](struct.CullInstance.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 `Ownership` in these types tracks whether\nownership 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 BakedLightmap { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: BakedLightmap ; # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct BakeError (pub i64) ; impl BakeError { pub const OK : BakeError = BakeError (0i64) ; pub const NO_SAVE_PATH : BakeError = BakeError (1i64) ; pub const NO_MESHES : BakeError = BakeError (2i64) ; pub const CANT_CREATE_IMAGE : BakeError = BakeError (3i64) ; pub const LIGHTMAP_SIZE : BakeError = BakeError (4i64) ; pub const INVALID_MESH : BakeError = BakeError (5i64) ; pub const USER_ABORTED : BakeError = BakeError (6i64) ; pub const NO_LIGHTMAPPER : BakeError = BakeError (7i64) ; pub const NO_ROOT : BakeError = BakeError (8i64) ; } impl From < i64 > for BakeError { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < BakeError > for i64 { # [inline] fn from (v : BakeError) -> Self { v . 0 } } impl FromVariant for BakeError { # [inline] fn from_variant (v : & Variant) -> Result < Self , FromVariantError > { i64 :: from_variant (v) . map (Self :: from) } } # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct BakeQuality (pub i64) ; impl BakeQuality { pub const LOW : BakeQuality = BakeQuality (0i64) ; pub const MEDIUM : BakeQuality = BakeQuality (1i64) ; pub const HIGH : BakeQuality = BakeQuality (2i64) ; pub const ULTRA : BakeQuality = BakeQuality (3i64) ; } impl From < i64 > for BakeQuality { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < BakeQuality > for i64 { # [inline] fn from (v : BakeQuality) -> Self { v . 0 } } impl FromVariant for BakeQuality { # [inline] fn from_variant (v : & Variant) -> Result < Self , FromVariantError > { i64 :: from_variant (v) . map (Self :: from) } } # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct EnvironmentMode (pub i64) ; impl EnvironmentMode { pub const DISABLED : EnvironmentMode = EnvironmentMode (0i64) ; pub const SCENE : EnvironmentMode = EnvironmentMode (1i64) ; pub const CUSTOM_SKY : EnvironmentMode = EnvironmentMode (2i64) ; pub const CUSTOM_COLOR : EnvironmentMode = EnvironmentMode (3i64) ; } impl From < i64 > for EnvironmentMode { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < EnvironmentMode > for i64 { # [inline] fn from (v : EnvironmentMode) -> Self { v . 0 } } impl FromVariant for EnvironmentMode { # [inline] fn from_variant (v : & Variant) -> Result < Self , FromVariantError > { i64 :: from_variant (v) . map (Self :: from) } } # [doc = "Constants"] # [allow (non_upper_case_globals)] impl BakedLightmap { pub const BAKE_ERROR_OK : i64 = 0i64 ; pub const BAKE_QUALITY_LOW : i64 = 0i64 ; pub const ENVIRONMENT_MODE_DISABLED : i64 = 0i64 ; pub const BAKE_ERROR_NO_SAVE_PATH : i64 = 1i64 ; pub const BAKE_QUALITY_MEDIUM : i64 = 1i64 ; pub const ENVIRONMENT_MODE_SCENE : i64 = 1i64 ; pub const BAKE_ERROR_NO_MESHES : i64 = 2i64 ; pub const BAKE_QUALITY_HIGH : i64 = 2i64 ; pub const ENVIRONMENT_MODE_CUSTOM_SKY : i64 = 2i64 ; pub const BAKE_ERROR_CANT_CREATE_IMAGE : i64 = 3i64 ; pub const BAKE_QUALITY_ULTRA : i64 = 3i64 ; pub const ENVIRONMENT_MODE_CUSTOM_COLOR : i64 = 3i64 ; pub const BAKE_ERROR_LIGHTMAP_SIZE : i64 = 4i64 ; pub const BAKE_ERROR_INVALID_MESH : i64 = 5i64 ; pub const BAKE_ERROR_USER_ABORTED : i64 = 6i64 ; pub const BAKE_ERROR_NO_LIGHTMAPPER : i64 = 7i64 ; pub const BAKE_ERROR_NO_ROOT : i64 = 8i64 ; } impl BakedLightmap { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = BakedLightmapMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "Bakes the lightmap, scanning from the given `from_node` root and saves the resulting [`BakedLightmapData`][BakedLightmapData] in `data_save_path`. If no root node is provided, parent of this node will be used as root instead. If no save path is provided it will try to match the path from the current [`light_data`][Self::light_data].\n# Default Arguments\n* `from_node` - `null`\n* `data_save_path` - `\"\"`"] # [doc = ""] # [inline] pub fn bake (& self , from_node : impl AsArg < crate :: generated :: Node > , data_save_path : impl Into < GodotString >) -> crate :: generated :: baked_lightmap :: BakeError { unsafe { let method_bind : * mut sys :: godot_method_bind = BakedLightmapMethodTable :: get (get_api ()) . bake ; let ret = crate :: icalls :: icallvar__obj_str (method_bind , self . this . sys () . as_ptr () , from_node . as_arg_ptr () , data_save_path . into ()) ; < crate :: generated :: baked_lightmap :: BakeError > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Determines the amount of samples per texel used in indirect light baking. The amount of samples for each quality level can be configured in the project settings."] # [doc = ""] # [inline] pub fn bake_quality (& self) -> crate :: generated :: baked_lightmap :: BakeQuality { unsafe { let method_bind : * mut sys :: godot_method_bind = BakedLightmapMethodTable :: get (get_api ()) . get_bake_quality ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < crate :: generated :: baked_lightmap :: BakeQuality > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Raycasting bias used during baking to avoid floating point precision issues."] # [doc = ""] # [inline] pub fn bias (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = BakedLightmapMethodTable :: get (get_api ()) . get_bias ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "The energy multiplier for each bounce. Higher values will make indirect lighting brighter. A value of `1.0` represents physically accurate behavior, but higher values can be used to make indirect lighting propagate more visibly when using a low number of bounces. This can be used to speed up bake times by lowering the number of [`bounces`][Self::bounces] then increasing [`bounce_indirect_energy`][Self::bounce_indirect_energy]. Unlike [`BakedLightmapData.energy`][BakedLightmapData::energy], this property does not affect direct lighting emitted by light nodes, emissive materials and the environment.\n**Note:** [`bounce_indirect_energy`][Self::bounce_indirect_energy] only has an effect if [`bounces`][Self::bounces] is set to a value greater than or equal to `1`."] # [doc = ""] # [inline] pub fn bounce_indirect_energy (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = BakedLightmapMethodTable :: get (get_api ()) . get_bounce_indirect_energy ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Number of light bounces that are taken into account during baking. See also [`bounce_indirect_energy`][Self::bounce_indirect_energy]."] # [doc = ""] # [inline] pub fn bounces (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = BakedLightmapMethodTable :: get (get_api ()) . get_bounces ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "Grid size used for real-time capture information on dynamic objects."] # [doc = ""] # [inline] pub fn capture_cell_size (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = BakedLightmapMethodTable :: get (get_api ()) . get_capture_cell_size ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "When enabled, an octree containing the scene's lighting information will be computed. This octree will then be used to light dynamic objects in the scene."] # [doc = ""] # [inline] pub fn capture_enabled (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = BakedLightmapMethodTable :: get (get_api ()) . get_capture_enabled ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "Bias value to reduce the amount of light propagation in the captured octree."] # [doc = ""] # [inline] pub fn capture_propagation (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = BakedLightmapMethodTable :: get (get_api ()) . get_capture_propagation ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Bake quality of the capture data."] # [doc = ""] # [inline] pub fn capture_quality (& self) -> crate :: generated :: baked_lightmap :: BakeQuality { unsafe { let method_bind : * mut sys :: godot_method_bind = BakedLightmapMethodTable :: get (get_api ()) . get_capture_quality ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < crate :: generated :: baked_lightmap :: BakeQuality > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "If a baked mesh doesn't have a UV2 size hint, this value will be used to roughly compute a suitable lightmap size."] # [doc = ""] # [inline] pub fn default_texels_per_unit (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = BakedLightmapMethodTable :: get (get_api ()) . get_default_texels_per_unit ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "The environment color when [`environment_mode`][Self::environment_mode] is set to [`ENVIRONMENT_MODE_CUSTOM_COLOR`][Self::ENVIRONMENT_MODE_CUSTOM_COLOR]."] # [doc = ""] # [inline] pub fn environment_custom_color (& self) -> Color { unsafe { let method_bind : * mut sys :: godot_method_bind = BakedLightmapMethodTable :: get (get_api ()) . get_environment_custom_color ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < Color > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "The energy scaling factor when when [`environment_mode`][Self::environment_mode] is set to [`ENVIRONMENT_MODE_CUSTOM_COLOR`][Self::ENVIRONMENT_MODE_CUSTOM_COLOR] or [`ENVIRONMENT_MODE_CUSTOM_SKY`][Self::ENVIRONMENT_MODE_CUSTOM_SKY]."] # [doc = ""] # [inline] pub fn environment_custom_energy (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = BakedLightmapMethodTable :: get (get_api ()) . get_environment_custom_energy ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "The [`Sky`][Sky] resource to use when [`environment_mode`][Self::environment_mode] is set o [`ENVIRONMENT_MODE_CUSTOM_SKY`][Self::ENVIRONMENT_MODE_CUSTOM_SKY]."] # [doc = ""] # [inline] pub fn environment_custom_sky (& self) -> Option < Ref < crate :: generated :: Sky , ownership :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = BakedLightmapMethodTable :: get (get_api ()) . get_environment_custom_sky ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < Option < Ref < crate :: generated :: Sky , ownership :: Shared > > > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "The rotation of the baked custom sky."] # [doc = ""] # [inline] pub fn environment_custom_sky_rotation_degrees (& self) -> Vector3 { unsafe { let method_bind : * mut sys :: godot_method_bind = BakedLightmapMethodTable :: get (get_api ()) . get_environment_custom_sky_rotation_degrees ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < Vector3 > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Minimum ambient light for all the lightmap texels. This doesn't take into account any occlusion from the scene's geometry, it simply ensures a minimum amount of light on all the lightmap texels. Can be used for artistic control on shadow color."] # [doc = ""] # [inline] pub fn environment_min_light (& self) -> Color { unsafe { let method_bind : * mut sys :: godot_method_bind = BakedLightmapMethodTable :: get (get_api ()) . get_environment_min_light ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < Color > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Decides which environment to use during baking."] # [doc = ""] # [inline] pub fn environment_mode (& self) -> crate :: generated :: baked_lightmap :: EnvironmentMode { unsafe { let method_bind : * mut sys :: godot_method_bind = BakedLightmapMethodTable :: get (get_api ()) . get_environment_mode ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < crate :: generated :: baked_lightmap :: EnvironmentMode > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Size of the baked lightmap. Only meshes inside this region will be included in the baked lightmap, also used as the bounds of the captured region for dynamic lighting."] # [doc = ""] # [inline] pub fn extents (& self) -> Vector3 { unsafe { let method_bind : * mut sys :: godot_method_bind = BakedLightmapMethodTable :: get (get_api ()) . get_extents ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < Vector3 > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Deprecated, in previous versions it determined the location where lightmaps were be saved."] # [doc = ""] # [inline] pub fn image_path (& self) -> GodotString { unsafe { let method_bind : * mut sys :: godot_method_bind = BakedLightmapMethodTable :: get (get_api ()) . get_image_path ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < GodotString > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "The calculated light data."] # [doc = ""] # [inline] pub fn light_data (& self) -> Option < Ref < crate :: generated :: BakedLightmapData , ownership :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = BakedLightmapMethodTable :: get (get_api ()) . get_light_data ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < Option < Ref < crate :: generated :: BakedLightmapData , ownership :: Shared > > > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Maximum size of each lightmap layer, only used when [`atlas_generate`][Self::atlas_generate] is enabled."] # [doc = ""] # [inline] pub fn max_atlas_size (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = BakedLightmapMethodTable :: get (get_api ()) . get_max_atlas_size ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "If `true`, the lightmapper will merge the textures for all meshes into one or several large layered textures. If `false`, every mesh will get its own lightmap texture, which is less efficient.\n**Note:** Atlas lightmap rendering is only supported in GLES3, _not_ GLES2. Non-atlas lightmap rendering is supported by both GLES3 and GLES2. If [member ProjectSettings.rendering/quality/driver/fallback_to_gles2] is `true`, consider baking lightmaps with [`atlas_generate`][Self::atlas_generate] set to `false` so that the resulting lightmap is visible in both GLES3 and GLES2."] # [doc = ""] # [inline] pub fn is_generate_atlas_enabled (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = BakedLightmapMethodTable :: get (get_api ()) . is_generate_atlas_enabled ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "Store full color values in the lightmap textures. When disabled, lightmap textures will store a single brightness channel. Can be disabled to reduce disk usage if the scene contains only white lights or you don't mind losing color information in indirect lighting."] # [doc = ""] # [inline] pub fn is_using_color (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = BakedLightmapMethodTable :: get (get_api ()) . is_using_color ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "When enabled, a lightmap denoiser will be used to reduce the noise inherent to Monte Carlo based global illumination."] # [doc = ""] # [inline] pub fn is_using_denoiser (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = BakedLightmapMethodTable :: get (get_api ()) . is_using_denoiser ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "If `true`, stores the lightmap textures in a high dynamic range format (EXR). If `false`, stores the lightmap texture in a low dynamic range PNG image. This can be set to `false` to reduce disk usage, but light values over 1.0 will be clamped and you may see banding caused by the reduced precision.\n**Note:** Setting [`use_hdr`][Self::use_hdr] to `true` will decrease lightmap banding even when using the GLES2 backend or if [member ProjectSettings.rendering/quality/depth/hdr] is `false`."] # [doc = ""] # [inline] pub fn is_using_hdr (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = BakedLightmapMethodTable :: get (get_api ()) . is_using_hdr ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "Determines the amount of samples per texel used in indirect light baking. The amount of samples for each quality level can be configured in the project settings."] # [doc = ""] # [inline] pub fn set_bake_quality (& self , quality : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = BakedLightmapMethodTable :: get (get_api ()) . set_bake_quality ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , quality as _) ; } } # [doc = "Raycasting bias used during baking to avoid floating point precision issues."] # [doc = ""] # [inline] pub fn set_bias (& self , bias : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = BakedLightmapMethodTable :: get (get_api ()) . set_bias ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , bias as _) ; } } # [doc = "The energy multiplier for each bounce. Higher values will make indirect lighting brighter. A value of `1.0` represents physically accurate behavior, but higher values can be used to make indirect lighting propagate more visibly when using a low number of bounces. This can be used to speed up bake times by lowering the number of [`bounces`][Self::bounces] then increasing [`bounce_indirect_energy`][Self::bounce_indirect_energy]. Unlike [`BakedLightmapData.energy`][BakedLightmapData::energy], this property does not affect direct lighting emitted by light nodes, emissive materials and the environment.\n**Note:** [`bounce_indirect_energy`][Self::bounce_indirect_energy] only has an effect if [`bounces`][Self::bounces] is set to a value greater than or equal to `1`."] # [doc = ""] # [inline] pub fn set_bounce_indirect_energy (& self , bounce_indirect_energy : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = BakedLightmapMethodTable :: get (get_api ()) . set_bounce_indirect_energy ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , bounce_indirect_energy as _) ; } } # [doc = "Number of light bounces that are taken into account during baking. See also [`bounce_indirect_energy`][Self::bounce_indirect_energy]."] # [doc = ""] # [inline] pub fn set_bounces (& self , bounces : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = BakedLightmapMethodTable :: get (get_api ()) . set_bounces ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , bounces as _) ; } } # [doc = "Grid size used for real-time capture information on dynamic objects."] # [doc = ""] # [inline] pub fn set_capture_cell_size (& self , capture_cell_size : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = BakedLightmapMethodTable :: get (get_api ()) . set_capture_cell_size ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , capture_cell_size as _) ; } } # [doc = "When enabled, an octree containing the scene's lighting information will be computed. This octree will then be used to light dynamic objects in the scene."] # [doc = ""] # [inline] pub fn set_capture_enabled (& self , enabled : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = BakedLightmapMethodTable :: get (get_api ()) . set_capture_enabled ; let ret = crate :: icalls :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , enabled as _) ; } } # [doc = "Bias value to reduce the amount of light propagation in the captured octree."] # [doc = ""] # [inline] pub fn set_capture_propagation (& self , propagation : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = BakedLightmapMethodTable :: get (get_api ()) . set_capture_propagation ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , propagation as _) ; } } # [doc = "Bake quality of the capture data."] # [doc = ""] # [inline] pub fn set_capture_quality (& self , capture_quality : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = BakedLightmapMethodTable :: get (get_api ()) . set_capture_quality ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , capture_quality as _) ; } } # [doc = "If a baked mesh doesn't have a UV2 size hint, this value will be used to roughly compute a suitable lightmap size."] # [doc = ""] # [inline] pub fn set_default_texels_per_unit (& self , texels : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = BakedLightmapMethodTable :: get (get_api ()) . set_default_texels_per_unit ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , texels as _) ; } } # [doc = "The environment color when [`environment_mode`][Self::environment_mode] is set to [`ENVIRONMENT_MODE_CUSTOM_COLOR`][Self::ENVIRONMENT_MODE_CUSTOM_COLOR]."] # [doc = ""] # [inline] pub fn set_environment_custom_color (& self , color : Color) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = BakedLightmapMethodTable :: get (get_api ()) . set_environment_custom_color ; let ret = crate :: icalls :: icallvar__color (method_bind , self . this . sys () . as_ptr () , color) ; } } # [doc = "The energy scaling factor when when [`environment_mode`][Self::environment_mode] is set to [`ENVIRONMENT_MODE_CUSTOM_COLOR`][Self::ENVIRONMENT_MODE_CUSTOM_COLOR] or [`ENVIRONMENT_MODE_CUSTOM_SKY`][Self::ENVIRONMENT_MODE_CUSTOM_SKY]."] # [doc = ""] # [inline] pub fn set_environment_custom_energy (& self , energy : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = BakedLightmapMethodTable :: get (get_api ()) . set_environment_custom_energy ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , energy as _) ; } } # [doc = "The [`Sky`][Sky] resource to use when [`environment_mode`][Self::environment_mode] is set o [`ENVIRONMENT_MODE_CUSTOM_SKY`][Self::ENVIRONMENT_MODE_CUSTOM_SKY]."] # [doc = ""] # [inline] pub fn set_environment_custom_sky (& self , sky : impl AsArg < crate :: generated :: Sky >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = BakedLightmapMethodTable :: get (get_api ()) . set_environment_custom_sky ; let ret = crate :: icalls :: icallvar__obj (method_bind , self . this . sys () . as_ptr () , sky . as_arg_ptr ()) ; } } # [doc = "The rotation of the baked custom sky."] # [doc = ""] # [inline] pub fn set_environment_custom_sky_rotation_degrees (& self , rotation : Vector3) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = BakedLightmapMethodTable :: get (get_api ()) . set_environment_custom_sky_rotation_degrees ; let ret = crate :: icalls :: icallvar__vec3 (method_bind , self . this . sys () . as_ptr () , rotation) ; } } # [doc = "Minimum ambient light for all the lightmap texels. This doesn't take into account any occlusion from the scene's geometry, it simply ensures a minimum amount of light on all the lightmap texels. Can be used for artistic control on shadow color."] # [doc = ""] # [inline] pub fn set_environment_min_light (& self , min_light : Color) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = BakedLightmapMethodTable :: get (get_api ()) . set_environment_min_light ; let ret = crate :: icalls :: icallvar__color (method_bind , self . this . sys () . as_ptr () , min_light) ; } } # [doc = "Decides which environment to use during baking."] # [doc = ""] # [inline] pub fn set_environment_mode (& self , mode : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = BakedLightmapMethodTable :: get (get_api ()) . set_environment_mode ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , mode as _) ; } } # [doc = "Size of the baked lightmap. Only meshes inside this region will be included in the baked lightmap, also used as the bounds of the captured region for dynamic lighting."] # [doc = ""] # [inline] pub fn set_extents (& self , extents : Vector3) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = BakedLightmapMethodTable :: get (get_api ()) . set_extents ; let ret = crate :: icalls :: icallvar__vec3 (method_bind , self . this . sys () . as_ptr () , extents) ; } } # [doc = "If `true`, the lightmapper will merge the textures for all meshes into one or several large layered textures. If `false`, every mesh will get its own lightmap texture, which is less efficient.\n**Note:** Atlas lightmap rendering is only supported in GLES3, _not_ GLES2. Non-atlas lightmap rendering is supported by both GLES3 and GLES2. If [member ProjectSettings.rendering/quality/driver/fallback_to_gles2] is `true`, consider baking lightmaps with [`atlas_generate`][Self::atlas_generate] set to `false` so that the resulting lightmap is visible in both GLES3 and GLES2."] # [doc = ""] # [inline] pub fn set_generate_atlas (& self , enabled : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = BakedLightmapMethodTable :: get (get_api ()) . set_generate_atlas ; let ret = crate :: icalls :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , enabled as _) ; } } # [doc = "Deprecated, in previous versions it determined the location where lightmaps were be saved."] # [doc = ""] # [inline] pub fn set_image_path (& self , image_path : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = BakedLightmapMethodTable :: get (get_api ()) . set_image_path ; let ret = crate :: icalls :: icallvar__str (method_bind , self . this . sys () . as_ptr () , image_path . into ()) ; } } # [doc = "The calculated light data."] # [doc = ""] # [inline] pub fn set_light_data (& self , data : impl AsArg < crate :: generated :: BakedLightmapData >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = BakedLightmapMethodTable :: get (get_api ()) . set_light_data ; let ret = crate :: icalls :: icallvar__obj (method_bind , self . this . sys () . as_ptr () , data . as_arg_ptr ()) ; } } # [doc = "Maximum size of each lightmap layer, only used when [`atlas_generate`][Self::atlas_generate] is enabled."] # [doc = ""] # [inline] pub fn set_max_atlas_size (& self , max_atlas_size : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = BakedLightmapMethodTable :: get (get_api ()) . set_max_atlas_size ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , max_atlas_size as _) ; } } # [doc = "Store full color values in the lightmap textures. When disabled, lightmap textures will store a single brightness channel. Can be disabled to reduce disk usage if the scene contains only white lights or you don't mind losing color information in indirect lighting."] # [doc = ""] # [inline] pub fn set_use_color (& self , use_denoiser : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = BakedLightmapMethodTable :: get (get_api ()) . set_use_color ; let ret = crate :: icalls :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , use_denoiser as _) ; } } # [doc = "When enabled, a lightmap denoiser will be used to reduce the noise inherent to Monte Carlo based global illumination."] # [doc = ""] # [inline] pub fn set_use_denoiser (& self , use_denoiser : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = BakedLightmapMethodTable :: get (get_api ()) . set_use_denoiser ; let ret = crate :: icalls :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , use_denoiser as _) ; } } # [doc = "If `true`, stores the lightmap textures in a high dynamic range format (EXR). If `false`, stores the lightmap texture in a low dynamic range PNG image. This can be set to `false` to reduce disk usage, but light values over 1.0 will be clamped and you may see banding caused by the reduced precision.\n**Note:** Setting [`use_hdr`][Self::use_hdr] to `true` will decrease lightmap banding even when using the GLES2 backend or if [member ProjectSettings.rendering/quality/depth/hdr] is `false`."] # [doc = ""] # [inline] pub fn set_use_hdr (& self , use_denoiser : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = BakedLightmapMethodTable :: get (get_api ()) . set_use_hdr ; let ret = crate :: icalls :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , use_denoiser as _) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for BakedLightmap { } unsafe impl GodotObject for BakedLightmap { type Memory = memory :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "BakedLightmap" } } impl QueueFree for BakedLightmap { # [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 :: icallvar_ (method_bind , obj) ; } } impl std :: ops :: Deref for BakedLightmap { type Target = crate :: generated :: VisualInstance ; # [inline] fn deref (& self) -> & crate :: generated :: VisualInstance { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for BakedLightmap { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: VisualInstance { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: VisualInstance > for BakedLightmap { } unsafe impl SubClass < crate :: generated :: CullInstance > for BakedLightmap { } unsafe impl SubClass < crate :: generated :: Spatial > for BakedLightmap { } unsafe impl SubClass < crate :: generated :: Node > for BakedLightmap { } unsafe impl SubClass < crate :: generated :: Object > for BakedLightmap { } impl Instanciable for BakedLightmap { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { BakedLightmap :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct BakedLightmapMethodTable { pub class_constructor : sys :: godot_class_constructor , pub bake : * mut sys :: godot_method_bind , pub get_bake_quality : * mut sys :: godot_method_bind , pub get_bias : * mut sys :: godot_method_bind , pub get_bounce_indirect_energy : * mut sys :: godot_method_bind , pub get_bounces : * mut sys :: godot_method_bind , pub get_capture_cell_size : * mut sys :: godot_method_bind , pub get_capture_enabled : * mut sys :: godot_method_bind , pub get_capture_propagation : * mut sys :: godot_method_bind , pub get_capture_quality : * mut sys :: godot_method_bind , pub get_default_texels_per_unit : * mut sys :: godot_method_bind , pub get_environment_custom_color : * mut sys :: godot_method_bind , pub get_environment_custom_energy : * mut sys :: godot_method_bind , pub get_environment_custom_sky : * mut sys :: godot_method_bind , pub get_environment_custom_sky_rotation_degrees : * mut sys :: godot_method_bind , pub get_environment_min_light : * mut sys :: godot_method_bind , pub get_environment_mode : * mut sys :: godot_method_bind , pub get_extents : * mut sys :: godot_method_bind , pub get_image_path : * mut sys :: godot_method_bind , pub get_light_data : * mut sys :: godot_method_bind , pub get_max_atlas_size : * mut sys :: godot_method_bind , pub is_generate_atlas_enabled : * mut sys :: godot_method_bind , pub is_using_color : * mut sys :: godot_method_bind , pub is_using_denoiser : * mut sys :: godot_method_bind , pub is_using_hdr : * mut sys :: godot_method_bind , pub set_bake_quality : * mut sys :: godot_method_bind , pub set_bias : * mut sys :: godot_method_bind , pub set_bounce_indirect_energy : * mut sys :: godot_method_bind , pub set_bounces : * mut sys :: godot_method_bind , pub set_capture_cell_size : * mut sys :: godot_method_bind , pub set_capture_enabled : * mut sys :: godot_method_bind , pub set_capture_propagation : * mut sys :: godot_method_bind , pub set_capture_quality : * mut sys :: godot_method_bind , pub set_default_texels_per_unit : * mut sys :: godot_method_bind , pub set_environment_custom_color : * mut sys :: godot_method_bind , pub set_environment_custom_energy : * mut sys :: godot_method_bind , pub set_environment_custom_sky : * mut sys :: godot_method_bind , pub set_environment_custom_sky_rotation_degrees : * mut sys :: godot_method_bind , pub set_environment_min_light : * mut sys :: godot_method_bind , pub set_environment_mode : * mut sys :: godot_method_bind , pub set_extents : * mut sys :: godot_method_bind , pub set_generate_atlas : * mut sys :: godot_method_bind , pub set_image_path : * mut sys :: godot_method_bind , pub set_light_data : * mut sys :: godot_method_bind , pub set_max_atlas_size : * mut sys :: godot_method_bind , pub set_use_color : * mut sys :: godot_method_bind , pub set_use_denoiser : * mut sys :: godot_method_bind , pub set_use_hdr : * mut sys :: godot_method_bind } impl BakedLightmapMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : BakedLightmapMethodTable = BakedLightmapMethodTable { class_constructor : None , bake : 0 as * mut sys :: godot_method_bind , get_bake_quality : 0 as * mut sys :: godot_method_bind , get_bias : 0 as * mut sys :: godot_method_bind , get_bounce_indirect_energy : 0 as * mut sys :: godot_method_bind , get_bounces : 0 as * mut sys :: godot_method_bind , get_capture_cell_size : 0 as * mut sys :: godot_method_bind , get_capture_enabled : 0 as * mut sys :: godot_method_bind , get_capture_propagation : 0 as * mut sys :: godot_method_bind , get_capture_quality : 0 as * mut sys :: godot_method_bind , get_default_texels_per_unit : 0 as * mut sys :: godot_method_bind , get_environment_custom_color : 0 as * mut sys :: godot_method_bind , get_environment_custom_energy : 0 as * mut sys :: godot_method_bind , get_environment_custom_sky : 0 as * mut sys :: godot_method_bind , get_environment_custom_sky_rotation_degrees : 0 as * mut sys :: godot_method_bind , get_environment_min_light : 0 as * mut sys :: godot_method_bind , get_environment_mode : 0 as * mut sys :: godot_method_bind , get_extents : 0 as * mut sys :: godot_method_bind , get_image_path : 0 as * mut sys :: godot_method_bind , get_light_data : 0 as * mut sys :: godot_method_bind , get_max_atlas_size : 0 as * mut sys :: godot_method_bind , is_generate_atlas_enabled : 0 as * mut sys :: godot_method_bind , is_using_color : 0 as * mut sys :: godot_method_bind , is_using_denoiser : 0 as * mut sys :: godot_method_bind , is_using_hdr : 0 as * mut sys :: godot_method_bind , set_bake_quality : 0 as * mut sys :: godot_method_bind , set_bias : 0 as * mut sys :: godot_method_bind , set_bounce_indirect_energy : 0 as * mut sys :: godot_method_bind , set_bounces : 0 as * mut sys :: godot_method_bind , set_capture_cell_size : 0 as * mut sys :: godot_method_bind , set_capture_enabled : 0 as * mut sys :: godot_method_bind , set_capture_propagation : 0 as * mut sys :: godot_method_bind , set_capture_quality : 0 as * mut sys :: godot_method_bind , set_default_texels_per_unit : 0 as * mut sys :: godot_method_bind , set_environment_custom_color : 0 as * mut sys :: godot_method_bind , set_environment_custom_energy : 0 as * mut sys :: godot_method_bind , set_environment_custom_sky : 0 as * mut sys :: godot_method_bind , set_environment_custom_sky_rotation_degrees : 0 as * mut sys :: godot_method_bind , set_environment_min_light : 0 as * mut sys :: godot_method_bind , set_environment_mode : 0 as * mut sys :: godot_method_bind , set_extents : 0 as * mut sys :: godot_method_bind , set_generate_atlas : 0 as * mut sys :: godot_method_bind , set_image_path : 0 as * mut sys :: godot_method_bind , set_light_data : 0 as * mut sys :: godot_method_bind , set_max_atlas_size : 0 as * mut sys :: godot_method_bind , set_use_color : 0 as * mut sys :: godot_method_bind , set_use_denoiser : 0 as * mut sys :: godot_method_bind , set_use_hdr : 0 as * mut sys :: godot_method_bind } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { BakedLightmapMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "BakedLightmap\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 . get_bake_quality = (gd_api . godot_method_bind_get_method) (class_name , "get_bake_quality\0" . as_ptr () as * const c_char) ; table . get_bias = (gd_api . godot_method_bind_get_method) (class_name , "get_bias\0" . as_ptr () as * const c_char) ; table . get_bounce_indirect_energy = (gd_api . godot_method_bind_get_method) (class_name , "get_bounce_indirect_energy\0" . as_ptr () as * const c_char) ; table . get_bounces = (gd_api . godot_method_bind_get_method) (class_name , "get_bounces\0" . as_ptr () as * const c_char) ; table . get_capture_cell_size = (gd_api . godot_method_bind_get_method) (class_name , "get_capture_cell_size\0" . as_ptr () as * const c_char) ; table . get_capture_enabled = (gd_api . godot_method_bind_get_method) (class_name , "get_capture_enabled\0" . as_ptr () as * const c_char) ; table . get_capture_propagation = (gd_api . godot_method_bind_get_method) (class_name , "get_capture_propagation\0" . as_ptr () as * const c_char) ; table . get_capture_quality = (gd_api . godot_method_bind_get_method) (class_name , "get_capture_quality\0" . as_ptr () as * const c_char) ; table . get_default_texels_per_unit = (gd_api . godot_method_bind_get_method) (class_name , "get_default_texels_per_unit\0" . as_ptr () as * const c_char) ; table . get_environment_custom_color = (gd_api . godot_method_bind_get_method) (class_name , "get_environment_custom_color\0" . as_ptr () as * const c_char) ; table . get_environment_custom_energy = (gd_api . godot_method_bind_get_method) (class_name , "get_environment_custom_energy\0" . as_ptr () as * const c_char) ; table . get_environment_custom_sky = (gd_api . godot_method_bind_get_method) (class_name , "get_environment_custom_sky\0" . as_ptr () as * const c_char) ; table . get_environment_custom_sky_rotation_degrees = (gd_api . godot_method_bind_get_method) (class_name , "get_environment_custom_sky_rotation_degrees\0" . as_ptr () as * const c_char) ; table . get_environment_min_light = (gd_api . godot_method_bind_get_method) (class_name , "get_environment_min_light\0" . as_ptr () as * const c_char) ; table . get_environment_mode = (gd_api . godot_method_bind_get_method) (class_name , "get_environment_mode\0" . as_ptr () as * const c_char) ; table . get_extents = (gd_api . godot_method_bind_get_method) (class_name , "get_extents\0" . as_ptr () as * const c_char) ; table . get_image_path = (gd_api . godot_method_bind_get_method) (class_name , "get_image_path\0" . as_ptr () as * const c_char) ; table . get_light_data = (gd_api . godot_method_bind_get_method) (class_name , "get_light_data\0" . as_ptr () as * const c_char) ; table . get_max_atlas_size = (gd_api . godot_method_bind_get_method) (class_name , "get_max_atlas_size\0" . as_ptr () as * const c_char) ; table . is_generate_atlas_enabled = (gd_api . godot_method_bind_get_method) (class_name , "is_generate_atlas_enabled\0" . as_ptr () as * const c_char) ; table . is_using_color = (gd_api . godot_method_bind_get_method) (class_name , "is_using_color\0" . as_ptr () as * const c_char) ; table . is_using_denoiser = (gd_api . godot_method_bind_get_method) (class_name , "is_using_denoiser\0" . as_ptr () as * const c_char) ; table . is_using_hdr = (gd_api . godot_method_bind_get_method) (class_name , "is_using_hdr\0" . as_ptr () as * const c_char) ; table . set_bake_quality = (gd_api . godot_method_bind_get_method) (class_name , "set_bake_quality\0" . as_ptr () as * const c_char) ; table . set_bias = (gd_api . godot_method_bind_get_method) (class_name , "set_bias\0" . as_ptr () as * const c_char) ; table . set_bounce_indirect_energy = (gd_api . godot_method_bind_get_method) (class_name , "set_bounce_indirect_energy\0" . as_ptr () as * const c_char) ; table . set_bounces = (gd_api . godot_method_bind_get_method) (class_name , "set_bounces\0" . as_ptr () as * const c_char) ; table . set_capture_cell_size = (gd_api . godot_method_bind_get_method) (class_name , "set_capture_cell_size\0" . as_ptr () as * const c_char) ; table . set_capture_enabled = (gd_api . godot_method_bind_get_method) (class_name , "set_capture_enabled\0" . as_ptr () as * const c_char) ; table . set_capture_propagation = (gd_api . godot_method_bind_get_method) (class_name , "set_capture_propagation\0" . as_ptr () as * const c_char) ; table . set_capture_quality = (gd_api . godot_method_bind_get_method) (class_name , "set_capture_quality\0" . as_ptr () as * const c_char) ; table . set_default_texels_per_unit = (gd_api . godot_method_bind_get_method) (class_name , "set_default_texels_per_unit\0" . as_ptr () as * const c_char) ; table . set_environment_custom_color = (gd_api . godot_method_bind_get_method) (class_name , "set_environment_custom_color\0" . as_ptr () as * const c_char) ; table . set_environment_custom_energy = (gd_api . godot_method_bind_get_method) (class_name , "set_environment_custom_energy\0" . as_ptr () as * const c_char) ; table . set_environment_custom_sky = (gd_api . godot_method_bind_get_method) (class_name , "set_environment_custom_sky\0" . as_ptr () as * const c_char) ; table . set_environment_custom_sky_rotation_degrees = (gd_api . godot_method_bind_get_method) (class_name , "set_environment_custom_sky_rotation_degrees\0" . as_ptr () as * const c_char) ; table . set_environment_min_light = (gd_api . godot_method_bind_get_method) (class_name , "set_environment_min_light\0" . as_ptr () as * const c_char) ; table . set_environment_mode = (gd_api . godot_method_bind_get_method) (class_name , "set_environment_mode\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) ; table . set_generate_atlas = (gd_api . godot_method_bind_get_method) (class_name , "set_generate_atlas\0" . as_ptr () as * const c_char) ; table . set_image_path = (gd_api . godot_method_bind_get_method) (class_name , "set_image_path\0" . as_ptr () as * const c_char) ; table . set_light_data = (gd_api . godot_method_bind_get_method) (class_name , "set_light_data\0" . as_ptr () as * const c_char) ; table . set_max_atlas_size = (gd_api . godot_method_bind_get_method) (class_name , "set_max_atlas_size\0" . as_ptr () as * const c_char) ; table . set_use_color = (gd_api . godot_method_bind_get_method) (class_name , "set_use_color\0" . as_ptr () as * const c_char) ; table . set_use_denoiser = (gd_api . godot_method_bind_get_method) (class_name , "set_use_denoiser\0" . as_ptr () as * const c_char) ; table . set_use_hdr = (gd_api . godot_method_bind_get_method) (class_name , "set_use_hdr\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:543:12862 [INFO] [stdout] | [INFO] [stdout] 543 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 543 | # ! [doc = "This module contains types related to the API class [`BakedLightmapData`][super::BakedLightmapData]."] pub (crate) mod private { # [doc = "`core class BakedLightmapData` inherits `Resource` (reference-counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_bakedlightmapdata.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\nBakedLightmapData 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 `Ownership` in these types tracks whether\nownership 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 BakedLightmapData { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: BakedLightmapData ; impl BakedLightmapData { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = BakedLightmapDataMethodTable :: 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_user (& self , path : impl Into < NodePath > , lightmap : impl AsArg < crate :: generated :: Resource > , lightmap_slice : i64 , lightmap_uv_rect : Rect2 , instance : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = BakedLightmapDataMethodTable :: get (get_api ()) . add_user ; let ret = crate :: icalls :: icallvar__nodepath_obj_i64_rect2_i64 (method_bind , self . this . sys () . as_ptr () , path . into () , lightmap . as_arg_ptr () , lightmap_slice as _ , lightmap_uv_rect , instance as _) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn clear_data (& self) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = BakedLightmapDataMethodTable :: get (get_api ()) . clear_data ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn clear_users (& self) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = BakedLightmapDataMethodTable :: get (get_api ()) . clear_users ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn bounds (& self) -> Aabb { unsafe { let method_bind : * mut sys :: godot_method_bind = BakedLightmapDataMethodTable :: get (get_api ()) . get_bounds ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < Aabb > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = ""] # [doc = ""] # [inline] pub fn cell_space_transform (& self) -> Transform { unsafe { let method_bind : * mut sys :: godot_method_bind = BakedLightmapDataMethodTable :: get (get_api ()) . get_cell_space_transform ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < Transform > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = ""] # [doc = ""] # [inline] pub fn cell_subdiv (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = BakedLightmapDataMethodTable :: get (get_api ()) . get_cell_subdiv ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "Global energy multiplier for baked and dynamic capture objects. This can be changed at run-time without having to bake lightmaps again.\nTo adjust only the energy of indirect lighting (without affecting direct lighting or emissive materials), adjust [`BakedLightmap.bounce_indirect_energy`][BakedLightmap::bounce_indirect_energy] and bake lightmaps again."] # [doc = ""] # [inline] pub fn energy (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = BakedLightmapDataMethodTable :: get (get_api ()) . get_energy ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = ""] # [doc = ""] # [inline] pub fn octree (& self) -> PoolArray < u8 > { unsafe { let method_bind : * mut sys :: godot_method_bind = BakedLightmapDataMethodTable :: get (get_api ()) . get_octree ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < PoolArray < u8 > > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = ""] # [doc = ""] # [inline] pub fn get_user_count (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = BakedLightmapDataMethodTable :: get (get_api ()) . get_user_count ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = ""] # [doc = ""] # [inline] pub fn get_user_lightmap (& self , user_idx : i64) -> Option < Ref < crate :: generated :: Resource , ownership :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = BakedLightmapDataMethodTable :: get (get_api ()) . get_user_lightmap ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , user_idx as _) ; < Option < Ref < crate :: generated :: Resource , ownership :: Shared > > > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = ""] # [doc = ""] # [inline] pub fn get_user_path (& self , user_idx : i64) -> NodePath { unsafe { let method_bind : * mut sys :: godot_method_bind = BakedLightmapDataMethodTable :: get (get_api ()) . get_user_path ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , user_idx as _) ; < NodePath > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Controls whether dynamic capture objects receive environment lighting or not."] # [doc = ""] # [inline] pub fn is_interior (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = BakedLightmapDataMethodTable :: get (get_api ()) . is_interior ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = ""] # [doc = ""] # [inline] pub fn set_bounds (& self , bounds : Aabb) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = BakedLightmapDataMethodTable :: get (get_api ()) . set_bounds ; let ret = crate :: icalls :: icallvar__aabb (method_bind , self . this . sys () . as_ptr () , bounds) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn set_cell_space_transform (& self , xform : Transform) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = BakedLightmapDataMethodTable :: get (get_api ()) . set_cell_space_transform ; let ret = crate :: icalls :: icallvar__trans (method_bind , self . this . sys () . as_ptr () , xform) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn set_cell_subdiv (& self , cell_subdiv : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = BakedLightmapDataMethodTable :: get (get_api ()) . set_cell_subdiv ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , cell_subdiv as _) ; } } # [doc = "Global energy multiplier for baked and dynamic capture objects. This can be changed at run-time without having to bake lightmaps again.\nTo adjust only the energy of indirect lighting (without affecting direct lighting or emissive materials), adjust [`BakedLightmap.bounce_indirect_energy`][BakedLightmap::bounce_indirect_energy] and bake lightmaps again."] # [doc = ""] # [inline] pub fn set_energy (& self , energy : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = BakedLightmapDataMethodTable :: get (get_api ()) . set_energy ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , energy as _) ; } } # [doc = "Controls whether dynamic capture objects receive environment lighting or not."] # [doc = ""] # [inline] pub fn set_interior (& self , interior : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = BakedLightmapDataMethodTable :: get (get_api ()) . set_interior ; let ret = crate :: icalls :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , interior as _) ; } } # [doc = ""] # [doc = ""] # [inline] pub fn set_octree (& self , octree : PoolArray < u8 >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = BakedLightmapDataMethodTable :: get (get_api ()) . set_octree ; let ret = crate :: icalls :: icallvar__bytearr (method_bind , self . this . sys () . as_ptr () , octree) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for BakedLightmapData { } unsafe impl GodotObject for BakedLightmapData { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "BakedLightmapData" } } impl std :: ops :: Deref for BakedLightmapData { type Target = crate :: generated :: Resource ; # [inline] fn deref (& self) -> & crate :: generated :: Resource { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for BakedLightmapData { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: Resource { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: Resource > for BakedLightmapData { } unsafe impl SubClass < crate :: generated :: Reference > for BakedLightmapData { } unsafe impl SubClass < crate :: generated :: Object > for BakedLightmapData { } impl Instanciable for BakedLightmapData { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { BakedLightmapData :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct BakedLightmapDataMethodTable { pub class_constructor : sys :: godot_class_constructor , pub add_user : * mut sys :: godot_method_bind , pub clear_data : * mut sys :: godot_method_bind , pub clear_users : * mut sys :: godot_method_bind , pub get_bounds : * mut sys :: godot_method_bind , pub get_cell_space_transform : * mut sys :: godot_method_bind , pub get_cell_subdiv : * mut sys :: godot_method_bind , pub get_energy : * mut sys :: godot_method_bind , pub get_octree : * mut sys :: godot_method_bind , pub get_user_count : * mut sys :: godot_method_bind , pub get_user_lightmap : * mut sys :: godot_method_bind , pub get_user_path : * mut sys :: godot_method_bind , pub is_interior : * mut sys :: godot_method_bind , pub set_bounds : * mut sys :: godot_method_bind , pub set_cell_space_transform : * mut sys :: godot_method_bind , pub set_cell_subdiv : * mut sys :: godot_method_bind , pub set_energy : * mut sys :: godot_method_bind , pub set_interior : * mut sys :: godot_method_bind , pub set_octree : * mut sys :: godot_method_bind } impl BakedLightmapDataMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : BakedLightmapDataMethodTable = BakedLightmapDataMethodTable { class_constructor : None , add_user : 0 as * mut sys :: godot_method_bind , clear_data : 0 as * mut sys :: godot_method_bind , clear_users : 0 as * mut sys :: godot_method_bind , get_bounds : 0 as * mut sys :: godot_method_bind , get_cell_space_transform : 0 as * mut sys :: godot_method_bind , get_cell_subdiv : 0 as * mut sys :: godot_method_bind , get_energy : 0 as * mut sys :: godot_method_bind , get_octree : 0 as * mut sys :: godot_method_bind , get_user_count : 0 as * mut sys :: godot_method_bind , get_user_lightmap : 0 as * mut sys :: godot_method_bind , get_user_path : 0 as * mut sys :: godot_method_bind , is_interior : 0 as * mut sys :: godot_method_bind , set_bounds : 0 as * mut sys :: godot_method_bind , set_cell_space_transform : 0 as * mut sys :: godot_method_bind , set_cell_subdiv : 0 as * mut sys :: godot_method_bind , set_energy : 0 as * mut sys :: godot_method_bind , set_interior : 0 as * mut sys :: godot_method_bind , set_octree : 0 as * mut sys :: godot_method_bind } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { BakedLightmapDataMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "BakedLightmapData\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . add_user = (gd_api . godot_method_bind_get_method) (class_name , "add_user\0" . as_ptr () as * const c_char) ; table . clear_data = (gd_api . godot_method_bind_get_method) (class_name , "clear_data\0" . as_ptr () as * const c_char) ; table . clear_users = (gd_api . godot_method_bind_get_method) (class_name , "clear_users\0" . as_ptr () as * const c_char) ; table . get_bounds = (gd_api . godot_method_bind_get_method) (class_name , "get_bounds\0" . as_ptr () as * const c_char) ; table . get_cell_space_transform = (gd_api . godot_method_bind_get_method) (class_name , "get_cell_space_transform\0" . as_ptr () as * const c_char) ; table . get_cell_subdiv = (gd_api . godot_method_bind_get_method) (class_name , "get_cell_subdiv\0" . as_ptr () as * const c_char) ; table . get_energy = (gd_api . godot_method_bind_get_method) (class_name , "get_energy\0" . as_ptr () as * const c_char) ; table . get_octree = (gd_api . godot_method_bind_get_method) (class_name , "get_octree\0" . as_ptr () as * const c_char) ; table . get_user_count = (gd_api . godot_method_bind_get_method) (class_name , "get_user_count\0" . as_ptr () as * const c_char) ; table . get_user_lightmap = (gd_api . godot_method_bind_get_method) (class_name , "get_user_lightmap\0" . as_ptr () as * const c_char) ; table . get_user_path = (gd_api . godot_method_bind_get_method) (class_name , "get_user_path\0" . as_ptr () as * const c_char) ; table . is_interior = (gd_api . godot_method_bind_get_method) (class_name , "is_interior\0" . as_ptr () as * const c_char) ; table . set_bounds = (gd_api . godot_method_bind_get_method) (class_name , "set_bounds\0" . as_ptr () as * const c_char) ; table . set_cell_space_transform = (gd_api . godot_method_bind_get_method) (class_name , "set_cell_space_transform\0" . as_ptr () as * const c_char) ; table . set_cell_subdiv = (gd_api . godot_method_bind_get_method) (class_name , "set_cell_subdiv\0" . as_ptr () as * const c_char) ; table . set_energy = (gd_api . godot_method_bind_get_method) (class_name , "set_energy\0" . as_ptr () as * const c_char) ; table . set_interior = (gd_api . godot_method_bind_get_method) (class_name , "set_interior\0" . as_ptr () as * const c_char) ; table . set_octree = (gd_api . godot_method_bind_get_method) (class_name , "set_octree\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:549:19553 [INFO] [stdout] | [INFO] [stdout] 549 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 549 | # ! [doc = "This module contains types related to the API class [`BaseButton`][super::BaseButton]."] pub (crate) mod private { # [doc = "`core class BaseButton` inherits `Control` (manually managed).\n\nThis class has related types in the [`base_button`][super::base_button] module."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_basebutton.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\nBaseButton 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 `Ownership` in these types tracks whether\nownership 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 BaseButton { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: BaseButton ; # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct ActionMode (pub i64) ; impl ActionMode { pub const PRESS : ActionMode = ActionMode (0i64) ; pub const RELEASE : ActionMode = ActionMode (1i64) ; } impl From < i64 > for ActionMode { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < ActionMode > for i64 { # [inline] fn from (v : ActionMode) -> Self { v . 0 } } impl FromVariant for ActionMode { # [inline] fn from_variant (v : & Variant) -> Result < Self , FromVariantError > { i64 :: from_variant (v) . map (Self :: from) } } # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct DrawMode (pub i64) ; impl DrawMode { pub const NORMAL : DrawMode = DrawMode (0i64) ; pub const PRESSED : DrawMode = DrawMode (1i64) ; pub const HOVER : DrawMode = DrawMode (2i64) ; pub const DISABLED : DrawMode = DrawMode (3i64) ; pub const HOVER_PRESSED : DrawMode = DrawMode (4i64) ; } impl From < i64 > for DrawMode { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < DrawMode > for i64 { # [inline] fn from (v : DrawMode) -> Self { v . 0 } } impl FromVariant for DrawMode { # [inline] fn from_variant (v : & Variant) -> Result < Self , FromVariantError > { i64 :: from_variant (v) . map (Self :: from) } } # [doc = "Constants"] # [allow (non_upper_case_globals)] impl BaseButton { pub const ACTION_MODE_BUTTON_PRESS : i64 = 0i64 ; pub const DRAW_NORMAL : i64 = 0i64 ; pub const ACTION_MODE_BUTTON_RELEASE : i64 = 1i64 ; pub const DRAW_PRESSED : i64 = 1i64 ; pub const DRAW_HOVER : i64 = 2i64 ; pub const DRAW_DISABLED : i64 = 3i64 ; pub const DRAW_HOVER_PRESSED : i64 = 4i64 ; } impl BaseButton { # [doc = "Determines when the button is considered clicked, one of the [`ActionMode`][ActionMode] constants."] # [doc = ""] # [inline] pub fn action_mode (& self) -> crate :: generated :: base_button :: ActionMode { unsafe { let method_bind : * mut sys :: godot_method_bind = BaseButtonMethodTable :: get (get_api ()) . get_action_mode ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < crate :: generated :: base_button :: ActionMode > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "[`ButtonGroup`][ButtonGroup] associated to the button."] # [doc = ""] # [inline] pub fn button_group (& self) -> Option < Ref < crate :: generated :: ButtonGroup , ownership :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = BaseButtonMethodTable :: get (get_api ()) . get_button_group ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < Option < Ref < crate :: generated :: ButtonGroup , ownership :: Shared > > > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Binary mask to choose which mouse buttons this button will respond to.\nTo allow both left-click and right-click, use `BUTTON_MASK_LEFT | BUTTON_MASK_RIGHT`."] # [doc = ""] # [inline] pub fn button_mask (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = BaseButtonMethodTable :: get (get_api ()) . get_button_mask ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "Returns the visual state used to draw the button. This is useful mainly when implementing your own draw code by either overriding _draw() or connecting to \"draw\" signal. The visual state of the button is defined by the [`DrawMode`][DrawMode] enum."] # [doc = ""] # [inline] pub fn get_draw_mode (& self) -> crate :: generated :: base_button :: DrawMode { unsafe { let method_bind : * mut sys :: godot_method_bind = BaseButtonMethodTable :: get (get_api ()) . get_draw_mode ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < crate :: generated :: base_button :: DrawMode > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "_Deprecated._ This property has been deprecated due to redundancy and will be removed in Godot 4.0. This property no longer has any effect when set. Please use [`Control.focus_mode`][Control::focus_mode] instead."] # [doc = ""] # [inline] pub fn enabled_focus_mode (& self) -> crate :: generated :: control :: FocusMode { unsafe { let method_bind : * mut sys :: godot_method_bind = BaseButtonMethodTable :: get (get_api ()) . get_enabled_focus_mode ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < crate :: generated :: control :: FocusMode > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "[`ShortCut`][ShortCut] associated to the button."] # [doc = ""] # [inline] pub fn shortcut (& self) -> Option < Ref < crate :: generated :: ShortCut , ownership :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = BaseButtonMethodTable :: get (get_api ()) . get_shortcut ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < Option < Ref < crate :: generated :: ShortCut , ownership :: Shared > > > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "If `true`, the button is in disabled state and can't be clicked or toggled."] # [doc = ""] # [inline] pub fn is_disabled (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = BaseButtonMethodTable :: get (get_api ()) . is_disabled ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "Returns `true` if the mouse has entered the button and has not left it yet."] # [doc = ""] # [inline] pub fn is_hovered (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = BaseButtonMethodTable :: get (get_api ()) . is_hovered ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "If `true`, the button stays pressed when moving the cursor outside the button while pressing it.\n**Note:** This property only affects the button's visual appearance. Signals will be emitted at the same moment regardless of this property's value."] # [doc = ""] # [inline] pub fn is_keep_pressed_outside (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = BaseButtonMethodTable :: get (get_api ()) . is_keep_pressed_outside ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "If `true`, the button's state is pressed. Means the button is pressed down or toggled (if [`toggle_mode`][Self::toggle_mode] is active). Only works if [`toggle_mode`][Self::toggle_mode] is `true`.\n**Note:** Setting [`pressed`][Self::pressed] will result in `toggled` to be emitted. If you want to change the pressed state without emitting that signal, use [`set_pressed_no_signal`][Self::set_pressed_no_signal]."] # [doc = ""] # [inline] pub fn is_pressed (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = BaseButtonMethodTable :: get (get_api ()) . is_pressed ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "If `true`, the button will add information about its shortcut in the tooltip."] # [doc = ""] # [inline] pub fn is_shortcut_in_tooltip_enabled (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = BaseButtonMethodTable :: get (get_api ()) . is_shortcut_in_tooltip_enabled ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "If `true`, the button is in toggle mode. Makes the button flip state between pressed and unpressed each time its area is clicked."] # [doc = ""] # [inline] pub fn is_toggle_mode (& self) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = BaseButtonMethodTable :: get (get_api ()) . is_toggle_mode ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "Determines when the button is considered clicked, one of the [`ActionMode`][ActionMode] constants."] # [doc = ""] # [inline] pub fn set_action_mode (& self , mode : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = BaseButtonMethodTable :: get (get_api ()) . set_action_mode ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , mode as _) ; } } # [doc = "[`ButtonGroup`][ButtonGroup] associated to the button."] # [doc = ""] # [inline] pub fn set_button_group (& self , button_group : impl AsArg < crate :: generated :: ButtonGroup >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = BaseButtonMethodTable :: get (get_api ()) . set_button_group ; let ret = crate :: icalls :: icallvar__obj (method_bind , self . this . sys () . as_ptr () , button_group . as_arg_ptr ()) ; } } # [doc = "Binary mask to choose which mouse buttons this button will respond to.\nTo allow both left-click and right-click, use `BUTTON_MASK_LEFT | BUTTON_MASK_RIGHT`."] # [doc = ""] # [inline] pub fn set_button_mask (& self , mask : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = BaseButtonMethodTable :: get (get_api ()) . set_button_mask ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , mask as _) ; } } # [doc = "If `true`, the button is in disabled state and can't be clicked or toggled."] # [doc = ""] # [inline] pub fn set_disabled (& self , disabled : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = BaseButtonMethodTable :: get (get_api ()) . set_disabled ; let ret = crate :: icalls :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , disabled as _) ; } } # [doc = "_Deprecated._ This property has been deprecated due to redundancy and will be removed in Godot 4.0. This property no longer has any effect when set. Please use [`Control.focus_mode`][Control::focus_mode] instead."] # [doc = ""] # [inline] pub fn set_enabled_focus_mode (& self , mode : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = BaseButtonMethodTable :: get (get_api ()) . set_enabled_focus_mode ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , mode as _) ; } } # [doc = "If `true`, the button stays pressed when moving the cursor outside the button while pressing it.\n**Note:** This property only affects the button's visual appearance. Signals will be emitted at the same moment regardless of this property's value."] # [doc = ""] # [inline] pub fn set_keep_pressed_outside (& self , enabled : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = BaseButtonMethodTable :: get (get_api ()) . set_keep_pressed_outside ; let ret = crate :: icalls :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , enabled as _) ; } } # [doc = "If `true`, the button's state is pressed. Means the button is pressed down or toggled (if [`toggle_mode`][Self::toggle_mode] is active). Only works if [`toggle_mode`][Self::toggle_mode] is `true`.\n**Note:** Setting [`pressed`][Self::pressed] will result in `toggled` to be emitted. If you want to change the pressed state without emitting that signal, use [`set_pressed_no_signal`][Self::set_pressed_no_signal]."] # [doc = ""] # [inline] pub fn set_pressed (& self , pressed : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = BaseButtonMethodTable :: get (get_api ()) . set_pressed ; let ret = crate :: icalls :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , pressed as _) ; } } # [doc = "Changes the [`pressed`][Self::pressed] state of the button, without emitting `toggled`. Use when you just want to change the state of the button without sending the pressed event (e.g. when initializing scene). Only works if [`toggle_mode`][Self::toggle_mode] is `true`.\n**Note:** This method doesn't unpress other buttons in its button [`group`][Self::group]."] # [doc = ""] # [inline] pub fn set_pressed_no_signal (& self , pressed : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = BaseButtonMethodTable :: get (get_api ()) . set_pressed_no_signal ; let ret = crate :: icalls :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , pressed as _) ; } } # [doc = "[`ShortCut`][ShortCut] associated to the button."] # [doc = ""] # [inline] pub fn set_shortcut (& self , shortcut : impl AsArg < crate :: generated :: ShortCut >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = BaseButtonMethodTable :: get (get_api ()) . set_shortcut ; let ret = crate :: icalls :: icallvar__obj (method_bind , self . this . sys () . as_ptr () , shortcut . as_arg_ptr ()) ; } } # [doc = "If `true`, the button will add information about its shortcut in the tooltip."] # [doc = ""] # [inline] pub fn set_shortcut_in_tooltip (& self , enabled : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = BaseButtonMethodTable :: get (get_api ()) . set_shortcut_in_tooltip ; let ret = crate :: icalls :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , enabled as _) ; } } # [doc = "If `true`, the button is in toggle mode. Makes the button flip state between pressed and unpressed each time its area is clicked."] # [doc = ""] # [inline] pub fn set_toggle_mode (& self , enabled : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = BaseButtonMethodTable :: get (get_api ()) . set_toggle_mode ; let ret = crate :: icalls :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , enabled as _) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for BaseButton { } unsafe impl GodotObject for BaseButton { type Memory = memory :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "BaseButton" } } impl QueueFree for BaseButton { # [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 :: icallvar_ (method_bind , obj) ; } } impl std :: ops :: Deref for BaseButton { type Target = crate :: generated :: Control ; # [inline] fn deref (& self) -> & crate :: generated :: Control { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for BaseButton { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: Control { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: Control > for BaseButton { } unsafe impl SubClass < crate :: generated :: CanvasItem > for BaseButton { } unsafe impl SubClass < crate :: generated :: Node > for BaseButton { } unsafe impl SubClass < crate :: generated :: Object > for BaseButton { } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct BaseButtonMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_action_mode : * mut sys :: godot_method_bind , pub get_button_group : * mut sys :: godot_method_bind , pub get_button_mask : * mut sys :: godot_method_bind , pub get_draw_mode : * mut sys :: godot_method_bind , pub get_enabled_focus_mode : * mut sys :: godot_method_bind , pub get_shortcut : * mut sys :: godot_method_bind , pub is_disabled : * mut sys :: godot_method_bind , pub is_hovered : * mut sys :: godot_method_bind , pub is_keep_pressed_outside : * mut sys :: godot_method_bind , pub is_pressed : * mut sys :: godot_method_bind , pub is_shortcut_in_tooltip_enabled : * mut sys :: godot_method_bind , pub is_toggle_mode : * mut sys :: godot_method_bind , pub set_action_mode : * mut sys :: godot_method_bind , pub set_button_group : * mut sys :: godot_method_bind , pub set_button_mask : * mut sys :: godot_method_bind , pub set_disabled : * mut sys :: godot_method_bind , pub set_enabled_focus_mode : * mut sys :: godot_method_bind , pub set_keep_pressed_outside : * mut sys :: godot_method_bind , pub set_pressed : * mut sys :: godot_method_bind , pub set_pressed_no_signal : * mut sys :: godot_method_bind , pub set_shortcut : * mut sys :: godot_method_bind , pub set_shortcut_in_tooltip : * mut sys :: godot_method_bind , pub set_toggle_mode : * mut sys :: godot_method_bind } impl BaseButtonMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : BaseButtonMethodTable = BaseButtonMethodTable { class_constructor : None , get_action_mode : 0 as * mut sys :: godot_method_bind , get_button_group : 0 as * mut sys :: godot_method_bind , get_button_mask : 0 as * mut sys :: godot_method_bind , get_draw_mode : 0 as * mut sys :: godot_method_bind , get_enabled_focus_mode : 0 as * mut sys :: godot_method_bind , get_shortcut : 0 as * mut sys :: godot_method_bind , is_disabled : 0 as * mut sys :: godot_method_bind , is_hovered : 0 as * mut sys :: godot_method_bind , is_keep_pressed_outside : 0 as * mut sys :: godot_method_bind , is_pressed : 0 as * mut sys :: godot_method_bind , is_shortcut_in_tooltip_enabled : 0 as * mut sys :: godot_method_bind , is_toggle_mode : 0 as * mut sys :: godot_method_bind , set_action_mode : 0 as * mut sys :: godot_method_bind , set_button_group : 0 as * mut sys :: godot_method_bind , set_button_mask : 0 as * mut sys :: godot_method_bind , set_disabled : 0 as * mut sys :: godot_method_bind , set_enabled_focus_mode : 0 as * mut sys :: godot_method_bind , set_keep_pressed_outside : 0 as * mut sys :: godot_method_bind , set_pressed : 0 as * mut sys :: godot_method_bind , set_pressed_no_signal : 0 as * mut sys :: godot_method_bind , set_shortcut : 0 as * mut sys :: godot_method_bind , set_shortcut_in_tooltip : 0 as * mut sys :: godot_method_bind , set_toggle_mode : 0 as * mut sys :: godot_method_bind } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { BaseButtonMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "BaseButton\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_action_mode = (gd_api . godot_method_bind_get_method) (class_name , "get_action_mode\0" . as_ptr () as * const c_char) ; table . get_button_group = (gd_api . godot_method_bind_get_method) (class_name , "get_button_group\0" . as_ptr () as * const c_char) ; table . get_button_mask = (gd_api . godot_method_bind_get_method) (class_name , "get_button_mask\0" . as_ptr () as * const c_char) ; table . get_draw_mode = (gd_api . godot_method_bind_get_method) (class_name , "get_draw_mode\0" . as_ptr () as * const c_char) ; table . get_enabled_focus_mode = (gd_api . godot_method_bind_get_method) (class_name , "get_enabled_focus_mode\0" . as_ptr () as * const c_char) ; table . get_shortcut = (gd_api . godot_method_bind_get_method) (class_name , "get_shortcut\0" . as_ptr () as * const c_char) ; table . is_disabled = (gd_api . godot_method_bind_get_method) (class_name , "is_disabled\0" . as_ptr () as * const c_char) ; table . is_hovered = (gd_api . godot_method_bind_get_method) (class_name , "is_hovered\0" . as_ptr () as * const c_char) ; table . is_keep_pressed_outside = (gd_api . godot_method_bind_get_method) (class_name , "is_keep_pressed_outside\0" . as_ptr () as * const c_char) ; table . is_pressed = (gd_api . godot_method_bind_get_method) (class_name , "is_pressed\0" . as_ptr () as * const c_char) ; table . is_shortcut_in_tooltip_enabled = (gd_api . godot_method_bind_get_method) (class_name , "is_shortcut_in_tooltip_enabled\0" . as_ptr () as * const c_char) ; table . is_toggle_mode = (gd_api . godot_method_bind_get_method) (class_name , "is_toggle_mode\0" . as_ptr () as * const c_char) ; table . set_action_mode = (gd_api . godot_method_bind_get_method) (class_name , "set_action_mode\0" . as_ptr () as * const c_char) ; table . set_button_group = (gd_api . godot_method_bind_get_method) (class_name , "set_button_group\0" . as_ptr () as * const c_char) ; table . set_button_mask = (gd_api . godot_method_bind_get_method) (class_name , "set_button_mask\0" . as_ptr () as * const c_char) ; table . set_disabled = (gd_api . godot_method_bind_get_method) (class_name , "set_disabled\0" . as_ptr () as * const c_char) ; table . set_enabled_focus_mode = (gd_api . godot_method_bind_get_method) (class_name , "set_enabled_focus_mode\0" . as_ptr () as * const c_char) ; table . set_keep_pressed_outside = (gd_api . godot_method_bind_get_method) (class_name , "set_keep_pressed_outside\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_pressed_no_signal = (gd_api . godot_method_bind_get_method) (class_name , "set_pressed_no_signal\0" . as_ptr () as * const c_char) ; table . set_shortcut = (gd_api . godot_method_bind_get_method) (class_name , "set_shortcut\0" . as_ptr () as * const c_char) ; table . set_shortcut_in_tooltip = (gd_api . godot_method_bind_get_method) (class_name , "set_shortcut_in_tooltip\0" . as_ptr () as * const c_char) ; table . set_toggle_mode = (gd_api . godot_method_bind_get_method) (class_name , "set_toggle_mode\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:555:9598 [INFO] [stdout] | [INFO] [stdout] 555 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 555 | # ! [doc = "This module contains types related to the API class [`BitMap`][super::BitMap]."] pub (crate) mod private { # [doc = "`core class BitMap` inherits `Resource` (reference-counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_bitmap.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\nBitMap 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 `Ownership` in these types tracks whether\nownership 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 BitMap { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: BitMap ; impl BitMap { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = BitMapMethodTable :: 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 an image of the same size as the bitmap and with a [enum Image.Format] of type `FORMAT_L8`. `true` bits of the bitmap are being converted into white pixels, and `false` bits into black."] # [doc = ""] # [inline] pub fn convert_to_image (& self) -> Option < Ref < crate :: generated :: Image , ownership :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = BitMapMethodTable :: get (get_api ()) . convert_to_image ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < Option < Ref < crate :: generated :: Image , ownership :: Shared > > > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Creates a bitmap with the specified size, filled with `false`."] # [doc = ""] # [inline] pub fn create (& self , size : Vector2) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = BitMapMethodTable :: get (get_api ()) . create ; let ret = crate :: icalls :: icallvar__vec2 (method_bind , self . this . sys () . as_ptr () , size) ; } } # [doc = "Creates a bitmap that matches the given image dimensions, every element of the bitmap is set to `false` if the alpha value of the image at that position is equal to `threshold` or less, and `true` in other case.\n# Default Arguments\n* `threshold` - `0.1`"] # [doc = ""] # [inline] pub fn create_from_image_alpha (& self , image : impl AsArg < crate :: generated :: Image > , threshold : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = BitMapMethodTable :: get (get_api ()) . create_from_image_alpha ; let ret = crate :: icalls :: icallvar__obj_f64 (method_bind , self . this . sys () . as_ptr () , image . as_arg_ptr () , threshold as _) ; } } # [doc = "Returns bitmap's value at the specified position."] # [doc = ""] # [inline] pub fn get_bit (& self , position : Vector2) -> bool { unsafe { let method_bind : * mut sys :: godot_method_bind = BitMapMethodTable :: get (get_api ()) . get_bit ; let ret = crate :: icalls :: icallvar__vec2 (method_bind , self . this . sys () . as_ptr () , position) ; < bool > :: coerce_from_variant (& ret) } } # [doc = "Returns bitmap's dimensions."] # [doc = ""] # [inline] pub fn get_size (& self) -> Vector2 { unsafe { let method_bind : * mut sys :: godot_method_bind = BitMapMethodTable :: get (get_api ()) . get_size ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < Vector2 > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns the amount of bitmap elements that are set to `true`."] # [doc = ""] # [inline] pub fn get_true_bit_count (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = BitMapMethodTable :: get (get_api ()) . get_true_bit_count ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "Applies morphological dilation or erosion to the bitmap. If `pixels` is positive, dilation is applied to the bitmap. If `pixels` is negative, erosion is applied to the bitmap. `rect` defines the area where the morphological operation is applied. Pixels located outside the `rect` are unaffected by [`grow_mask`][Self::grow_mask]."] # [doc = ""] # [inline] pub fn grow_mask (& self , pixels : i64 , rect : Rect2) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = BitMapMethodTable :: get (get_api ()) . grow_mask ; let ret = crate :: icalls :: icallvar__i64_rect2 (method_bind , self . this . sys () . as_ptr () , pixels as _ , rect) ; } } # [doc = "\n# Default Arguments\n* `epsilon` - `2.0`"] # [doc = ""] # [inline] pub fn opaque_to_polygons (& self , rect : Rect2 , epsilon : f64) -> VariantArray { unsafe { let method_bind : * mut sys :: godot_method_bind = BitMapMethodTable :: get (get_api ()) . opaque_to_polygons ; let ret = crate :: icalls :: icallvar__rect2_f64 (method_bind , self . this . sys () . as_ptr () , rect , epsilon as _) ; < VariantArray > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Resizes the image to `new_size`."] # [doc = ""] # [inline] pub fn resize (& self , new_size : Vector2) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = BitMapMethodTable :: get (get_api ()) . resize ; let ret = crate :: icalls :: icallvar__vec2 (method_bind , self . this . sys () . as_ptr () , new_size) ; } } # [doc = "Sets the bitmap's element at the specified position, to the specified value."] # [doc = ""] # [inline] pub fn set_bit (& self , position : Vector2 , bit : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = BitMapMethodTable :: get (get_api ()) . set_bit ; let ret = crate :: icalls :: icallvar__vec2_bool (method_bind , self . this . sys () . as_ptr () , position , bit as _) ; } } # [doc = "Sets a rectangular portion of the bitmap to the specified value."] # [doc = ""] # [inline] pub fn set_bit_rect (& self , rect : Rect2 , bit : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = BitMapMethodTable :: get (get_api ()) . set_bit_rect ; let ret = crate :: icalls :: icallvar__rect2_bool (method_bind , self . this . sys () . as_ptr () , rect , bit as _) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for BitMap { } unsafe impl GodotObject for BitMap { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "BitMap" } } impl std :: ops :: Deref for BitMap { type Target = crate :: generated :: Resource ; # [inline] fn deref (& self) -> & crate :: generated :: Resource { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for BitMap { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: Resource { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: Resource > for BitMap { } unsafe impl SubClass < crate :: generated :: Reference > for BitMap { } unsafe impl SubClass < crate :: generated :: Object > for BitMap { } impl Instanciable for BitMap { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { BitMap :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct BitMapMethodTable { pub class_constructor : sys :: godot_class_constructor , pub convert_to_image : * mut sys :: godot_method_bind , pub create : * mut sys :: godot_method_bind , pub create_from_image_alpha : * mut sys :: godot_method_bind , pub get_bit : * mut sys :: godot_method_bind , pub get_size : * mut sys :: godot_method_bind , pub get_true_bit_count : * mut sys :: godot_method_bind , pub grow_mask : * mut sys :: godot_method_bind , pub opaque_to_polygons : * mut sys :: godot_method_bind , pub resize : * mut sys :: godot_method_bind , pub set_bit : * mut sys :: godot_method_bind , pub set_bit_rect : * mut sys :: godot_method_bind } impl BitMapMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : BitMapMethodTable = BitMapMethodTable { class_constructor : None , convert_to_image : 0 as * mut sys :: godot_method_bind , create : 0 as * mut sys :: godot_method_bind , create_from_image_alpha : 0 as * mut sys :: godot_method_bind , get_bit : 0 as * mut sys :: godot_method_bind , get_size : 0 as * mut sys :: godot_method_bind , get_true_bit_count : 0 as * mut sys :: godot_method_bind , grow_mask : 0 as * mut sys :: godot_method_bind , opaque_to_polygons : 0 as * mut sys :: godot_method_bind , resize : 0 as * mut sys :: godot_method_bind , set_bit : 0 as * mut sys :: godot_method_bind , set_bit_rect : 0 as * mut sys :: godot_method_bind } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { BitMapMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "BitMap\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . convert_to_image = (gd_api . godot_method_bind_get_method) (class_name , "convert_to_image\0" . as_ptr () as * const c_char) ; table . create = (gd_api . godot_method_bind_get_method) (class_name , "create\0" . as_ptr () as * const c_char) ; table . create_from_image_alpha = (gd_api . godot_method_bind_get_method) (class_name , "create_from_image_alpha\0" . as_ptr () as * const c_char) ; table . get_bit = (gd_api . godot_method_bind_get_method) (class_name , "get_bit\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 . get_true_bit_count = (gd_api . godot_method_bind_get_method) (class_name , "get_true_bit_count\0" . as_ptr () as * const c_char) ; table . grow_mask = (gd_api . godot_method_bind_get_method) (class_name , "grow_mask\0" . as_ptr () as * const c_char) ; table . opaque_to_polygons = (gd_api . godot_method_bind_get_method) (class_name , "opaque_to_polygons\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 . set_bit = (gd_api . godot_method_bind_get_method) (class_name , "set_bit\0" . as_ptr () as * const c_char) ; table . set_bit_rect = (gd_api . godot_method_bind_get_method) (class_name , "set_bit_rect\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:561:10769 [INFO] [stdout] | [INFO] [stdout] 561 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 561 | # ! [doc = "This module contains types related to the API class [`BitmapFont`][super::BitmapFont]."] pub (crate) mod private { # [doc = "`core class BitmapFont` inherits `Font` (reference-counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_bitmapfont.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\nBitmapFont inherits methods from:\n - [Font](struct.Font.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 `Ownership` in these types tracks whether\nownership 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 BitmapFont { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: BitmapFont ; impl BitmapFont { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = BitmapFontMethodTable :: 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 character to the font, where `character` is the Unicode value, `texture` is the texture index, `rect` is the region in the texture (in pixels!), `align` is the (optional) alignment for the character and `advance` is the (optional) advance.\n# Default Arguments\n* `align` - `Vector2( 0, 0 )`\n* `advance` - `-1`"] # [doc = ""] # [inline] pub fn add_char (& self , character : i64 , texture : i64 , rect : Rect2 , align : Vector2 , advance : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = BitmapFontMethodTable :: get (get_api ()) . add_char ; let ret = crate :: icalls :: icallvar__i64_i64_rect2_vec2_f64 (method_bind , self . this . sys () . as_ptr () , character as _ , texture as _ , rect , align , advance as _) ; } } # [doc = "Adds a kerning pair to the [`BitmapFont`][BitmapFont] as a difference. Kerning pairs are special cases where a typeface advance is determined by the next character."] # [doc = ""] # [inline] pub fn add_kerning_pair (& self , char_a : i64 , char_b : i64 , kerning : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = BitmapFontMethodTable :: get (get_api ()) . add_kerning_pair ; let ret = crate :: icalls :: icallvar__i64_i64_i64 (method_bind , self . this . sys () . as_ptr () , char_a as _ , char_b as _ , kerning as _) ; } } # [doc = "Adds a texture to the [`BitmapFont`][BitmapFont]."] # [doc = ""] # [inline] pub fn add_texture (& self , texture : impl AsArg < crate :: generated :: Texture >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = BitmapFontMethodTable :: get (get_api ()) . add_texture ; let ret = crate :: icalls :: icallvar__obj (method_bind , self . this . sys () . as_ptr () , texture . as_arg_ptr ()) ; } } # [doc = "Clears all the font data and settings."] # [doc = ""] # [inline] pub fn clear (& self) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = BitmapFontMethodTable :: get (get_api ()) . clear ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; } } # [doc = "Creates a BitmapFont from the `*.fnt` file at `path`."] # [doc = ""] # [inline] pub fn create_from_fnt (& self , path : impl Into < GodotString >) -> GodotResult { unsafe { let method_bind : * mut sys :: godot_method_bind = BitmapFontMethodTable :: get (get_api ()) . create_from_fnt ; let ret = crate :: icalls :: icallvar__str (method_bind , self . this . sys () . as_ptr () , path . into ()) ; GodotError :: result_from_sys (sys :: godot_error :: from_variant (& ret) . expect ("Unexpected variant type")) } } # [doc = "The fallback font."] # [doc = ""] # [inline] pub fn fallback (& self) -> Option < Ref < crate :: generated :: BitmapFont , ownership :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = BitmapFontMethodTable :: get (get_api ()) . get_fallback ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < Option < Ref < crate :: generated :: BitmapFont , ownership :: Shared > > > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns a kerning pair as a difference."] # [doc = ""] # [inline] pub fn get_kerning_pair (& self , char_a : i64 , char_b : i64) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = BitmapFontMethodTable :: get (get_api ()) . get_kerning_pair ; let ret = crate :: icalls :: icallvar__i64_i64 (method_bind , self . this . sys () . as_ptr () , char_a as _ , char_b as _) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "Returns the font atlas texture at index `idx`."] # [doc = ""] # [inline] pub fn get_texture (& self , idx : i64) -> Option < Ref < crate :: generated :: Texture , ownership :: Shared > > { unsafe { let method_bind : * mut sys :: godot_method_bind = BitmapFontMethodTable :: get (get_api ()) . get_texture ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , idx as _) ; < Option < Ref < crate :: generated :: Texture , ownership :: Shared > > > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns the number of textures in the BitmapFont atlas."] # [doc = ""] # [inline] pub fn get_texture_count (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = BitmapFontMethodTable :: get (get_api ()) . get_texture_count ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "Ascent (number of pixels above the baseline)."] # [doc = ""] # [inline] pub fn set_ascent (& self , px : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = BitmapFontMethodTable :: get (get_api ()) . set_ascent ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , px as _) ; } } # [doc = "If `true`, distance field hint is enabled."] # [doc = ""] # [inline] pub fn set_distance_field_hint (& self , enable : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = BitmapFontMethodTable :: get (get_api ()) . set_distance_field_hint ; let ret = crate :: icalls :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , enable as _) ; } } # [doc = "The fallback font."] # [doc = ""] # [inline] pub fn set_fallback (& self , fallback : impl AsArg < crate :: generated :: BitmapFont >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = BitmapFontMethodTable :: get (get_api ()) . set_fallback ; let ret = crate :: icalls :: icallvar__obj (method_bind , self . this . sys () . as_ptr () , fallback . as_arg_ptr ()) ; } } # [doc = "Total font height (ascent plus descent) in pixels."] # [doc = ""] # [inline] pub fn set_height (& self , px : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = BitmapFontMethodTable :: get (get_api ()) . set_height ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , px as _) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for BitmapFont { } unsafe impl GodotObject for BitmapFont { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "BitmapFont" } } impl std :: ops :: Deref for BitmapFont { type Target = crate :: generated :: Font ; # [inline] fn deref (& self) -> & crate :: generated :: Font { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for BitmapFont { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: Font { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: Font > for BitmapFont { } unsafe impl SubClass < crate :: generated :: Resource > for BitmapFont { } unsafe impl SubClass < crate :: generated :: Reference > for BitmapFont { } unsafe impl SubClass < crate :: generated :: Object > for BitmapFont { } impl Instanciable for BitmapFont { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { BitmapFont :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct BitmapFontMethodTable { pub class_constructor : sys :: godot_class_constructor , pub add_char : * mut sys :: godot_method_bind , pub add_kerning_pair : * mut sys :: godot_method_bind , pub add_texture : * mut sys :: godot_method_bind , pub clear : * mut sys :: godot_method_bind , pub create_from_fnt : * mut sys :: godot_method_bind , pub get_fallback : * mut sys :: godot_method_bind , pub get_kerning_pair : * mut sys :: godot_method_bind , pub get_texture : * mut sys :: godot_method_bind , pub get_texture_count : * mut sys :: godot_method_bind , pub set_ascent : * mut sys :: godot_method_bind , pub set_distance_field_hint : * mut sys :: godot_method_bind , pub set_fallback : * mut sys :: godot_method_bind , pub set_height : * mut sys :: godot_method_bind } impl BitmapFontMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : BitmapFontMethodTable = BitmapFontMethodTable { class_constructor : None , add_char : 0 as * mut sys :: godot_method_bind , add_kerning_pair : 0 as * mut sys :: godot_method_bind , add_texture : 0 as * mut sys :: godot_method_bind , clear : 0 as * mut sys :: godot_method_bind , create_from_fnt : 0 as * mut sys :: godot_method_bind , get_fallback : 0 as * mut sys :: godot_method_bind , get_kerning_pair : 0 as * mut sys :: godot_method_bind , get_texture : 0 as * mut sys :: godot_method_bind , get_texture_count : 0 as * mut sys :: godot_method_bind , set_ascent : 0 as * mut sys :: godot_method_bind , set_distance_field_hint : 0 as * mut sys :: godot_method_bind , set_fallback : 0 as * mut sys :: godot_method_bind , set_height : 0 as * mut sys :: godot_method_bind } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { BitmapFontMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "BitmapFont\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . add_char = (gd_api . godot_method_bind_get_method) (class_name , "add_char\0" . as_ptr () as * const c_char) ; table . add_kerning_pair = (gd_api . godot_method_bind_get_method) (class_name , "add_kerning_pair\0" . as_ptr () as * const c_char) ; table . add_texture = (gd_api . godot_method_bind_get_method) (class_name , "add_texture\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 . create_from_fnt = (gd_api . godot_method_bind_get_method) (class_name , "create_from_fnt\0" . as_ptr () as * const c_char) ; table . get_fallback = (gd_api . godot_method_bind_get_method) (class_name , "get_fallback\0" . as_ptr () as * const c_char) ; table . get_kerning_pair = (gd_api . godot_method_bind_get_method) (class_name , "get_kerning_pair\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_texture_count = (gd_api . godot_method_bind_get_method) (class_name , "get_texture_count\0" . as_ptr () as * const c_char) ; table . set_ascent = (gd_api . godot_method_bind_get_method) (class_name , "set_ascent\0" . as_ptr () as * const c_char) ; table . set_distance_field_hint = (gd_api . godot_method_bind_get_method) (class_name , "set_distance_field_hint\0" . as_ptr () as * const c_char) ; table . set_fallback = (gd_api . godot_method_bind_get_method) (class_name , "set_fallback\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) ; } } } [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:567:8094 [INFO] [stdout] | [INFO] [stdout] 567 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 567 | # ! [doc = "This module contains types related to the API class [`Bone2D`][super::Bone2D]."] pub (crate) mod private { # [doc = "`core class Bone2D` inherits `Node2D` (manually managed)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_bone2d.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`Bone2D` 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\nBone2D 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 `Ownership` in these types tracks whether\nownership 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 Bone2D { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: Bone2D ; impl Bone2D { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = Bone2DMethodTable :: get (gd_api) . class_constructor . unwrap () ; let obj = ptr :: NonNull :: new (ctor ()) . expect ("constructor should not return null") ; Ref :: init_from_sys (obj) } } # [doc = "Stores the node's current transforms in [`rest`][Self::rest]."] # [doc = ""] # [inline] pub fn apply_rest (& self) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = Bone2DMethodTable :: get (get_api ()) . apply_rest ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; } } # [doc = "Length of the bone's representation drawn in the editor's viewport in pixels."] # [doc = ""] # [inline] pub fn default_length (& self) -> f64 { unsafe { let method_bind : * mut sys :: godot_method_bind = Bone2DMethodTable :: get (get_api ()) . get_default_length ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < f64 > :: coerce_from_variant (& ret) } } # [doc = "Returns the node's index as part of the entire skeleton. See [`Skeleton2D`][Skeleton2D]."] # [doc = ""] # [inline] pub fn get_index_in_skeleton (& self) -> i64 { unsafe { let method_bind : * mut sys :: godot_method_bind = Bone2DMethodTable :: get (get_api ()) . get_index_in_skeleton ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < i64 > :: coerce_from_variant (& ret) } } # [doc = "Rest transform of the bone. You can reset the node's transforms to this value using [`apply_rest`][Self::apply_rest]."] # [doc = ""] # [inline] pub fn rest (& self) -> Transform2D { unsafe { let method_bind : * mut sys :: godot_method_bind = Bone2DMethodTable :: get (get_api ()) . get_rest ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < Transform2D > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Returns the node's [`rest`][Self::rest] `Transform2D` if it doesn't have a parent, or its rest pose relative to its parent."] # [doc = ""] # [inline] pub fn get_skeleton_rest (& self) -> Transform2D { unsafe { let method_bind : * mut sys :: godot_method_bind = Bone2DMethodTable :: get (get_api ()) . get_skeleton_rest ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < Transform2D > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "Length of the bone's representation drawn in the editor's viewport in pixels."] # [doc = ""] # [inline] pub fn set_default_length (& self , default_length : f64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = Bone2DMethodTable :: get (get_api ()) . set_default_length ; let ret = crate :: icalls :: icallvar__f64 (method_bind , self . this . sys () . as_ptr () , default_length as _) ; } } # [doc = "Rest transform of the bone. You can reset the node's transforms to this value using [`apply_rest`][Self::apply_rest]."] # [doc = ""] # [inline] pub fn set_rest (& self , rest : Transform2D) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = Bone2DMethodTable :: get (get_api ()) . set_rest ; let ret = crate :: icalls :: icallvar__trans2D (method_bind , self . this . sys () . as_ptr () , rest) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for Bone2D { } unsafe impl GodotObject for Bone2D { type Memory = memory :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "Bone2D" } } impl QueueFree for Bone2D { # [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 :: icallvar_ (method_bind , obj) ; } } impl std :: ops :: Deref for Bone2D { type Target = crate :: generated :: Node2D ; # [inline] fn deref (& self) -> & crate :: generated :: Node2D { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for Bone2D { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: Node2D { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: Node2D > for Bone2D { } unsafe impl SubClass < crate :: generated :: CanvasItem > for Bone2D { } unsafe impl SubClass < crate :: generated :: Node > for Bone2D { } unsafe impl SubClass < crate :: generated :: Object > for Bone2D { } impl Instanciable for Bone2D { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { Bone2D :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct Bone2DMethodTable { pub class_constructor : sys :: godot_class_constructor , pub apply_rest : * mut sys :: godot_method_bind , pub get_default_length : * mut sys :: godot_method_bind , pub get_index_in_skeleton : * mut sys :: godot_method_bind , pub get_rest : * mut sys :: godot_method_bind , pub get_skeleton_rest : * mut sys :: godot_method_bind , pub set_default_length : * mut sys :: godot_method_bind , pub set_rest : * mut sys :: godot_method_bind } impl Bone2DMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : Bone2DMethodTable = Bone2DMethodTable { class_constructor : None , apply_rest : 0 as * mut sys :: godot_method_bind , get_default_length : 0 as * mut sys :: godot_method_bind , get_index_in_skeleton : 0 as * mut sys :: godot_method_bind , get_rest : 0 as * mut sys :: godot_method_bind , get_skeleton_rest : 0 as * mut sys :: godot_method_bind , set_default_length : 0 as * mut sys :: godot_method_bind , set_rest : 0 as * mut sys :: godot_method_bind } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { Bone2DMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "Bone2D\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . apply_rest = (gd_api . godot_method_bind_get_method) (class_name , "apply_rest\0" . as_ptr () as * const c_char) ; table . get_default_length = (gd_api . godot_method_bind_get_method) (class_name , "get_default_length\0" . as_ptr () as * const c_char) ; table . get_index_in_skeleton = (gd_api . godot_method_bind_get_method) (class_name , "get_index_in_skeleton\0" . as_ptr () as * const c_char) ; table . get_rest = (gd_api . godot_method_bind_get_method) (class_name , "get_rest\0" . as_ptr () as * const c_char) ; table . get_skeleton_rest = (gd_api . godot_method_bind_get_method) (class_name , "get_skeleton_rest\0" . as_ptr () as * const c_char) ; table . set_default_length = (gd_api . godot_method_bind_get_method) (class_name , "set_default_length\0" . as_ptr () as * const c_char) ; table . set_rest = (gd_api . godot_method_bind_get_method) (class_name , "set_rest\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:573:5434 [INFO] [stdout] | [INFO] [stdout] 573 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 573 | # ! [doc = "This module contains types related to the API class [`BoneAttachment`][super::BoneAttachment]."] pub (crate) mod private { # [doc = "`core class BoneAttachment` inherits `Spatial` (manually managed)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_boneattachment.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`BoneAttachment` 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\nBoneAttachment 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 `Ownership` in these types tracks whether\nownership 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 BoneAttachment { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: BoneAttachment ; impl BoneAttachment { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = BoneAttachmentMethodTable :: 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 name of the attached bone."] # [doc = ""] # [inline] pub fn bone_name (& self) -> GodotString { unsafe { let method_bind : * mut sys :: godot_method_bind = BoneAttachmentMethodTable :: get (get_api ()) . get_bone_name ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < GodotString > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "The name of the attached bone."] # [doc = ""] # [inline] pub fn set_bone_name (& self , bone_name : impl Into < GodotString >) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = BoneAttachmentMethodTable :: get (get_api ()) . set_bone_name ; let ret = crate :: icalls :: icallvar__str (method_bind , self . this . sys () . as_ptr () , bone_name . into ()) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for BoneAttachment { } unsafe impl GodotObject for BoneAttachment { type Memory = memory :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "BoneAttachment" } } impl QueueFree for BoneAttachment { # [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 :: icallvar_ (method_bind , obj) ; } } impl std :: ops :: Deref for BoneAttachment { type Target = crate :: generated :: Spatial ; # [inline] fn deref (& self) -> & crate :: generated :: Spatial { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for BoneAttachment { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: Spatial { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: Spatial > for BoneAttachment { } unsafe impl SubClass < crate :: generated :: Node > for BoneAttachment { } unsafe impl SubClass < crate :: generated :: Object > for BoneAttachment { } impl Instanciable for BoneAttachment { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { BoneAttachment :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct BoneAttachmentMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_bone_name : * mut sys :: godot_method_bind , pub set_bone_name : * mut sys :: godot_method_bind } impl BoneAttachmentMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : BoneAttachmentMethodTable = BoneAttachmentMethodTable { class_constructor : None , get_bone_name : 0 as * mut sys :: godot_method_bind , set_bone_name : 0 as * mut sys :: godot_method_bind } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { BoneAttachmentMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "BoneAttachment\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . get_bone_name = (gd_api . godot_method_bind_get_method) (class_name , "get_bone_name\0" . as_ptr () as * const c_char) ; table . set_bone_name = (gd_api . godot_method_bind_get_method) (class_name , "set_bone_name\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:579:5951 [INFO] [stdout] | [INFO] [stdout] 579 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 579 | # ! [doc = "This module contains types related to the API class [`BoxContainer`][super::BoxContainer]."] pub (crate) mod private { # [doc = "`core class BoxContainer` inherits `Container` (manually managed).\n\nThis class has related types in the [`box_container`][super::box_container] module."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_boxcontainer.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\nBoxContainer 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 `Ownership` in these types tracks whether\nownership 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 BoxContainer { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: BoxContainer ; # [derive (Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash)] pub struct AlignMode (pub i64) ; impl AlignMode { pub const BEGIN : AlignMode = AlignMode (0i64) ; pub const CENTER : AlignMode = AlignMode (1i64) ; pub const END : AlignMode = AlignMode (2i64) ; } impl From < i64 > for AlignMode { # [inline] fn from (v : i64) -> Self { Self (v) } } impl From < AlignMode > for i64 { # [inline] fn from (v : AlignMode) -> Self { v . 0 } } impl FromVariant for AlignMode { # [inline] fn from_variant (v : & Variant) -> Result < Self , FromVariantError > { i64 :: from_variant (v) . map (Self :: from) } } # [doc = "Constants"] # [allow (non_upper_case_globals)] impl BoxContainer { pub const ALIGN_BEGIN : i64 = 0i64 ; pub const ALIGN_CENTER : i64 = 1i64 ; pub const ALIGN_END : i64 = 2i64 ; } impl BoxContainer { # [doc = "Adds a control to the box as a spacer. If `true`, `begin` will insert the spacer control in front of other children."] # [doc = ""] # [inline] pub fn add_spacer (& self , begin : bool) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = BoxContainerMethodTable :: get (get_api ()) . add_spacer ; let ret = crate :: icalls :: icallvar__bool (method_bind , self . this . sys () . as_ptr () , begin as _) ; } } # [doc = "The alignment of the container's children (must be one of [`ALIGN_BEGIN`][Self::ALIGN_BEGIN], [`ALIGN_CENTER`][Self::ALIGN_CENTER] or [`ALIGN_END`][Self::ALIGN_END])."] # [doc = ""] # [inline] pub fn alignment (& self) -> crate :: generated :: box_container :: AlignMode { unsafe { let method_bind : * mut sys :: godot_method_bind = BoxContainerMethodTable :: get (get_api ()) . get_alignment ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < crate :: generated :: box_container :: AlignMode > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "The alignment of the container's children (must be one of [`ALIGN_BEGIN`][Self::ALIGN_BEGIN], [`ALIGN_CENTER`][Self::ALIGN_CENTER] or [`ALIGN_END`][Self::ALIGN_END])."] # [doc = ""] # [inline] pub fn set_alignment (& self , alignment : i64) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = BoxContainerMethodTable :: get (get_api ()) . set_alignment ; let ret = crate :: icalls :: icallvar__i64 (method_bind , self . this . sys () . as_ptr () , alignment as _) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for BoxContainer { } unsafe impl GodotObject for BoxContainer { type Memory = memory :: ManuallyManaged ; # [inline] fn class_name () -> & 'static str { "BoxContainer" } } impl QueueFree for BoxContainer { # [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 :: icallvar_ (method_bind , obj) ; } } impl std :: ops :: Deref for BoxContainer { type Target = crate :: generated :: Container ; # [inline] fn deref (& self) -> & crate :: generated :: Container { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for BoxContainer { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: Container { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: Container > for BoxContainer { } unsafe impl SubClass < crate :: generated :: Control > for BoxContainer { } unsafe impl SubClass < crate :: generated :: CanvasItem > for BoxContainer { } unsafe impl SubClass < crate :: generated :: Node > for BoxContainer { } unsafe impl SubClass < crate :: generated :: Object > for BoxContainer { } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct BoxContainerMethodTable { pub class_constructor : sys :: godot_class_constructor , pub add_spacer : * mut sys :: godot_method_bind , pub get_alignment : * mut sys :: godot_method_bind , pub set_alignment : * mut sys :: godot_method_bind } impl BoxContainerMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : BoxContainerMethodTable = BoxContainerMethodTable { class_constructor : None , add_spacer : 0 as * mut sys :: godot_method_bind , get_alignment : 0 as * mut sys :: godot_method_bind , set_alignment : 0 as * mut sys :: godot_method_bind } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { BoxContainerMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "BoxContainer\0" . as_ptr () as * const c_char ; table . class_constructor = (gd_api . godot_get_class_constructor) (class_name) ; table . add_spacer = (gd_api . godot_method_bind_get_method) (class_name , "add_spacer\0" . as_ptr () as * const c_char) ; table . get_alignment = (gd_api . godot_method_bind_get_method) (class_name , "get_alignment\0" . as_ptr () as * const c_char) ; table . set_alignment = (gd_api . godot_method_bind_get_method) (class_name , "set_alignment\0" . as_ptr () as * const c_char) ; } } } [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:585:4429 [INFO] [stdout] | [INFO] [stdout] 585 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 585 | # ! [doc = "This module contains types related to the API class [`BoxShape`][super::BoxShape]."] pub (crate) mod private { # [doc = "`core class BoxShape` inherits `Shape` (reference-counted)."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/classes/class_boxshape.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\nBoxShape 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 `Ownership` in these types tracks whether\nownership 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 BoxShape { # [allow (dead_code)] pub (crate) this : super :: RawObject < Self > , } } use private :: BoxShape ; impl BoxShape { # [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 , ownership :: Unique > { unsafe { let gd_api = get_api () ; let ctor = BoxShapeMethodTable :: 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 box's half extents. The width, height and depth of this shape is twice the half extents."] # [doc = ""] # [inline] pub fn extents (& self) -> Vector3 { unsafe { let method_bind : * mut sys :: godot_method_bind = BoxShapeMethodTable :: get (get_api ()) . get_extents ; let ret = crate :: icalls :: icallvar_ (method_bind , self . this . sys () . as_ptr ()) ; < Vector3 > :: from_variant (& ret) . expect ("Unexpected variant type") } } # [doc = "The box's half extents. The width, height and depth of this shape is twice the half extents."] # [doc = ""] # [inline] pub fn set_extents (& self , extents : Vector3) -> () { unsafe { let method_bind : * mut sys :: godot_method_bind = BoxShapeMethodTable :: get (get_api ()) . set_extents ; let ret = crate :: icalls :: icallvar__vec3 (method_bind , self . this . sys () . as_ptr () , extents) ; } } } impl gdnative_core :: private :: godot_object :: Sealed for BoxShape { } unsafe impl GodotObject for BoxShape { type Memory = memory :: RefCounted ; # [inline] fn class_name () -> & 'static str { "BoxShape" } } impl std :: ops :: Deref for BoxShape { type Target = crate :: generated :: Shape ; # [inline] fn deref (& self) -> & crate :: generated :: Shape { unsafe { std :: mem :: transmute (self) } } } impl std :: ops :: DerefMut for BoxShape { # [inline] fn deref_mut (& mut self) -> & mut crate :: generated :: Shape { unsafe { std :: mem :: transmute (self) } } } unsafe impl SubClass < crate :: generated :: Shape > for BoxShape { } unsafe impl SubClass < crate :: generated :: Resource > for BoxShape { } unsafe impl SubClass < crate :: generated :: Reference > for BoxShape { } unsafe impl SubClass < crate :: generated :: Object > for BoxShape { } impl Instanciable for BoxShape { # [inline] fn construct () -> Ref < Self , ownership :: Unique > { BoxShape :: new () } } # [doc (hidden)] # [allow (non_camel_case_types , dead_code)] pub (crate) struct BoxShapeMethodTable { pub class_constructor : sys :: godot_class_constructor , pub get_extents : * mut sys :: godot_method_bind , pub set_extents : * mut sys :: godot_method_bind } impl BoxShapeMethodTable { unsafe fn get_mut () -> & 'static mut Self { static mut TABLE : BoxShapeMethodTable = BoxShapeMethodTable { class_constructor : None , get_extents : 0 as * mut sys :: godot_method_bind , set_extents : 0 as * mut sys :: godot_method_bind } ; &raw 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 = std :: sync :: Once :: new () ; INIT . call_once (|| { BoxShapeMethodTable :: init (table , gd_api) ; }) ; table } } # [inline (never)] # [allow (dead_code)] fn init (table : & mut Self , gd_api : & GodotApi) { unsafe { let class_name = "BoxShape\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 [INFO] [stdout] --> /opt/rustwide/target/x86_64-unknown-linux-musl/debug/build/gdnative-bindings-4a3550323a05e656/out/generated.rs:597:13587 [INFO] [stdout] | [INFO] [stdout] 597 | ... : 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 [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] help: use `&raw mut` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 597 | # ! [doc = "This module contains types related to the API class [`Button`][super::Button]."] pub (crate) mod private { # [doc = "`core class Button` inherits `BaseButton` (manually managed).\n\nThis class has related types in the [`button`][super::button] module."] # [doc = "## Official documentation\n\nSee the [documentation of this class](https://godot.readthedocs.io/en/stable/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