From 64106c4d3d4ddba8c7bc2af75376e6d3d3d75601 Mon Sep 17 00:00:00 2001 From: Date: Mon, 29 Jun 2015 20:16:15 +0000 Subject: Update documentation --- memchr/fn.memchr.html | 119 ++++++++++++++++++++++++++++++++++++++++++++++++ memchr/index.html | 113 +++++++++++++++++++++++++++++++++++++++++++++ memchr/sidebar-items.js | 1 + 3 files changed, 233 insertions(+) create mode 100644 memchr/fn.memchr.html create mode 100644 memchr/index.html create mode 100644 memchr/sidebar-items.js (limited to 'memchr') diff --git a/memchr/fn.memchr.html b/memchr/fn.memchr.html new file mode 100644 index 0000000..814d477 --- /dev/null +++ b/memchr/fn.memchr.html @@ -0,0 +1,119 @@ + + + + + + + + + + memchr::memchr - Rust + + + + + + + + + + + + + + + +
+

Function memchr::memchr + + [] + + [src]

+
pub fn memchr(needle: u8, haystack: &[u8]) -> Option<usize>

A safe interface to memchr.

+ +

Returns the index corresponding to the first occurrence of needle in +haystack, or None if one is not found.

+ +

memchr reduces to super-optimized machine code at around an order of +magnitude faster than haystack.iter().position(|&b| b == needle). +(See benchmarks.)

+ +

Example

+

This shows how to find the first position of a byte in a byte string.

+
+use memchr::memchr;
+
+let haystack = b"the quick brown fox";
+assert_eq!(memchr(b'k', haystack), Some(8));
+
+
+ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/memchr/index.html b/memchr/index.html new file mode 100644 index 0000000..438fa0f --- /dev/null +++ b/memchr/index.html @@ -0,0 +1,113 @@ + + + + + + + + + + memchr - Rust + + + + + + + + + + + + + + + +
+

Crate memchr + + [] + + [src]

+

This crate defines a single function, memchr, which exposes a safe interface +to the corresponding function in libc.

+

Functions

+ + + + + +
memchr +

A safe interface to memchr.

+ +
+ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/memchr/sidebar-items.js b/memchr/sidebar-items.js new file mode 100644 index 0000000..a685a6a --- /dev/null +++ b/memchr/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"fn":[["memchr","A safe interface to `memchr`."]]}); \ No newline at end of file -- cgit v1.2.3