silk.collections.column_list.

Growable lists that store each field of a struct in its own column.

When to use#

Use ColumnList for many rows of a Copy struct when code reads or writes a few of the fields at a time, such as the positions of all particles or the links between the nodes of a tree. A field access touches only the bytes of that field, so a loop over two fields of a wide row loads far less memory than the same loop over a slice of structs. Use silk.collections.list.List when code handles one whole element at a time, or when the elements own storage.

Details#

The row type T is a struct or a named tuple that the caller declares. The list keeps one allocation that holds every column. The columns are in order of falling alignment and then in declaration order, so no column needs padding: a row of x: f32, alive: bool, id: u64, y: f32 is 24 bytes as a struct and 17 bytes in a ColumnList.

Index a list and name a field to use one field of one row: particles[3].x reads it, particles[3].x = 1.0 writes it, and &mut particles[3].x borrows it. Fields after the first one are ordinary: particles[3].position.y is one load from the position column. The index is a usize or a silk.collections.id.Id of the row type. Write .. as the index for the whole column: &particles[..].x is a &[f32] with one element for each row, and &mut particles[..].x is a &mut [f32]. The borrow rules apply to each column apart, so code can write one column while it reads another one.

A field that is itself a struct is one column of that struct. Put the fields that code reads together in a child struct, and they are next to each other in memory.

ColumnList.rows and ColumnList.rowsMut give the handles Rows and RowsMut. A handle takes the same index forms as the list. It keeps the address of the storage by value, so it is the form to use in a loop and as a parameter in place of a slice of rows. Rows.range and RowsMut.splitAt give handles for a part of the rows.

ColumnList.make does not allocate. The first growth allocates space for four rows, and each later growth doubles the capacity. A growth moves every column, so a failed growth leaves the list unchanged.

Gotchas#

The row type must implement Copy, every field of it must be pub, and at least one field must have a size. An index alone, as in particles[3], is a compile error: read a whole row with ColumnList.get and replace it with ColumnList.set. A row index traps if it is not less than the length.

Examples#

Read and write the fields of rows#

silk
import silk.collections.column_list { ColumnList }
import silk.core.effect { Effect }
import silk.core.ownership { Copy }
import silk.mem.allocator { Allocator, OutOfMemoryError }

struct Point {
  pub x: f32,
  pub y: f32,
}

impl Copy for Point {}

struct Particle {
  pub position: Point,
  pub speed: f32,
  pub alive: bool,
}

impl Copy for Particle {}

effect fn moved() -> f32
  ! OutOfMemoryError
  ? &mut Allocator {
  let mut particles = ColumnList<Particle>.make()
  run particles.append(Particle { position: Point { x: 1.0, y: 0.0 }, speed: 4.0, alive: true })
  run particles.append(Particle { position: Point { x: 9.0, y: 0.0 }, speed: 1.0, alive: false })
  let mut at: usize = 0
  while at < particles.length() {
    // Each access loads or stores one field of one row.
    if particles[at].alive {
      particles[at].position.x = particles[at].position.x + particles[at].speed * 0.5
    }
    at = at + 1
  }
  return particles[0].position.x + particles[1].position.x
}

effect fn recover(error: OutOfMemoryError) -> f32 {
  return 0.0
}

pub fn main() -> i32 {
  let mut allocator = Allocator.systemAllocatorProvider()
  let sum = run moved()
    |> Effect.provideMut<Allocator>(&mut allocator)
    |> Effect.catchAll(recover)
  if sum != 12.0 {
    return 1
  }
  return 0
}

Write one column while reading another#

silk
import silk.collections.column_list { ColumnList }
import silk.core.effect { Effect }
import silk.core.ownership { Copy }
import silk.mem.allocator { Allocator, OutOfMemoryError }

struct Particle {
  pub x: f32,
  pub speed: f32,
  pub id: u64,
}

impl Copy for Particle {}

