Struct ElementScript
pub struct ElementScript { /* private fields */ }
Expand description
Compact representation inside ElementType::ScriptClass
.
Encapsulates a Gd<Script>
, obtained via script()
.
Implementations§
§impl ElementScript
impl ElementScript
pub fn new(script: Gd<Script>) -> ElementScript
pub fn new(script: Gd<Script>) -> ElementScript
Create a new ElementScriptType
from a script.
pub fn script(&self) -> Option<Gd<Script>>
pub fn script(&self) -> Option<Gd<Script>>
Returns the script object, if still alive.
The script is a Resource
and won’t be kept alive by this type-info struct. If the resource has been deallocated,
this method returns None
.
pub fn base_class_id(&self) -> Option<ClassId>
pub fn base_class_id(&self) -> Option<ClassId>
Returns the native base class of the script.
Typically, this corresponds to the class mentioned in extends
in GDScript.
Trait Implementations§
§impl Clone for ElementScript
impl Clone for ElementScript
§fn clone(&self) -> ElementScript
fn clone(&self) -> ElementScript
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more§impl PartialEq for ElementScript
impl PartialEq for ElementScript
impl Copy for ElementScript
impl Eq for ElementScript
impl StructuralPartialEq for ElementScript
Auto Trait Implementations§
impl Freeze for ElementScript
impl RefUnwindSafe for ElementScript
impl Send for ElementScript
impl Sync for ElementScript
impl Unpin for ElementScript
impl UnwindSafe for ElementScript
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more