MCPcopy Create free account
hub / github.com/RetypeOS/parcode / first

Method first

src/rt.rs:191–197  ·  view source on GitHub ↗

Returns the first item as a lazy mirror, or None if empty.

(&self)

Source from the content-addressed store, hash-verified

189
190 /// Returns the first item as a lazy mirror, or None if empty.
191 pub fn first(&self) -> Result<Option<T::Lazy>> {
192 if self.is_empty() {
193 Ok(None)
194 } else {
195 Ok(Some(self.get_lazy(0)?))
196 }
197 }
198
199 /// Returns the last item as a lazy mirror, or None if empty.
200 pub fn last(&self) -> Result<Option<T::Lazy>> {

Callers 5

visitMethod · 0.80
test_nested_structuresFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80

Calls 2

get_lazyMethod · 0.80
is_emptyMethod · 0.45

Tested by 3

test_nested_structuresFunction · 0.64
mainFunction · 0.64