// The signature states which column the function writes and which one it reads.
fn advance(x: &mut [f32], speed: &[f32], seconds: f32) -> () {
  let mut at: usize = 0
  while at < x.length {
    x[at] = x[at] + speed[at] * seconds
    at = at + 1
  }
  return ()
}

effect fn moved() -> f32
  ! OutOfMemoryError
  ? &mut Allocator {
  let mut particles = ColumnList<Particle>.make()
  run particles.append(Particle { x: 1.0, speed: 4.0, id: 1 })
  // `..` stands for every row. The two borrows are of different columns.
  advance(&mut particles[..].x, &particles[..].speed, 0.5)
  return particles[0].x
}

effect fn recover(error: OutOfMemoryError) -> f32 {
  return 0.0
}

pub fn main() -> i32 {
  let mut allocator = Allocator.systemAllocatorProvider()
  let x = run moved()
    |> Effect.provideMut<Allocator>(&mut allocator)
    |> Effect.catchAll(recover)
  if x != 3.0 {
    return 1
  }
  return 0
}

Pass a part of the rows to a function#

silk
import silk.collections.column_list { ColumnList, RowsMut }
import silk.core.effect { Effect }
import silk.core.ownership { Copy }
import silk.mem.allocator { Allocator, OutOfMemoryError }

struct Cell {
  pub width: u32,
  pub offset: u32,
}

impl Copy for Cell {}

// The function takes a handle in place of a `&mut [Cell]`. Its indexes start at the first row
// of the handle.
fn place(cells: RowsMut<'_, Cell>) -> () {
  let mut cells = move cells
  let mut offset: u32 = 0
  let mut at: usize = 0
  while at < cells.length() {
    cells[at].offset = offset
    offset = offset + cells[at].width
    at = at + 1
  }
  return ()
}

effect fn placed() -> u32
  ! OutOfMemoryError
  ? &mut Allocator {
  let mut cells = ColumnList<Cell>.make()
  run cells.appendRepeated(Cell { width: 10, offset: 0 }, 4)
  let mut all = cells.rowsMut()
  place(all.range(1, 4))
  return cells[3].offset
}

effect fn recover(error: OutOfMemoryError) -> u32 {
  return 0
}

pub fn main() -> i32 {
  let mut allocator = Allocator.systemAllocatorProvider()
  let offset = run placed()
    |> Effect.provideMut<Allocator>(&mut allocator)
    |> Effect.catchAll(recover)
  if offset != 20 {
    return 1
  }
  return 0
}

Import as ColumnList with import silk.collections.column_list { ColumnList }.

Public declarations: 5.

ColumnList#

silk
pub struct ColumnList<T>

A growable list of T rows that stores each field of T in its own column.

Details#

The length is the number of rows. The capacity is the number of rows that fit before the next growth. All columns live in one allocation, in order of falling alignment and then in declaration order, with no padding between or inside them. Dropping the list releases the allocation. A list is affine.

list[i].field is one field of one row, where i is a usize or an Id<T>, and list[..].field is that field of every row as a slice.

Gotchas#

T must implement Copy, every field of T must be pub, and at least one field must have a size. A field that is itself a struct is one column of that struct.

Rows#

silk
pub struct Rows<'a, T>

A shared handle for a run of the rows of a ColumnList, borrowed for 'a.

When to use#

Use it where slice-of-struct code has a &[T]: as a parameter, and for the rows that a loop reads. Get one from ColumnList.rows, and a part of one from Rows.range.

Details#

rows[i].field reads one field of one row, and &rows[..].field is that field of every row of the handle as a slice. A usize index counts from the first row of the handle. An Id<T> index is the row's number in the list, whichever rows the handle has. A handle is Copy. It keeps the address of the storage by value, so a loop does not load it again from the list.

Gotchas#

A row index traps if it names a row outside the handle. The list cannot change while a handle is live.

Implementation Copy for Rows<'a, T>#

silk
impl<'a, T> Copy for Rows<'a, T>

