[Canonical page](<https://docs.dhtmlx.com/planning-engine/rust/api/core/data/pause-source/>)
[Full documentation index](<https://docs.dhtmlx.com/planning-engine/llms.txt>)


# PauseSource

Records who wrote a pause. It's the type of [`Pause::by`](<https://docs.dhtmlx.com/planning-engine/rust/api/core/data/pause.md>), which is `Option<PauseSource>` and defaults to `None`.

## Declaration

```rust
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum PauseSource {
    Leveling,
}
```

With the `serde` feature, `PauseSource` implements `Serialize` and `Deserialize`. Variants serialize in lowercase: `PauseSource::Leveling` is `"leveling"`.

## Variants

| Variant | Description |
|---|---|
| `Leveling` | The pause was written by resource leveling. It's the only value. |

The value doesn't change how a pause is treated: every pause counts as leveling-owned. See [`Pause`](<https://docs.dhtmlx.com/planning-engine/rust/api/core/data/pause.md>).

## Example

```rust
use plen_core::{Pause, PauseSource};

fn main() {
    let pause = Pause::leveling(1.0, 0.5);
    assert_eq!(pause.by, Some(PauseSource::Leveling));

    let manual = Pause::new(1.0, 0.5);
    assert_eq!(manual.by, None);
}
```

## Related

- [`Pause`](<https://docs.dhtmlx.com/planning-engine/rust/api/core/data/pause.md>) - the pause that records its source
- [`Project::level`](<https://docs.dhtmlx.com/planning-engine/rust/api/core/project/project.md#level>) - writes leveling pauses
- [Leveling Resources](<https://docs.dhtmlx.com/planning-engine/rust/resources-and-assignment/leveling-resources.md#delays-and-pauses>) - how leveling marks the pauses it writes
- [Serialize results to JSON](<https://docs.dhtmlx.com/planning-engine/rust/how-to/serialize-results-to-json.md>) - the serialized form of pauses and their source
