> Aztec.nr API reference, v6.0.0 (mainnet and testnet). Index: https://docs.aztec.network/aztec-nr-api/mainnet/llms.txt

# Struct PublicCall

Module: `noir_aztec::context::calls`

```rust
pub struct PublicCall<let M: u32, let N: u32, T> {
    pub target_contract: AztecAddress,
    pub selector: FunctionSelector,
    pub name: str<M>,
    pub args: [Field; N],
    /* private fields */
}
```

## Fields

```rust
target_contract: AztecAddress
```

```rust
selector: FunctionSelector
```

```rust
name: str<M>
```

```rust
args: [Field; N]
```

## Implementations

```rust
impl<let M: u32, let N: u32, T> PublicCall<M, N, T>
```

```rust
pub fn new(
    target_contract: AztecAddress,
    selector: FunctionSelector,
    name: str<M>,
    args: [Field; N],
) -> Self
```

```rust
pub fn with_gas(self, gas_opts: GasOpts) -> Self
```

```rust
pub unconstrained fn call(self, context: PublicContext) -> T
where
    T: Deserialize
```

**DEPRECATED**.

Please use the new contract API: `self.call(MyContract::at(address).my_public_function(...args))` instead of manually constructing and calling `PublicCall`.

```rust
pub fn enqueue(self, context: &mut PrivateContext)
```

**DEPRECATED**.

Please use the new contract API: `self.enqueue(MyContract::at(address).my_public_function(...args))` instead of manually constructing and calling `PublicCall`.

```rust
pub fn enqueue_incognito(self, context: &mut PrivateContext)
```

**DEPRECATED**.

Please use the new contract API: `self.enqueue_incognito(MyContract::at(address).my_public_function(...args))` instead of manually constructing and calling `PublicCall`.

```rust
pub fn set_as_teardown(self, context: &mut PrivateContext)
```

**DEPRECATED**.

Please use the new contract API: `self.set_as_teardown(MyContract::at(address).my_public_function(...args))` instead of manually constructing and setting the teardown function `PublicCall`.

```rust
pub fn set_as_teardown_incognito(self, context: &mut PrivateContext)
```

**DEPRECATED**.

Please use the new contract API: `self.set_as_teardown_incognito(MyContract::at(address).my_public_function(...args))` instead of manually constructing and setting the teardown function `PublicCall`.