RowsMut#

silk
pub struct RowsMut<'a, T>

An exclusive handle for a run of the rows of a ColumnList, borrowed for 'a.

When to use#

Use it where slice-of-struct code has a &mut [T]: as a parameter, and for the rows that a loop writes. Get one from ColumnList.rowsMut. RowsMut.range lends a part of the rows, and RowsMut.splitAt cuts the handle into two handles that code can write at the same time.

Details#

rows[i].field is one field of one row for reading and writing, and &mut rows[..].field is that field of every row of the handle as a slice. A usize index counts from the first row of the handle. An Id<T> index is the row's number in the list, whichever rows the handle has. The handle keeps the address of the storage by value, so a loop does not load it again after each store.

Gotchas#

A row index traps if it names a row outside the handle. The handle cannot add or remove rows, and the list cannot be used while the handle is live.

RowsPair#

silk
pub struct RowsPair<'a, T>

The two handles that RowsMut.splitAt returns: the rows before the cut and the rows from it.

Field left#

silk
pub left: RowsMut<'a, T>

The rows before the cut.

Field right#

silk
pub right: RowsMut<'a, T>

The rows from the cut to the end.

ColumnSort#

silk
pub struct ColumnSort

The working storage of ColumnList.sortBy.

When to use#

Make one with ColumnSort.make and pass it to each sort. It keeps its storage between calls, so a sort allocates only when the list has more rows than any list it sorted before.

Implementation ColumnSort#

silk
impl ColumnSort

Associated function make#

silk
pub fn make() -> ColumnSort

Returns working storage that holds nothing. This function does not allocate.

Implementation ColumnList<T>#

silk
impl<T: Copy> ColumnList<T>

Associated function make#

silk
pub fn make() -> ColumnList<T>

Returns an empty list. This function does not allocate.

Associated function makeWithCapacity#

silk
pub effect fn makeWithCapacity(capacity: usize) -> ColumnList<T>
    ! OutOfMemoryError
    ? &mut Allocator

Returns an empty list with storage for exactly capacity rows.

Errors#

  • OutOfMemoryError if the size of capacity rows overflows, or the Allocator cannot supply the storage.

Method length#

silk
pub fn length(self: &Self) -> usize

Returns the number of rows in the list.

Method capacity#

silk
pub fn capacity(self: &Self) -> usize

Returns the number of rows that fit in the current storage before the next growth.

Method column#

silk
pub fn column<'s, V>(self: &'s Self, static field: Intrinsic.Field<T, V>) -> &'s [V]

Returns a shared borrow of the column of field, one element for each row, in row order.

When to use#

Use column in a function that takes the field as a static parameter. Code that names the field writes &rows[..].field, which gives the same slice and lends only that column.

Details#

field is a static argument. Write the field's name as a string literal: ColumnList<Particle>.column(&particles, "x"). A name that is not a field of T is an error at the literal.

Gotchas#

The slice borrows the whole list. The compiler rejects a change to the list, and an exclusive borrow of another column, while the slice is live.

Examples#

Add the values of a column that the caller names#

silk
import silk.collections.column_list { ColumnList }
import silk.core.effect { Effect }
import silk.core.ownership { Copy }
import silk.mem.allocator { Allocator, OutOfMemoryError }

struct Size {
  pub width: u32,
  pub height: u32,
}

impl Copy for Size {}

// The caller names the field. The function works for every `u32` field of every row type.
fn total<T: Copy>(rows: &ColumnList<T>, static field: Intrinsic.Field<T, u32>) -> u32 {
  let values = ColumnList<T>.column(rows, field)
  let mut sum: u32 = 0
  let mut index: usize = 0
  while index < values.length {
    sum = sum + values[index]
    index = index + 1
  }
  return sum
}

effect fn heights() -> u32
  ! OutOfMemoryError
  ? &mut Allocator {
  let mut sizes = ColumnList<Size>.make()
  run sizes.append(Size { width: 4, height: 10 })
  run sizes.append(Size { width: 6, height: 20 })
  return total<Size>(&sizes, "height")
}

effect fn recover(error: OutOfMemoryError) -> u32 {
  return 0
}

pub fn main() -> i32 {
  let mut allocator = Allocator.systemAllocatorProvider()
  let sum = run heights()
    |> Effect.provideMut<Allocator>(&mut allocator)
    |> Effect.catchAll(recover)
  if sum != 30 {
    return 1
  }
  return 0
}

Method rows#

silk
pub fn rows<'s>(self: &'s Self) -> Rows<'s, T>

Returns a shared handle for all rows of the list.

When to use#

Use the handle in a loop that reads fields, and pass it to a function that would take a &[T] of a slice of structs. rows[i].field on the handle does not load the address of the storage from the list each time.

Method rowsMut#

silk
pub fn rowsMut<'s>(self: &'s mut Self) -> RowsMut<'s, T>

Returns an exclusive handle for all rows of the list.

When to use#

Use the handle in a loop that writes fields, and pass it to a function that would take a &mut [T] of a slice of structs. The handle keeps the address of the storage by value. A loop through &mut ColumnList can load it from the list again after each store.

Gotchas#

The list cannot be used while the handle is live, and the handle cannot add or remove rows.

Method get#

silk
pub fn get(self: &Self, index: usize) -> T

Returns a copy of the row at index.

When to use#

Use get when code needs every field of one row. It reads each column once. To read one field, write list[index].field.

Gotchas#

It traps if index is not less than the length.

Method set#

silk
pub fn set(self: &mut Self, index: usize, row: T) -> ()

Replaces the row at index with row.

Gotchas#

It traps if index is not less than the length.

Method append#

silk
pub effect fn append(self: &mut Self, row: T) -> ()
    ! OutOfMemoryError
    ? &mut Allocator

Adds row at the end of the list.

Details#

If the list is full, it grows: the first growth allocates space for four rows, and each later growth doubles the capacity.

Errors#

  • OutOfMemoryError if the Allocator cannot supply the new storage. The list does not change.

Method appendId#

silk
pub effect fn appendId(self: &mut Self, row: T) -> Id<T>
    ! OutOfMemoryError
    ? &mut Allocator

Adds row at the end of the list and returns the id of the new row.

When to use#

Use it when other rows store a link to the new row as an Id<T>.

Errors#

  • OutOfMemoryError if the Allocator cannot supply the new storage. The list does not change.

Gotchas#

It traps if the list already has 4,294,967,295 rows, because an Id cannot name the next one.

Method appendWithinCapacity#

silk
pub fn appendWithinCapacity(self: &mut Self, row: T) -> bool

Adds row at the end of the list if the list is not full. Returns true if it added the row.

When to use#

Use it after ColumnList.reserve in code that must not allocate or fail.

Method appendSlice#

