Skip to main content

CallExpression

Struct CallExpression 

Source
pub struct CallExpression {
    pub function: Box<Expression>,
    pub arguments: Vec<Box<Expression>>,
    pub location: SourceLocation,
}

Fields§

§function: Box<Expression>§arguments: Vec<Box<Expression>>§location: SourceLocation

Implementations§

Source§

impl CallExpression

Source

pub fn function_name(&self) -> &str

Get the function name as a string For identifiers, returns the name For field access, returns the full text (e.g., “parent_class->dispose”)

Source

pub fn is_function(&self, name: &str) -> bool

Check if the function matches a specific name

Source

pub fn function_contains(&self, pattern: &str) -> bool

Check if function name contains a pattern

Source

pub fn function_ends_with(&self, pattern: &str) -> bool

Check if function name ends with a pattern

Source

pub fn function_name_str(&self) -> Option<&str>

Get the function name as &str (for common case of identifier) Returns None if function is not a simple identifier

Source

pub fn get_arg(&self, index: usize) -> Option<&Expression>

Get the expression for the argument at the given index

Source

pub fn get_arg_text(&self, index: usize) -> Option<&str>

Get argument as source text

Source

pub fn has_arg_matching<F>(&self, index: usize, predicate: F) -> bool
where F: FnOnce(&Expression) -> bool,

Check if the argument at the given index exists and matches the predicate

Source

pub fn arg_contains_variable(&self, index: usize, var_name: &str) -> bool

Check if the argument at the given index contains a reference to the specified variable Handles both plain identifiers and field access (e.g., obj->field)

Source

pub fn is_likely_macro(&self) -> bool

Check if this looks like a macro call (ALL_CAPS or ends with ) Examples: I, N_, G_STRINGIFY, GINT_TO_POINTER

Source

pub fn extract_string_from_arg(&self, index: usize) -> Option<String>

Extract string literal from argument, unwrapping macro calls like I_(“string”) This is useful for g_param_spec calls where the name might be I_(“property-name”)

Source

pub fn is_allocation_call(&self) -> bool

Check if this call is a GObject allocation function Recognizes g_object_new, g_new, and various other allocation patterns

Source

pub fn is_cleanup_call(&self) -> bool

Check if this call is a GObject cleanup/free function Recognizes g_object_unref, g_free, and various other cleanup patterns

Trait Implementations§

Source§

impl Clone for CallExpression

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CallExpression

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Serialize for CallExpression

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more