repeat
fn repeat(Vec<byte> src, int n) -> Vec<byte> Import
Source: use bytes::{repeat}; src/bytes.hy Returns src repeated n times (empty when n <= 0).
Parameters#
| Name | Type |
|---|---|
src | Vec<byte> |
n | int |
Returns#
Vec<byte>
Contracts#
Checked according to --contracts (see Contracts).
ensures n > 0 || result.len() == 0
ensures n <= 0 || result.len() == src.len() * n
See also#
region_eq: True whena[ao..ao+n)equalsb[bo..bo+n)(caller guarantees bounds).to_hex: Encodesbufas lowercase hexadecimal, two digits per byte.from_hex: Decodes hexadecimal text (either case) into bytes.slice: Returns a copy ofsrc[start..end](end exclusive), with both offsets clamped to the buffer.concat: Returns a new buffer holdingafollowed byb.eq: Returnstruewhenaandbhave the same length and the same bytes.find_from: Returns the offset of the firstneedleinhayat or afterstart, or-1.find: Returns the offset of the firstneedleinhay, or-1.