Get the separator as a byte slice.
(&self)
| 83 | |
| 84 | /// Get the separator as a byte slice. |
| 85 | pub fn as_bytes(&self) -> &[u8] { |
| 86 | match self { |
| 87 | Separator::Newline => b"\n", |
| 88 | Separator::CrLf => b"\r\n", |
| 89 | Separator::Byte(b) => std::slice::from_ref(b), |
| 90 | Separator::Custom(v) => v.as_slice(), |
| 91 | } |
| 92 | } |
| 93 | |
| 94 | /// Get the length of the separator in bytes. |
| 95 | pub fn len(&self) -> usize { |