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

Method from_tokens

src/pointer.rs:935–942  ·  view source on GitHub ↗

Creates a new `PointerBuf` from a slice of non-encoded strings.

(tokens: impl IntoIterator<Item: Into<Token<'t>>>)

Source from the content-addressed store, hash-verified

933
934 /// Creates a new `PointerBuf` from a slice of non-encoded strings.
935 pub fn from_tokens<'t>(tokens: impl IntoIterator<Item: Into<Token<'t>>>) -> Self {
936 let mut inner = String::new();
937 for t in tokens.into_iter().map(Into::into) {
938 inner.push('/');
939 inner.push_str(t.encoded());
940 }
941 PointerBuf(inner)
942 }
943
944 /// Coerces to a Pointer slice.
945 pub fn as_ptr(&self) -> &Pointer {

Callers

nothing calls this directly

Calls 4

newFunction · 0.85
PointerBufClass · 0.85
into_iterMethod · 0.80
encodedMethod · 0.80

Tested by

no test coverage detected