silk
pub effect fn appendSlice(self: &mut Self, source: Rows<'_, T>) -> ()
    ! OutOfMemoryError
    ? &mut Allocator

Adds a copy of each row of source at the end of the list, in order.

Details#

source is a handle for rows of another list. For rows a to b of that list, pass other.rows().range(a, b). It copies one column at a time.

Errors#

  • OutOfMemoryError if the row count overflows, or the Allocator cannot supply the new storage. The list does not change.

Method appendRepeated#

silk
pub effect fn appendRepeated(self: &mut Self, row: T, count: usize) -> ()
    ! OutOfMemoryError
    ? &mut Allocator

Adds count copies of row at the end of the list.

Errors#

  • OutOfMemoryError if the row count overflows, or the Allocator cannot supply the new storage. The list does not change.

Method insert#

silk
pub effect fn insert(self: &mut Self, index: usize, row: T) -> ()
    ! OutOfMemoryError
    ? &mut Allocator

Inserts row at index and moves the rows from index up by one.

Errors#

  • OutOfMemoryError if the Allocator cannot supply the new storage. The list does not change.

Gotchas#

It traps if index is more than the length.

Method insertSlice#

silk
pub effect fn insertSlice(self: &mut Self, index: usize, source: Rows<'_, T>) -> ()
    ! OutOfMemoryError
    ? &mut Allocator

Inserts a copy of each row of source at index, in order, and moves the rows from index up.

Errors#

  • OutOfMemoryError if the row count overflows, or the Allocator cannot supply the new storage. The list does not change.

Gotchas#

It traps if index is more than the length.

Method insertRepeated#

silk
pub effect fn insertRepeated(self: &mut Self, index: usize, row: T, count: usize) -> ()
    ! OutOfMemoryError
    ? &mut Allocator

Inserts count copies of row at index and moves the rows from index up.

Errors#

  • OutOfMemoryError if the row count overflows, or the Allocator cannot supply the new storage. The list does not change.

Gotchas#

It traps if index is more than the length.

Method pop#

silk
pub fn pop(self: &mut Self) -> Option<T>

Removes the last row and returns it, or none if the list is empty.

Method remove#

silk
pub fn remove(self: &mut Self, index: usize) -> T

Removes the row at index, moves the later rows down by one, and returns the removed row.

When to use#

Use remove when the order of the rows matters. ColumnList.swapRemove moves only one row, but it changes the order.

Gotchas#

It traps if index is not less than the length.

Method swapRemove#

silk
pub fn swapRemove(self: &mut Self, index: usize) -> T

Removes the row at index, puts the last row in its place, and returns the removed row.

Details#

It moves one row whatever the length is, but it changes the order of the rows.

Gotchas#

It traps if index is not less than the length.

Method removeRange#

silk
pub fn removeRange(self: &mut Self, start: usize, end: usize) -> ()

Removes the rows from start up to but not including end, and moves the later rows down.

Gotchas#

It traps if start is more than end, or end is more than the length.

Method moveRange#

silk
pub fn moveRange(self: &mut Self, from: usize, to: usize, count: usize) -> ()

Copies the count rows that start at from over the count rows that start at to.

Details#

The two runs of rows can overlap: each target row gets the value that its source row had before the call. The length does not change, and rows outside the target run keep their values. It moves one column at a time.

Gotchas#

It traps if either run of rows goes past the length.

Method splitOff#

silk
pub effect fn splitOff(self: &mut Self, at: usize) -> ColumnList<T>
    ! OutOfMemoryError
    ? &mut Allocator

Removes the rows from at to the end and returns them as a new list.

Details#

The new list has storage for exactly the rows it holds. This list keeps its capacity.

Errors#

  • OutOfMemoryError if the Allocator cannot supply the storage of the new list. This list does not change.

Gotchas#

It traps if at is more than the length.

Method sortBy#

silk
pub effect fn sortBy<K: Order>(
    self: &mut Self,
    static key: Intrinsic.Field<T, K>,
    scratch: &mut ColumnSort,
  ) -> ()
    ! OutOfMemoryError
    ? &mut Allocator

Sorts the rows by the field key, from the least value to the greatest.

Details#

key is a static argument. Write the field's name as a string literal, as in nodes.sortBy("depth", &mut scratch). The type of the field must implement Order. The sort is stable: rows with equal keys keep their order. It orders the row numbers by the key column, then moves one column at a time. scratch holds the row numbers. It keeps its storage, so a later sort of a list that is not longer does not allocate.

Errors#

  • OutOfMemoryError if the Allocator cannot supply the storage of scratch. The list does not change.

Gotchas#

It traps if the list has more than 4,294,967,295 rows. An Id<T> that named a row names another row after the sort.

Examples#

Sort rows by one field#

silk
import silk.collections.column_list { ColumnList, ColumnSort }
import silk.core.effect { Effect }
import silk.core.ownership { Copy }
import silk.mem.allocator { Allocator, OutOfMemoryError }

struct Task {
  pub priority: u32,
  pub id: u64,
}

impl Copy for Task {}

effect fn first() -> u64
  ! OutOfMemoryError
  ? &mut Allocator {
  let mut tasks = ColumnList<Task>.make()
  run tasks.append(Task { priority: 3, id: 10 })
  run tasks.append(Task { priority: 1, id: 11 })
  run tasks.append(Task { priority: 2, id: 12 })
  // Keep the scratch and pass it to later sorts.
  let mut scratch = ColumnSort.make()
  run tasks.sortBy("priority", &mut scratch)
  return tasks[0].id
}

effect fn recover(error: OutOfMemoryError) -> u64 {
  return 0
}

pub fn main() -> i32 {
  let mut allocator = Allocator.systemAllocatorProvider()
  let id = run first()
    |> Effect.provideMut<Allocator>(&mut allocator)
    |> Effect.catchAll(recover)
  if id != 11 {
    return 1
  }
  return 0
}

Method clear#

silk
pub fn clear(self: &mut Self) -> ()

Removes all rows and keeps the capacity.

Method clearAndFree#

silk
pub fn clearAndFree(self: &mut Self) -> ()

Removes all rows and releases the storage. The capacity becomes zero.

Method truncate#

silk
pub fn truncate(self: &mut Self, length: usize) -> ()

Removes the rows from length to the end and keeps the capacity. It does nothing if length is not less than the current length.

Method reserve#

silk
pub effect fn reserve(self: &mut Self, additional: usize) -> ()
    ! OutOfMemoryError
    ? &mut Allocator

Makes room for at least additional more rows.

Details#

It can take more room than it needs, so that a series of appends grows the list few times. Use ColumnList.reserveExact for an exact capacity.

Errors#

  • OutOfMemoryError if the row count overflows, or the Allocator cannot supply the storage. The list does not change.

Method reserveExact#

silk
pub effect fn reserveExact(self: &mut Self, additional: usize) -> ()
    ! OutOfMemoryError
    ? &mut Allocator

Makes room for exactly additional more rows if the list has less room than that.

When to use#

Use it when the final number of rows is known. ColumnList.reserve is the better choice before a series of appends of unknown length.

Errors#

  • OutOfMemoryError if the row count overflows, or the Allocator cannot supply the storage. The list does not change.

Method shrinkToFit#

silk
pub effect fn shrinkToFit(self: &mut Self) -> ()
    ! OutOfMemoryError
    ? &mut Allocator

Releases the capacity beyond the length.

Errors#

  • OutOfMemoryError if the Allocator cannot supply the smaller storage. The list does not change.

Implementation Rows<'a, T>#

silk
impl<'a, T: Copy> Rows<'a, T>

Method length#

silk
pub fn length(self: Self) -> usize

Returns the number of rows of the handle.

Method range#

silk
pub fn range(self: Self, start: usize, end: usize) -> Rows<'a, T>

Returns a handle for the rows from start up to but not including end.

Details#

start and end count from the first row of this handle. In the new handle a usize index counts from start, and an Id<T> index stays the row's number in the list.

Gotchas#

It traps if start is more than end, or end is more than the length.

Method get#

silk
pub fn get(self: Self, index: usize) -> T

Returns a copy of the row at index, which counts from the first row of the handle.

Gotchas#

It traps if index is not less than the length.

Implementation RowsMut<'a, T>#

silk
impl<'a, T: Copy> RowsMut<'a, T>

Method length#

silk
pub fn length(self: &Self) -> usize

Returns the number of rows of the handle.

Method rows#

silk
pub fn rows<'s>(self: &'s Self) -> Rows<'s, T>

Returns a shared handle for the same rows, for as long as this handle is borrowed.

Method range#

silk
pub fn range<'s>(self: &'s mut Self, start: usize, end: usize) -> RowsMut<'s, T>

Returns an exclusive handle for the rows from start up to but not including end, for as long as this handle is borrowed.

Details#

start and end count from the first row of this handle. In the new handle a usize index counts from start, and an Id<T> index stays the row's number in the list.

Gotchas#

It traps if start is more than end, or end is more than the length.

Method splitAt#

silk
pub fn splitAt(self: Self, at: usize) -> RowsPair<'a, T>

Cuts the handle into a handle for the rows before at and a handle for the rows from at.

When to use#

Use it to write two runs of rows at the same time, such as two halves that two functions fill.

Gotchas#

It traps if at is more than the length.

Examples#

Write two parts of the rows through two handles#

silk
import silk.collections.column_list { ColumnList }
import silk.core.effect { Effect }
import silk.core.ownership { Copy }
import silk.mem.allocator { Allocator, OutOfMemoryError }

struct Cell {
  pub value: u32,
}

impl Copy for Cell {}

effect fn sum() -> u32
  ! OutOfMemoryError
  ? &mut Allocator {
  let mut cells = ColumnList<Cell>.make()
  run cells.appendRepeated(Cell { value: 0 }, 4)
  let pair = cells.rowsMut().splitAt(1)
  let mut head = move pair.left
  let mut tail = move pair.right
  // Both handles are live. Each index counts from the first row of its handle.
  head[0].value = 1
  tail[0].value = 20
  tail[2].value = 300
  return cells[0].value + cells[1].value + cells[3].value
}

