# pyo3::pyclass_slots::PyClassWeakRef - Rust
Represents `__weakref__` field for `#[pyclass]`.
Keywords: rust, rustlang, rust-lang, PyClassWeakRef

# Trait pyo3::pyclass_slots::PyClassWeakRef [−] [src]

    pub trait PyClassWeakRef {
        const IS_DUMMY: bool;

        fn new() -> Self;
        fn __private__(&self) -> PrivateMarker;

        unsafe fn clear_weakrefs(&mut self, _obj: *mut PyObject, _py: Python<'_>) { ... }
    }

Represents `__weakref__` field for `#[pyclass]`.

## Associated Constants

### `const IS_DUMMY: bool` [src]

Loading content...

## Required methods

### `fn new() -> Self` [src]

### `fn __private__(&self) -> PrivateMarker` [src]

This trait is private to implement; this method exists to make it impossible to implement outside the crate.

Loading content...

## Provided methods

### `unsafe fn clear_weakrefs(&mut self, _obj: *mut PyObject, _py: Python<'_>)` [src]

Loading content...

## Implementors

### `impl PyClassWeakRef for PyClassDummySlot` [src]

#### `fn new() -> Self` [src]

### `impl PyClassWeakRef for PyClassWeakRefSlot` [src]

#### `const IS_DUMMY: bool` [src]

#### `fn new() -> Self` [src]

#### `unsafe fn clear_weakrefs(&mut self, obj: *mut PyObject, _py: Python<'_>)` [src]

Loading content...