struct Slice(T)
- Slice(T)
- Struct
- Value
- Object
Overview
A Slice
is a Pointer
with an associated size.
While a pointer is unsafe because no bound checks are performed when reading from and writing to it,
reading from and writing to a slice involve bound checks.
In this way, a slice is a safe alternative to Pointer
.
A Slice can be created as read-only: trying to write to it
will raise. For example the slice of bytes returned by
String#to_slice
is read-only.
Included Modules
- Comparable(Slice(T))
- Indexable::Mutable(T)
Defined in:
shatter/data.crshatter/util.cr
Instance Method Summary
- #to_json(json : JSON::Builder) : Nil
- #wide_hexdump(io : IO)
- #wide_hexdump(*, address = 8, sections = 2, prefix = "") : String