Function readFirst [src]

Reads first length bytes written to the ring buffer into dest; Returns Error.ReadLengthInvalid if length greater than ring or dest length Uses memcpy and so dest must not overlap ring buffer data.

Prototype

pub fn readFirst(self: *RingBuffer, dest: []u8, length: usize) Error!void

Parameters

self: *RingBufferdest: []u8length: usize

Possible Errors

Full
ReadLengthInvalid

Source

pub fn readFirst(self: *RingBuffer, dest: []u8, length: usize) Error!void { if (length > self.len() or length > dest.len) return error.ReadLengthInvalid; self.readFirstAssumeLength(dest, length); }