Last active
January 9, 2017 21:58
-
-
Save cablehead/daa1bc1e08625434347e0cc66012a469 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
r:stream():line() --> `err`, `Slice` | |
-- a slice is a restricted `off`, `len` window into a buffer. offers all methods buffer does. | |
-- is bump / growable, if `len` extends to the end of the buffer's current contents. | |
-- this allows you to make use of the line without incurring and additional copy | |
-- you call `:trim` when done with the line. | |
-- buffer (and so slice) will get two new methods | |
slice:string() -- just a rename of take, effectively ffi.string(slice:value()) and :trims | |
slice:data() -- returns copy as LeveeData, and :trims |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment