Function writeSlice [src]

Write bytes into the ring buffer. Returns error.Full if the ring buffer does not have enough space, without writing any data. Uses memcpy and so bytes must not overlap ring buffer data.

Prototype

pub fn writeSlice(self: *RingBuffer, bytes: []const u8) Error!void

Parameters

self: *RingBufferbytes: []const u8

Possible Errors

Full
ReadLengthInvalid

Source

pub fn writeSlice(self: *RingBuffer, bytes: []const u8) Error!void { if (self.len() + bytes.len > self.data.len) return error.Full; self.writeSliceAssumeCapacity(bytes); }