getStride.lua 780 B

12345678910111213141516171819202122232425262728293031
  1. return {
  2. tag = 'buffer-metadata',
  3. summary = 'Get the stride of the Buffer, in bytes.',
  4. description = [[
  5. Returns the distance between each item in the Buffer, in bytes, or `nil` if the Buffer was not
  6. created with a format.
  7. ]],
  8. arguments = {},
  9. returns = {
  10. stride = {
  11. type = 'number',
  12. description = 'The stride of the Buffer, in bytes.'
  13. }
  14. },
  15. variants = {
  16. {
  17. arguments = {},
  18. returns = { 'stride' }
  19. }
  20. },
  21. notes = [[
  22. When a Buffer is created, the stride can be set explicitly, otherwise it will be automatically
  23. computed based on the fields in the Buffer.
  24. Strides can not be zero, and can not be smaller than the size of a single item.
  25. ]],
  26. related = {
  27. 'Buffer:getSize',
  28. 'Buffer:getLength'
  29. }
  30. }