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

Method concat

src/pointer.rs:550–554  ·  view source on GitHub ↗

Creates an owned [`PointerBuf`] like `self` but with `other` appended to the end. See [`PointerBuf::append`] for more details. Note**: this method allocates. If you find yourself calling it more than given pointer, consider using [`PointerBuf::append`] instead. ## Examples ``` let ptr = jsonptr::Pointer::from_static("/foo"); let other = jsonptr::Pointer::from_static("/bar/baz"); assert_eq!(ptr

(&self, other: &Pointer)

Source from the content-addressed store, hash-verified

548 /// assert_eq!(ptr.concat(other), "/foo/bar/baz");
549 /// ```
550 pub fn concat(&self, other: &Pointer) -> PointerBuf {
551 let mut buf = self.to_buf();
552 buf.append(other);
553 buf
554 }
555
556 // Returns the length of `self` in encoded format.
557 ///

Callers

nothing calls this directly

Calls 2

to_bufMethod · 0.80
appendMethod · 0.80

Tested by

no test coverage detected