effect fn recover(error: OutOfMemoryError) -> u32 {
  return 0
}

pub fn main() -> i32 {
  let mut allocator = Allocator.systemAllocatorProvider()
  let total = run sum()
    |> Effect.provideMut<Allocator>(&mut allocator)
    |> Effect.catchAll(recover)
  if total != 321 {
    return 1
  }
  return 0
}

Method get#

silk
pub fn get(self: &Self, index: usize) -> T

Returns a copy of the row at index, which counts from the first row of the handle.

Gotchas#

It traps if index is not less than the length.

Method set#

silk
pub fn set(self: &mut Self, index: usize, row: T) -> ()

Replaces the row at index, which counts from the first row of the handle, with row.

Gotchas#

It traps if index is not less than the length.

Implementation Intrinsic.Rows<usize, T> for ColumnList<T>#

silk
impl<T: Copy> Intrinsic.Rows<usize, T> for ColumnList<T>

Operation borrow#

silk
fn borrow<'s, V>(self: &'s Self, index: usize, static field: Intrinsic.Field<T, V>) -> &'s V

Operation span#

silk
fn span<'s, V>(self: &'s Self, static field: Intrinsic.Field<T, V>) -> &'s [V]

Implementation Intrinsic.RowsMut<usize, T> for ColumnList<T>#

silk
impl<T: Copy> Intrinsic.RowsMut<usize, T> for ColumnList<T>

Operation borrowMut#

silk
fn borrowMut<'s, V>(
    self: &'s mut Self,
    index: usize,
    static field: Intrinsic.Field<T, V>,
  ) -> &'s mut V

Operation spanMut#

silk
fn spanMut<'s, V>(self: &'s mut Self, static field: Intrinsic.Field<T, V>) -> &'s mut [V]

Implementation Intrinsic.Rows<Id<T>, T> for ColumnList<T>#

silk
impl<T: Copy> Intrinsic.Rows<Id<T>, T> for ColumnList<T>

Operation borrow#

silk
fn borrow<'s, V>(self: &'s Self, index: Id<T>, static field: Intrinsic.Field<T, V>) -> &'s V

Operation span#

silk
fn span<'s, V>(self: &'s Self, static field: Intrinsic.Field<T, V>) -> &'s [V]

Implementation Intrinsic.RowsMut<Id<T>, T> for ColumnList<T>#

silk
impl<T: Copy> Intrinsic.RowsMut<Id<T>, T> for ColumnList<T>

Operation borrowMut#

silk
fn borrowMut<'s, V>(
    self: &'s mut Self,
    index: Id<T>,
    static field: Intrinsic.Field<T, V>,
  ) -> &'s mut V

Operation spanMut#

silk
fn spanMut<'s, V>(self: &'s mut Self, static field: Intrinsic.Field<T, V>) -> &'s mut [V]

Implementation Intrinsic.Rows<usize, T> for Rows<'a, T>#

silk
impl<'a, T: Copy> Intrinsic.Rows<usize, T> for Rows<'a, T>

Operation borrow#

silk
fn borrow<'s, V>(self: &'s Self, index: usize, static field: Intrinsic.Field<T, V>) -> &'s V

Operation span#

silk
fn span<'s, V>(self: &'s Self, static field: Intrinsic.Field<T, V>) -> &'s [V]

Implementation Intrinsic.Rows<Id<T>, T> for Rows<'a, T>#

silk
impl<'a, T: Copy> Intrinsic.Rows<Id<T>, T> for Rows<'a, T>

Operation borrow#

silk
fn borrow<'s, V>(self: &'s Self, index: Id<T>, static field: Intrinsic.Field<T, V>) -> &'s V

Operation span#

silk
fn span<'s, V>(self: &'s Self, static field: Intrinsic.Field<T, V>) -> &'s [V]

Implementation Intrinsic.Rows<usize, T> for RowsMut<'a, T>#

silk
impl<'a, T: Copy> Intrinsic.Rows<usize, T> for RowsMut<'a, T>

Operation borrow#

silk
fn borrow<'s, V>(self: &'s Self, index: usize, static field: Intrinsic.Field<T, V>) -> &'s V

Operation span#

silk
fn span<'s, V>(self: &'s Self, static field: Intrinsic.Field<T, V>) -> &'s [V]

Implementation Intrinsic.RowsMut<usize, T> for RowsMut<'a, T>#

silk
impl<'a, T: Copy> Intrinsic.RowsMut<usize, T> for RowsMut<'a, T>

Operation borrowMut#

silk
fn borrowMut<'s, V>(
    self: &'s mut Self,
    index: usize,
    static field: Intrinsic.Field<T, V>,
  ) -> &'s mut V

Operation spanMut#

silk
fn spanMut<'s, V>(self: &'s mut Self, static field: Intrinsic.Field<T, V>) -> &'s mut [V]

Implementation Intrinsic.Rows<Id<T>, T> for RowsMut<'a, T>#

silk
impl<'a, T: Copy> Intrinsic.Rows<Id<T>, T> for RowsMut<'a, T>

Operation borrow#

silk
fn borrow<'s, V>(self: &'s Self, index: Id<T>, static field: Intrinsic.Field<T, V>) -> &'s V

Operation span#

silk
fn span<'s, V>(self: &'s Self, static field: Intrinsic.Field<T, V>) -> &'s [V]

Implementation Intrinsic.RowsMut<Id<T>, T> for RowsMut<'a, T>#

silk
impl<'a, T: Copy> Intrinsic.RowsMut<Id<T>, T> for RowsMut<'a, T>

Operation borrowMut#

silk
fn borrowMut<'s, V>(
    self: &'s mut Self,
    index: Id<T>,
    static field: Intrinsic.Field<T, V>,
  ) -> &'s mut V

Operation spanMut#

silk
fn spanMut<'s, V>(self: &'s mut Self, static field: Intrinsic.Field<T, V>) -> &'s mut [V]

Category: Collections.

Profiles: aarch64-apple-darwin, aarch64-unknown-linux-gnu, aarch64-unknown-linux-gnu-no-libc, x86_64-unknown-linux-gnu, x86_64-unknown-linux-gnu-no-libc, wasm32-unknown-unknown, wasm32-wasip1, wasm32-wasip2, x86_64-pc-windows-msvc, wasm64-unknown-unknown.

View the source of this page