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

Method is_empty

src/pointer.rs:584–586  ·  view source on GitHub ↗

Returns `true` if the `Pointer` is empty (i.e. root). ## Examples ``` let mut ptr = jsonptr::PointerBuf::new(); assert!(ptr.is_empty()); ptr.push_back("foo"); assert!(!ptr.is_empty()); ```

(&self)

Source from the content-addressed store, hash-verified

582 /// assert!(!ptr.is_empty());
583 /// ```
584 pub fn is_empty(&self) -> bool {
585 self.0.is_empty()
586 }
587
588 /// Converts a `Box<Pointer>` into a `PointerBuf` without copying or allocating.
589 pub fn into_buf(self: Box<Pointer>) -> PointerBuf {

Callers 2

is_rootMethod · 0.80
validateFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected