Function indexing::container::scope
[−]
[src]
pub fn scope<Array, F, Out>(arr: Array, f: F) -> Out where
F: for<'id> FnOnce(Container<'id, Array>) -> Out,
Array: Trustworthy,
Create an indexing scope for a container.
The indexing scope is a closure that is passed a unique lifetime for
the parameter 'id
; this lifetime brands the container and its indices
and ranges, so that they are trusted to be in bounds.
Indices and ranges branded with 'id
can not leave the closure. The
container can only be accessed and mutated through the Container
wrapper
passed as the first argument to the indexing scope.