MCPcopy Create free account
hub / github.com/chanced/jsonptr / len

Method len

src/pointer.rs:570–572  ·  view source on GitHub ↗

Returns the length of `self` in encoded format. This length expresses the byte count of the underlying string that represents the RFC 6091 Pointer. See also [`std::str::len`]. ## Examples ``` let mut ptr = jsonptr::PointerBuf::parse("/foo/bar").unwrap(); assert_eq!(ptr.len(), 8); ptr.push_back("~"); assert_eq!(ptr.len(), 11); ```

(&self)

Source from the content-addressed store, hash-verified

568 ///
569 /// ```
570 pub fn len(&self) -> usize {
571 self.0.len()
572 }
573
574 /// Returns `true` if the `Pointer` is empty (i.e. root).
575 ///

Callers 15

labelsMethod · 0.80
assign_valueFunction · 0.80
assign_arrayFunction · 0.80
labelsMethod · 0.80
resolveMethod · 0.80
resolve_mutMethod · 0.80
starts_withMethod · 0.80
intersectionMethod · 0.80
replaceMethod · 0.80
invalid_encoding_lenMethod · 0.80
validate_bytesFunction · 0.80
deleteMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected