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

# Primitive type Module

Module: `std`

A compile-time type which represents a module in this source program.

A `Module` is passed as the first argument to a macro attribute on top of a module:

```rust
#[attr]
mod foo {}

comptime fn attr(module: Module) {
    println(module.name()); // outputs "quote { foo }"
}
```

It can also be obtained using [`Quoted::as_module`](/aztec-nr-api/v6.0.0/std/primitive.Quoted.md#as_module):

```rust
mod foo {}

fn main() {
    comptime {
        let module = quote { foo }.as_module().unwrap();
        println(module.name()); // outputs "quote { foo }"
    }
}
```

## Implementations

```rust
impl Module
```

```rust
pub comptime fn has_named_attribute<let N: u32>(self, name: str<N>) -> bool
```

```rust
pub comptime fn named_attribute_args<let N: u32>(self, name: str<N>) -> [[Quoted]]
```

```rust
pub comptime fn has_builtin_attribute<let N: u32>(self, name: str<N>) -> bool
```

```rust
pub comptime fn is_contract(self) -> bool
```

```rust
pub comptime fn location(self) -> Location
```

```rust
pub comptime fn functions(self) -> [FunctionDefinition]
```

```rust
pub comptime fn structs(self) -> [TypeDefinition]
```

```rust
pub comptime fn child_modules(self) -> [Self]
```

```rust
pub comptime fn name(self) -> Quoted
```

```rust
pub comptime fn parent(self) -> Option<Self>
```

## Trait implementations

```rust
impl Eq for Module
```

```rust
pub comptime fn eq(self, other: Self) -> bool
```

```rust
impl Hash for Module
```

```rust
pub comptime fn hash<H>(self, state: &mut H)
where
    H: Hasher
```
