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

Method back

src/pointer.rs:144–149  ·  view source on GitHub ↗

Returns the last `Token` in the `Pointer`.

(&self)

Source from the content-addressed store, hash-verified

142
143 /// Returns the last `Token` in the `Pointer`.
144 pub fn back(&self) -> Option<Token> {
145 self.0
146 .rsplit_once('/')
147 // SAFETY: pointer is encoded
148 .map(|(_, back)| unsafe { Token::from_encoded_unchecked(back) })
149 }
150
151 /// Returns the last token in the `Pointer`.
152 ///

Callers 1

lastMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected