<div class='type'>Function</div>


<a id='references'></a>


<h2 id="ascontextelement">asContextElement</h2>

<div class='sourceset sourceset-common'>Common</div>


```kotlin
public fun Snapshot.asContextElement(): SnapshotContextElement
```


Return a `SnapshotContextElement` that will `enter` this `Snapshot` whenever the
associated coroutine is resumed and leave this snapshot when it suspends. The snapshot still must
be `disposed` separately when it will no longer be used.