Get argument at index as UTF-8 string. Returns None if out of bounds or invalid UTF-8.
(&self, index: usize)
| 46 | |
| 47 | /// Get argument at index as UTF-8 string. Returns None if out of bounds or invalid UTF-8. |
| 48 | pub fn arg_str(&self, index: usize) -> Option<&str> { |
| 49 | self.args |
| 50 | .get(index) |
| 51 | .and_then(|v| std::str::from_utf8(v).ok()) |
| 52 | } |
| 53 | |
| 54 | /// Get argument at index parsed as i64. |
| 55 | pub fn arg_i64(&self, index: usize) -> Option<i64> { |
no test coverage detected