mirror of
https://github.com/fafhrd91/actix-net
synced 2024-11-23 22:51:07 +01:00
1302 lines
434 KiB
HTML
1302 lines
434 KiB
HTML
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="An immutable UTF-8 encoded string with `Bytes` as a storage."><title>ByteString in bytestring - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2,SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../static.files/rustdoc-b778ab399e080a4b.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="bytestring" data-themes="" data-resource-suffix="" data-rustdoc-version="1.83.0-nightly (7608018cb 2024-09-29)" data-channel="nightly" data-search-js="search-e056c65ede92db13.js" data-settings-js="settings-805db61a62df4bd2.js" ><script src="../static.files/storage-1d39b6787ed640ff.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-54bc299d2a5e4e43.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-0111fcff984fae8f.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../bytestring/index.html">bytestring</a><span class="version">1.3.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Byte<wbr>String</a></h2><h3><a href="#implementations">Methods</a></h3><ul class="block method"><li><a href="#method.as_bytes" title="as_bytes">as_bytes</a></li><li><a href="#method.from_bytes_unchecked" title="from_bytes_unchecked">from_bytes_unchecked</a></li><li><a href="#method.from_static" title="from_static">from_static</a></li><li><a href="#method.into_bytes" title="into_bytes">into_bytes</a></li><li><a href="#method.new" title="new">new</a></li><li><a href="#method.slice_ref" title="slice_ref">slice_ref</a></li></ul><h3><a href="#deref-methods-str">Methods from Deref<<wbr>Target=str></a></h3><ul class="block deref-methods"><li><a href="#method.as_ascii" title="as_ascii">as_ascii</a></li><li><a href="#method.as_bytes-1" title="as_bytes">as_bytes</a></li><li><a href="#method.as_ptr" title="as_ptr">as_ptr</a></li><li><a href="#method.as_str" title="as_str">as_str</a></li><li><a href="#method.bytes" title="bytes">bytes</a></li><li><a href="#method.ceil_char_boundary" title="ceil_char_boundary">ceil_char_boundary</a></li><li><a href="#method.char_indices" title="char_indices">char_indices</a></li><li><a href="#method.chars" title="chars">chars</a></li><li><a href="#method.contains" title="contains">contains</a></li><li><a href="#method.encode_utf16" title="encode_utf16">encode_utf16</a></li><li><a href="#method.ends_with" title="ends_with">ends_with</a></li><li><a href="#method.eq_ignore_ascii_case" title="eq_ignore_ascii_case">eq_ignore_ascii_case</a></li><li><a href="#method.escape_debug" title="escape_debug">escape_debug</a></li><li><a href="#method.escape_default" title="escape_default">escape_default</a></li><li><a href="#method.escape_unicode" title="escape_unicode">escape_unicode</a></li><li><a href="#method.find" title="find">find</a></li><li><a href="#method.floor_char_boundary" title="floor_char_boundary">floor_char_boundary</a></li><li><a href="#method.get" title="get">get</a></li><li><a href="#method.get_unchecked" title="get_unchecked">get_unchecked</a></li><li><a href="#method.is_ascii" title="is_ascii">is_ascii</a></li><li><a href="#method.is_char_boundary" title="is_char_boundary">is_char_boundary</a></li><li><a href="#method.is_empty" title="is_empty">is_empty</a></li><li><a href="#method.len" title="len">len</a></li><li><a href="#method.lines" title="lines">lines</a></li><li><a href="#method.lines_any" title="lines_any">lines_any</a></li><li><a href="#method.match_indices" title="match_indices">match_indices</a></li><li><a href="#method.matches" title="matches">matches</a></li><li><a href="#method.parse" title="parse">parse</a></li><li><a href="#method.repeat" title="repeat">repeat</a></li><li><a href="#method.replace" title="replace">replace</a></li><li><a href="#method.replacen" title="replacen">replacen</a></li><li><a href="#method.rfind" title="rfind">rfind</a></li><li><a href="#method.rmatch_indices" title="rmatch_indices">rmatch_indices</a></li><li><a href="#method.rmatches" title="rmatches">rmatches</a></li><li><a href="#method.rsplit" title="rsplit">rsplit</a></li><li><a href="#method.rsplit_once" title="rsplit_once">rsplit_once</a></li><li><a href="#method.rsplit_terminator" title="rsplit_terminator">rsplit_terminator</a></li><li><a href="#method.rsplitn" title="rsplitn">rsplitn</a></li><li><a href="#method.slice_unchecked" title="slice_unchecked">slice_unchecked</a></li><li><a href="#method.split" title="split">split</a></li><li><a href="#method.split_ascii_whitespace" title="split_ascii_whitespace">split_ascii_whitespace</a></li><li><a href="#method.split_at" title="split_at">split_at</a></li><li><a href="#method.split_at_checked" title="split_at_checked">split_at_checked</a></li><li><a href="#method.split_inclusive" title="split_inclusive">split_inclusive</a></li><li><a href="#method.split_once" title="split_once">split_once</a></li><li><a href="#method.split_terminator" title="split_terminator">split_terminator</a></li><li><a href="#method.split_whitespace" title="split_whitespace">split_whitespace</a></li><li><a href="#method.splitn" title="splitn">splitn</a></li><li><a href="#method.starts_with" title="starts_with">starts_with</a></li><li><a href="#method.strip_prefix" title="strip_prefix">strip_prefix</a></li><li><a href="#method.strip_suffix" title="strip_suffix">strip_suffix</a></li><li><a href="#method.substr_range" title="substr_range">substr_range</a></li><li><a href="#method.to_ascii_lowercase" title="to_ascii_lowercase">to_ascii_lowercase</a></li><li><a href="#method.to_ascii_uppercase" title="to_ascii_uppercase">to_ascii_uppercase</a></li><li><a href="#method.to_lowercase" title="to_lowercase">to_lowercase</a></li><li><a href="#method.to_uppercase" title="to_uppercase">to_uppercase</a></li><li><a href="#method.trim" title="trim">trim</a></li><li><a href="#method.trim_ascii" title="trim_ascii">trim_ascii</a></li><li><a href="#method.trim_ascii_end" title="trim_ascii_end">trim_ascii_end</a></li><li><a href="#method.trim_ascii_start" title="trim_ascii_start">trim_ascii_start</a></li><li><a href="#method.trim_end" title="trim_end">trim_end</a></li><li><a href="#method.trim_end_matches" title="trim_end_matches">trim_end_matches</a></li><li><a href="#method.trim_left" title="trim_left">trim_left</a></li><li><a href="#method.trim_left_matches" title="trim_left_matches">trim_left_matches</a></li><li><a href="#method.trim_matches" title="trim_matches">trim_matches</a></li><li><a href="#method.trim_right" title="trim_right">trim_right</a></li><li><a href="#method.trim_right_matches" title="trim_right_matches">trim_right_matches</a></li><li><a href="#method.trim_start" title="trim_start">trim_start</a></li><li><a href="#method.trim_start_matches" title="trim_start_matches">trim_start_matches</a></li></ul><h3><a href="#trait-implementations">Trait Implementations</a></h3><ul class="block trait-implementation"><li><a href="#impl-AsRef%3CByteString%3E-for-ByteString" title="AsRef<ByteString>">AsRef<ByteString></a></li><li><a href="#impl-AsRef%3C%5Bu8%5D%3E-for-ByteString" title="AsRef<[u8]>">AsRef<[u8]></a></li><li><a href="#impl-AsRef%3Cstr%3E-for-ByteString" title="AsRef<str>">AsRef<str></a></li><li><a href="#impl-Borrow%3Cstr%3E-for-ByteString" title="Borrow<str>">Borrow<str></a></li><li><a href="#impl-Clone-for-ByteString" title="Clone">Clone</a></li><li><a href="#impl-Debug-for-ByteString" title="Debug">Debug</a></li><li><a href="#impl-Default-for-ByteString" title="Default">Default</a></li><li><a href="#impl-Deref-for-ByteString" title="Deref">Deref</a></li><li><a href="#impl-Deserialize%3C'de%3E-for-ByteString" title="Deserialize<'de>">Deserialize<'de></a></li><li><a href="#impl-Display-for-ByteString" title="Display">Display</a></li><li><a href="#impl-Eq-for-ByteString" title="Eq">Eq</a></li><li><a href="#impl-From%3C%26str%3E-for-ByteString" title="From<&str>">From<&str></a></li><li><a href="#impl-From%3CBox%3Cstr%3E%3E-for-ByteString" title="From<Box<str>>">From<Box<str>></a></li><li><a href="#impl-From%3CByteString%3E-for-String" title="From<ByteString>">From<ByteString></a></li><li><a href="#impl-From%3CString%3E-for-ByteString" title="From<String>">From<String></a></li><li><a href="#impl-Hash-for-ByteString" title="Hash">Hash</a></li><li><a href="#impl-Ord-for-ByteString" title="Ord">Ord</a></li><li><a href="#impl-PartialEq%3CT%3E-for-ByteString" title="PartialEq<T>">PartialEq<T></a></li><li><a href="#impl-PartialEq%3Cstr%3E-for-ByteString" title="PartialEq<str>">PartialEq<str></a></li><li><a href="#impl-PartialOrd-for-ByteString" title="PartialOrd">PartialOrd</a></li><li><a href="#impl-Serialize-for-ByteString" title="Serialize">Serialize</a></li><li><a href="#impl-TryFrom%3C%26%5Bu8;+0%5D%3E-for-ByteString" title="TryFrom<&[u8; 0]>">TryFrom<&[u8; 0]></a></li><li><a href="#impl-TryFrom%3C%26%5Bu8;+10%5D%3E-for-ByteString" title="TryFrom<&[u8; 10]>">TryFrom<&[u8; 10]></a></li><li><a href="#impl-TryFrom%3C%26%5Bu8;+11%5D%3E-for-ByteString" title="TryFrom<&[u8; 11]>">TryFrom<&[u8; 11]></a></li><li><a href="#impl-TryFrom%3C%26%5Bu8;+12%5D%3E-for-ByteString" title="TryFrom<&[u8; 12]>">TryFrom<&[u8; 12]></a></li><li><a href="#impl-TryFrom%3C%26%5Bu8;+13%5D%3E-for-ByteString" title="TryFrom<&[u8; 13]>">TryFrom<&[u8; 13]></a></li><li><a href="#impl-TryFrom%3C%26%5Bu8;+14%5D%3E-for-ByteString" title="TryFrom<&[u8; 14]>">TryFrom<&[u8; 14]></a></li><li><a href="#impl-TryFrom%3C%26%5Bu8;+15%5D%3E-for-ByteString" title="TryFrom<&[u8; 15]>">TryFrom<&[u8; 15]></a></li><li><a href="#impl-TryFrom%3C%26%5Bu8;+16%5D%3E-for-ByteString" title="TryFrom<&[u8; 16]>">TryFrom<&[u8; 16]></a></li><li><a href="#impl-TryFrom%3C%26%5Bu8;+17%5D%3E-for-ByteString" title="TryFrom<&[u8; 17]>">TryFrom<&[u8; 17]></a></li><li><a href="#impl-TryFrom%3C%26%5Bu8;+18%5D%3E-for-ByteString" title="TryFrom<&[u8; 18]>">TryFrom<&[u8; 18]></a></li><li><a href="#impl-TryFrom%3C%26%5Bu8;+19%5D%3E-for-ByteString" title="TryFrom<&[u8; 19]>">TryFrom<&[u8; 19]></a></li><li><a href="#impl-TryFrom%3C%26%5Bu8;+1%5D%3E-for-ByteString" title="TryFrom<&[u8; 1]>">TryFrom<&[u8; 1]></a></li><li><a href="#impl-TryFrom%3C%26%5Bu8;+20%5D%3E-for-ByteString" title="TryFrom<&[u8; 20]>">TryFrom<&[u8; 20]></a></li><li><a href="#impl-TryFrom%3C%26%5Bu8;+21%5D%3E-for-ByteString" title="TryFrom<&[u8; 21]>">TryFrom<&[u8; 21]></a></li><li><a href="#impl-TryFrom%3C%26%5Bu8;+22%5D%3E-for-ByteString" title="TryFrom<&[u8; 22]>">TryFrom<&[u8; 22]></a></li><li><a href="#impl-TryFrom%3C%26%5Bu8;+23%5D%3E-for-ByteString" title="TryFrom<&[u8; 23]>">TryFrom<&[u8; 23]></a></li><li><a href="#impl-TryFrom%3C%26%5Bu8;+24%5D%3E-for-ByteString" title="TryFrom<&[u8; 24]>">TryFrom<&[u8; 24]></a></li><li><a href="#impl-TryFrom%3C%26%5Bu8;+25%5D%3E-for-ByteString" title="TryFrom<&[u8; 25]>">TryFrom<&[u8; 25]></a></li><li><a href="#impl-TryFrom%3C%26%5Bu8;+26%5D%3E-for-ByteString" title="TryFrom<&[u8; 26]>">TryFrom<&[u8; 26]></a></li><li><a href="#impl-TryFrom%3C%26%5Bu8;+27%5D%3E-for-ByteString" title="TryFrom<&[u8; 27]>">TryFrom<&[u8; 27]></a></li><li><a href="#impl-TryFrom%3C%26%5Bu8;+28%5D%3E-for-ByteString" title="TryFrom<&[u8; 28]>">TryFrom<&[u8; 28]></a></li><li><a href="#impl-TryFrom%3C%26%5Bu8;+29%5D%3E-for-ByteString" title="TryFrom<&[u8; 29]>">TryFrom<&[u8; 29]></a></li><li><a href="#impl-TryFrom%3C%26%5Bu8;+2%5D%3E-for-ByteString" title="TryFrom<&[u8; 2]>">TryFrom<&[u8; 2]></a></li><li><a href="#impl-TryFrom%3C%26%5Bu8;+30%5D%3E-for-ByteString" title="TryFrom<&[u8; 30]>">TryFrom<&[u8; 30]></a></li><li><a href="#impl-TryFrom%3C%26%5Bu8;+31%5D%3E-for-ByteString" title="TryFrom<&[u8; 31]>">TryFrom<&[u8; 31]></a></li><li><a href="#impl-TryFrom%3C%26%5Bu8;+32%5D%3E-for-ByteString" title="TryFrom<&[u8; 32]>">TryFrom<&[u8; 32]></a></li><li><a href="#impl-TryFrom%3C%26%5Bu8;+3%5D%3E-for-ByteString" title="TryFrom<&[u8; 3]>">TryFrom<&[u8; 3]></a></li><li><a href="#impl-TryFrom%3C%26%5Bu8;+4%5D%3E-for-ByteString" title="TryFrom<&[u8; 4]>">TryFrom<&[u8; 4]></a></li><li><a href="#impl-TryFrom%3C%26%5Bu8;+5%5D%3E-for-ByteString" title="TryFrom<&[u8; 5]>">TryFrom<&[u8; 5]></a></li><li><a href="#impl-TryFrom%3C%26%5Bu8;+6%5D%3E-for-ByteString" title="TryFrom<&[u8; 6]>">TryFrom<&[u8; 6]></a></li><li><a href="#impl-TryFrom%3C%26%5Bu8;+7%5D%3E-for-ByteString" title="TryFrom<&[u8; 7]>">TryFrom<&[u8; 7]></a></li><li><a href="#impl-TryFrom%3C%26%5Bu8;+8%5D%3E-for-ByteString" title="TryFrom<&[u8; 8]>">TryFrom<&[u8; 8]></a></li><li><a href="#impl-TryFrom%3C%26%5Bu8;+9%5D%3E-for-ByteString" title="TryFrom<&[u8; 9]>">TryFrom<&[u8; 9]></a></li><li><a href="#impl-TryFrom%3C%26%5Bu8%5D%3E-for-ByteString" title="TryFrom<&[u8]>">TryFrom<&[u8]></a></li><li><a href="#impl-TryFrom%3CBytes%3E-for-ByteString" title="TryFrom<Bytes>">TryFrom<Bytes></a></li><li><a href="#impl-TryFrom%3CBytesMut%3E-for-ByteString" title="TryFrom<BytesMut>">TryFrom<BytesMut></a></li><li><a href="#impl-TryFrom%3CVec%3Cu8%3E%3E-for-ByteString" title="TryFrom<Vec<u8>>">TryFrom<Vec<u8>></a></li><li><a href="#impl-TryFrom%3C%5Bu8;+0%5D%3E-for-ByteString" title="TryFrom<[u8; 0]>">TryFrom<[u8; 0]></a></li><li><a href="#impl-TryFrom%3C%5Bu8;+10%5D%3E-for-ByteString" title="TryFrom<[u8; 10]>">TryFrom<[u8; 10]></a></li><li><a href="#impl-TryFrom%3C%5Bu8;+11%5D%3E-for-ByteString" title="TryFrom<[u8; 11]>">TryFrom<[u8; 11]></a></li><li><a href="#impl-TryFrom%3C%5Bu8;+12%5D%3E-for-ByteString" title="TryFrom<[u8; 12]>">TryFrom<[u8; 12]></a></li><li><a href="#impl-TryFrom%3C%5Bu8;+13%5D%3E-for-ByteString" title="TryFrom<[u8; 13]>">TryFrom<[u8; 13]></a></li><li><a href="#impl-TryFrom%3C%5Bu8;+14%5D%3E-for-ByteString" title="TryFrom<[u8; 14]>">TryFrom<[u8; 14]></a></li><li><a href="#impl-TryFrom%3C%5Bu8;+15%5D%3E-for-ByteString" title="TryFrom<[u8; 15]>">TryFrom<[u8; 15]></a></li><li><a href="#impl-TryFrom%3C%5Bu8;+16%5D%3E-for-ByteString" title="TryFrom<[u8; 16]>">TryFrom<[u8; 16]></a></li><li><a href="#impl-TryFrom%3C%5Bu8;+17%5D%3E-for-ByteString" title="TryFrom<[u8; 17]>">TryFrom<[u8; 17]></a></li><li><a href="#impl-TryFrom%3C%5Bu8;+18%5D%3E-for-ByteString" title="TryFrom<[u8; 18]>">TryFrom<[u8; 18]></a></li><li><a href="#impl-TryFrom%3C%5Bu8;+19%5D%3E-for-ByteString" title="TryFrom<[u8; 19]>">TryFrom<[u8; 19]></a></li><li><a href="#impl-TryFrom%3C%5Bu8;+1%5D%3E-for-ByteString" title="TryFrom<[u8; 1]>">TryFrom<[u8; 1]></a></li><li><a href="#impl-TryFrom%3C%5Bu8;+20%5D%3E-for-ByteString" title="TryFrom<[u8; 20]>">TryFrom<[u8; 20]></a></li><li><a href="#impl-TryFrom%3C%5Bu8;+21%5D%3E-for-ByteString" title="TryFrom<[u8; 21]>">TryFrom<[u8; 21]></a></li><li><a href="#impl-TryFrom%3C%5Bu8;+22%5D%3E-for-ByteString" title="TryFrom<[u8; 22]>">TryFrom<[u8; 22]></a></li><li><a href="#impl-TryFrom%3C%5Bu8;+23%5D%3E-for-ByteString" title="TryFrom<[u8; 23]>">TryFrom<[u8; 23]></a></li><li><a href="#impl-TryFrom%3C%5Bu8;+24%5D%3E-for-ByteString" title="TryFrom<[u8; 24]>">TryFrom<[u8; 24]></a></li><li><a href="#impl-TryFrom%3C%5Bu8;+25%5D%3E-for-ByteString" title="TryFrom<[u8; 25]>">TryFrom<[u8; 25]></a></li><li><a href="#impl-TryFrom%3C%5Bu8;+26%5D%3E-for-ByteString" title="TryFrom<[u8; 26]>">TryFrom<[u8; 26]></a></li><li><a href="#impl-TryFrom%3C%5Bu8;+27%5D%3E-for-ByteString" title="TryFrom<[u8; 27]>">TryFrom<[u8; 27]></a></li><li><a href="#impl-TryFrom%3C%5Bu8;+28%5D%3E-for-ByteString" title="TryFrom<[u8; 28]>">TryFrom<[u8; 28]></a></li><li><a href="#impl-TryFrom%3C%5Bu8;+29%5D%3E-for-ByteString" title="TryFrom<[u8; 29]>">TryFrom<[u8; 29]></a></li><li><a href="#impl-TryFrom%3C%5Bu8;+2%5D%3E-for-ByteString" title="TryFrom<[u8; 2]>">TryFrom<[u8; 2]></a></li><li><a href="#impl-TryFrom%3C%5Bu8;+30%5D%3E-for-ByteString" title="TryFrom<[u8; 30]>">TryFrom<[u8; 30]></a></li><li><a href="#impl-TryFrom%3C%5Bu8;+31%5D%3E-for-ByteString" title="TryFrom<[u8; 31]>">TryFrom<[u8; 31]></a></li><li><a href="#impl-TryFrom%3C%5Bu8;+32%5D%3E-for-ByteString" title="TryFrom<[u8; 32]>">TryFrom<[u8; 32]></a></li><li><a href="#impl-TryFrom%3C%5Bu8;+3%5D%3E-for-ByteString" title="TryFrom<[u8; 3]>">TryFrom<[u8; 3]></a></li><li><a href="#impl-TryFrom%3C%5Bu8;+4%5D%3E-for-ByteString" title="TryFrom<[u8; 4]>">TryFrom<[u8; 4]></a></li><li><a href="#impl-TryFrom%3C%5Bu8;+5%5D%3E-for-ByteString" title="TryFrom<[u8; 5]>">TryFrom<[u8; 5]></a></li><li><a href="#impl-TryFrom%3C%5Bu8;+6%5D%3E-for-ByteString" title="TryFrom<[u8; 6]>">TryFrom<[u8; 6]></a></li><li><a href="#impl-TryFrom%3C%5Bu8;+7%5D%3E-for-ByteString" title="TryFrom<[u8; 7]>">TryFrom<[u8; 7]></a></li><li><a href="#impl-TryFrom%3C%5Bu8;+8%5D%3E-for-ByteString" title="TryFrom<[u8; 8]>">TryFrom<[u8; 8]></a></li><li><a href="#impl-TryFrom%3C%5Bu8;+9%5D%3E-for-ByteString" title="TryFrom<[u8; 9]>">TryFrom<[u8; 9]></a></li></ul><h3><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul class="block synthetic-implementation"><li><a href="#impl-Freeze-for-ByteString" title="!Freeze">!Freeze</a></li><li><a href="#impl-RefUnwindSafe-for-ByteString" title="RefUnwindSafe">RefUnwindSafe</a></li><li><a href="#impl-Send-for-ByteString" title="Send">Send</a></li><li><a href="#impl-Sync-for-ByteString" title="Sync">Sync</a></li><li><a href="#impl-Unpin-for-ByteString" title="Unpin">Unpin</a></li><li><a href="#impl-UnwindSafe-for-ByteString" title="UnwindSafe">UnwindSafe</a></li></ul><h3><a href="#blanket-implementations">Blanket Implementations</a></h3><ul class="block blanket-implementation"><li><a href="#impl-Any-for-T" title="Any">Any</a></li><li><a href="#impl-Borrow%3CT%3E-for-T" title="Borrow<T>">Borrow<T></a></li><li><a href="#impl-BorrowMut%3CT%3E-for-T" title="BorrowMut<T>">BorrowMut<T></a></li><li><a href="#impl-CloneToUninit-for-T" title="CloneToUninit">CloneToUninit</a></li><li><a href="#impl-DeserializeOwned-for-T" title="DeserializeOwned">DeserializeOwned</a></li><li><a href="#impl-From%3CT%3E-for-T" title="From<T>">From<T></a></li><li><a href="#impl-Into%3CU%3E-for-T" title="Into<U>">Into<U></a></li><li><a href="#impl-ToOwned-for-T" title="ToOwned">ToOwned</a></li><li><a href="#impl-ToString-for-T" title="ToString">ToString</a></li><li><a href="#impl-TryFrom%3CU%3E-for-T" title="TryFrom<U>">TryFrom<U></a></li><li><a href="#impl-TryInto%3CU%3E-for-T" title="TryInto<U>">TryInto<U></a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate bytestring</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="index.html">bytestring</a></span><h1>Struct <span class="struct">ByteString</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/bytestring/lib.rs.html#22">source</a> </span></div><pre class="rust item-decl"><code>pub struct ByteString(<span class="comment">/* private fields */</span>);</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>An immutable UTF-8 encoded string with [<code>Bytes</code>] as a storage.</p>
|
||
</div></details><h2 id="implementations" class="section-header">Implementations<a href="#implementations" class="anchor">§</a></h2><div id="implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#24-93">source</a><a href="#impl-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.new" class="method"><a class="src rightside" href="../src/bytestring/lib.rs.html#26-28">source</a><h4 class="code-header">pub const fn <a href="#method.new" class="fn">new</a>() -> Self</h4></section></summary><div class="docblock"><p>Creates a new empty <code>ByteString</code>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.as_bytes" class="method"><a class="src rightside" href="../src/bytestring/lib.rs.html#31-33">source</a><h4 class="code-header">pub fn <a href="#method.as_bytes" class="fn">as_bytes</a>(&self) -> &Bytes</h4></section></summary><div class="docblock"><p>Get a reference to the underlying <code>Bytes</code> object.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.into_bytes" class="method"><a class="src rightside" href="../src/bytestring/lib.rs.html#36-38">source</a><h4 class="code-header">pub fn <a href="#method.into_bytes" class="fn">into_bytes</a>(self) -> Bytes</h4></section></summary><div class="docblock"><p>Unwraps this <code>ByteString</code> into the underlying <code>Bytes</code> object.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.from_static" class="method"><a class="src rightside" href="../src/bytestring/lib.rs.html#41-43">source</a><h4 class="code-header">pub const fn <a href="#method.from_static" class="fn">from_static</a>(src: &'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h4></section></summary><div class="docblock"><p>Creates a new <code>ByteString</code> from a <code>&'static str</code>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.from_bytes_unchecked" class="method"><a class="src rightside" href="../src/bytestring/lib.rs.html#52-54">source</a><h4 class="code-header">pub const unsafe fn <a href="#method.from_bytes_unchecked" class="fn">from_bytes_unchecked</a>(src: Bytes) -> <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h4></section></summary><div class="docblock"><p>Creates a new <code>ByteString</code> from a Bytes.</p>
|
||
<h5 id="safety"><a class="doc-anchor" href="#safety">§</a>Safety</h5>
|
||
<p>This function is unsafe because it does not check the bytes passed to it are valid UTF-8.
|
||
If this constraint is violated, it may cause memory unsafety issues with future users of
|
||
the <code>ByteString</code>, as we assume that <code>ByteString</code>s are valid UTF-8. However, the most likely
|
||
issue is that the data gets corrupted.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.slice_ref" class="method"><a class="src rightside" href="../src/bytestring/lib.rs.html#90-92">source</a><h4 class="code-header">pub fn <a href="#method.slice_ref" class="fn">slice_ref</a>(&self, subset: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> Self</h4></section></summary><div class="docblock"><p>Returns a new byte string that is equivalent to the given <code>subset</code>.</p>
|
||
<p>When processing a <code>ByteString</code> buffer with other tools, one often gets a <code>&str</code> which is in
|
||
fact a slice of the original <code>ByteString</code>; i.e., a subset of it. This function turns that
|
||
<code>&str</code> into another <code>ByteString</code>, as if one had sliced the <code>ByteString</code> with the offsets
|
||
that correspond to <code>subset</code>.</p>
|
||
<p>Corresponds to [<code>Bytes::slice_ref</code>].</p>
|
||
<p>This operation is <code>O(1)</code>.</p>
|
||
<h5 id="panics"><a class="doc-anchor" href="#panics">§</a>Panics</h5>
|
||
<p>Panics if <code>subset</code> is not a sub-slice of this byte string.</p>
|
||
<p>Note that strings which are only subsets from an equality perspective do not uphold this
|
||
requirement; see examples.</p>
|
||
<h5 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>string = ByteString::from_static(<span class="string">" foo "</span>);
|
||
<span class="kw">let </span>subset = string.trim();
|
||
<span class="kw">let </span>substring = string.slice_ref(subset);
|
||
<span class="macro">assert_eq!</span>(substring, <span class="string">"foo"</span>);</code></pre></div>
|
||
|
||
<div class="example-wrap should_panic"><a href="#" class="tooltip" title="This example panics">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="comment">// panics because the given slice is not derived from the original byte string, despite
|
||
// being a logical subset of the string
|
||
</span>ByteString::from_static(<span class="string">"foo bar"</span>).slice_ref(<span class="string">"foo"</span>);</code></pre></div>
|
||
</div></details></div></details></div><details class="toggle big-toggle" open><summary><h2 id="deref-methods-str" class="section-header"><span>Methods from <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html" title="trait core::ops::deref::Deref">Deref</a><Target = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>></span><a href="#deref-methods-str" class="anchor">§</a></h2></summary><div id="deref-methods-str-1" class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.len" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.6.0">1.6.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#140">source</a></span><h4 class="code-header">pub fn <a href="#method.len" class="fn">len</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></h4></section></summary><div class="docblock"><p>Returns the length of <code>self</code>.</p>
|
||
<p>This length is in bytes, not <a href="https://doc.rust-lang.org/nightly/std/primitive.char.html" title="primitive char"><code>char</code></a>s or graphemes. In other words,
|
||
it might not be what a human considers the length of the string.</p>
|
||
<h5 id="examples-1"><a class="doc-anchor" href="#examples-1">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>len = <span class="string">"foo"</span>.len();
|
||
<span class="macro">assert_eq!</span>(<span class="number">3</span>, len);
|
||
|
||
<span class="macro">assert_eq!</span>(<span class="string">"ƒoo"</span>.len(), <span class="number">4</span>); <span class="comment">// fancy f!
|
||
</span><span class="macro">assert_eq!</span>(<span class="string">"ƒoo"</span>.chars().count(), <span class="number">3</span>);</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.is_empty" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.6.0">1.6.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#159">source</a></span><h4 class="code-header">pub fn <a href="#method.is_empty" class="fn">is_empty</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Returns <code>true</code> if <code>self</code> has a length of zero bytes.</p>
|
||
<h5 id="examples-2"><a class="doc-anchor" href="#examples-2">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>s = <span class="string">""</span>;
|
||
<span class="macro">assert!</span>(s.is_empty());
|
||
|
||
<span class="kw">let </span>s = <span class="string">"not empty"</span>;
|
||
<span class="macro">assert!</span>(!s.is_empty());</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.is_char_boundary" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.9.0">1.9.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#189">source</a></span><h4 class="code-header">pub fn <a href="#method.is_char_boundary" class="fn">is_char_boundary</a>(&self, index: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Checks that <code>index</code>-th byte is the first byte in a UTF-8 code point
|
||
sequence or the end of the string.</p>
|
||
<p>The start and end of the string (when <code>index == self.len()</code>) are
|
||
considered to be boundaries.</p>
|
||
<p>Returns <code>false</code> if <code>index</code> is greater than <code>self.len()</code>.</p>
|
||
<h5 id="examples-3"><a class="doc-anchor" href="#examples-3">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>s = <span class="string">"Löwe 老虎 Léopard"</span>;
|
||
<span class="macro">assert!</span>(s.is_char_boundary(<span class="number">0</span>));
|
||
<span class="comment">// start of `老`
|
||
</span><span class="macro">assert!</span>(s.is_char_boundary(<span class="number">6</span>));
|
||
<span class="macro">assert!</span>(s.is_char_boundary(s.len()));
|
||
|
||
<span class="comment">// second byte of `ö`
|
||
</span><span class="macro">assert!</span>(!s.is_char_boundary(<span class="number">2</span>));
|
||
|
||
<span class="comment">// third byte of `老`
|
||
</span><span class="macro">assert!</span>(!s.is_char_boundary(<span class="number">8</span>));</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.floor_char_boundary" class="method"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#236">source</a><h4 class="code-header">pub fn <a href="#method.floor_char_boundary" class="fn">floor_char_boundary</a>(&self, index: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></h4></section><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>round_char_boundary</code>)</span></div></span></summary><div class="docblock"><p>Finds the closest <code>x</code> not exceeding <code>index</code> where <code>is_char_boundary(x)</code> is <code>true</code>.</p>
|
||
<p>This method can help you truncate a string so that it’s still valid UTF-8, but doesn’t
|
||
exceed a given number of bytes. Note that this is done purely at the character level
|
||
and can still visually split graphemes, even though the underlying characters aren’t
|
||
split. For example, the emoji 🧑🔬 (scientist) could be split so that the string only
|
||
includes 🧑 (person) instead.</p>
|
||
<h5 id="examples-4"><a class="doc-anchor" href="#examples-4">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="attr">#![feature(round_char_boundary)]
|
||
</span><span class="kw">let </span>s = <span class="string">"❤️🧡💛💚💙💜"</span>;
|
||
<span class="macro">assert_eq!</span>(s.len(), <span class="number">26</span>);
|
||
<span class="macro">assert!</span>(!s.is_char_boundary(<span class="number">13</span>));
|
||
|
||
<span class="kw">let </span>closest = s.floor_char_boundary(<span class="number">13</span>);
|
||
<span class="macro">assert_eq!</span>(closest, <span class="number">10</span>);
|
||
<span class="macro">assert_eq!</span>(<span class="kw-2">&</span>s[..closest], <span class="string">"❤️🧡"</span>);</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.ceil_char_boundary" class="method"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#274">source</a><h4 class="code-header">pub fn <a href="#method.ceil_char_boundary" class="fn">ceil_char_boundary</a>(&self, index: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></h4></section><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>round_char_boundary</code>)</span></div></span></summary><div class="docblock"><p>Finds the closest <code>x</code> not below <code>index</code> where <code>is_char_boundary(x)</code> is <code>true</code>.</p>
|
||
<p>If <code>index</code> is greater than the length of the string, this returns the length of the string.</p>
|
||
<p>This method is the natural complement to <a href="https://doc.rust-lang.org/nightly/std/primitive.str.html#method.floor_char_boundary" title="method str::floor_char_boundary"><code>floor_char_boundary</code></a>. See that method
|
||
for more details.</p>
|
||
<h5 id="examples-5"><a class="doc-anchor" href="#examples-5">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="attr">#![feature(round_char_boundary)]
|
||
</span><span class="kw">let </span>s = <span class="string">"❤️🧡💛💚💙💜"</span>;
|
||
<span class="macro">assert_eq!</span>(s.len(), <span class="number">26</span>);
|
||
<span class="macro">assert!</span>(!s.is_char_boundary(<span class="number">13</span>));
|
||
|
||
<span class="kw">let </span>closest = s.ceil_char_boundary(<span class="number">13</span>);
|
||
<span class="macro">assert_eq!</span>(closest, <span class="number">14</span>);
|
||
<span class="macro">assert_eq!</span>(<span class="kw-2">&</span>s[..closest], <span class="string">"❤️🧡💛"</span>);</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.as_bytes-1" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.6.0">1.6.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#300">source</a></span><h4 class="code-header">pub fn <a href="#method.as_bytes-1" class="fn">as_bytes</a>(&self) -> &[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>] <a href="#" class="tooltip" data-notable-ty="&[u8]">ⓘ</a></h4></section></summary><div class="docblock"><p>Converts a string slice to a byte slice. To convert the byte slice back
|
||
into a string slice, use the <a href="https://doc.rust-lang.org/nightly/core/str/converts/fn.from_utf8.html" title="fn core::str::converts::from_utf8"><code>from_utf8</code></a> function.</p>
|
||
<h5 id="examples-6"><a class="doc-anchor" href="#examples-6">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>bytes = <span class="string">"bors"</span>.as_bytes();
|
||
<span class="macro">assert_eq!</span>(<span class="string">b"bors"</span>, bytes);</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.as_ptr" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.6.0">1.6.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#375">source</a></span><h4 class="code-header">pub fn <a href="#method.as_ptr" class="fn">as_ptr</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.pointer.html">*const </a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a></h4></section></summary><div class="docblock"><p>Converts a string slice to a raw pointer.</p>
|
||
<p>As string slices are a slice of bytes, the raw pointer points to a
|
||
<a href="https://doc.rust-lang.org/nightly/std/primitive.u8.html" title="primitive u8"><code>u8</code></a>. This pointer will be pointing to the first byte of the string
|
||
slice.</p>
|
||
<p>The caller must ensure that the returned pointer is never written to.
|
||
If you need to mutate the contents of the string slice, use <a href="https://doc.rust-lang.org/nightly/std/primitive.str.html#method.as_mut_ptr" title="method str::as_mut_ptr"><code>as_mut_ptr</code></a>.</p>
|
||
<h5 id="examples-7"><a class="doc-anchor" href="#examples-7">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>s = <span class="string">"Hello"</span>;
|
||
<span class="kw">let </span>ptr = s.as_ptr();</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.get" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.20.0">1.20.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#417">source</a></span><h4 class="code-header">pub fn <a href="#method.get" class="fn">get</a><I>(&self, i: I) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&<I as <a class="trait" href="https://doc.rust-lang.org/nightly/core/slice/index/trait.SliceIndex.html" title="trait core::slice::index::SliceIndex">SliceIndex</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/slice/index/trait.SliceIndex.html#associatedtype.Output" title="type core::slice::index::SliceIndex::Output">Output</a>><div class="where">where
|
||
I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/slice/index/trait.SliceIndex.html" title="trait core::slice::index::SliceIndex">SliceIndex</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>>,</div></h4></section></summary><div class="docblock"><p>Returns a subslice of <code>str</code>.</p>
|
||
<p>This is the non-panicking alternative to indexing the <code>str</code>. Returns
|
||
<a href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html#variant.None" title="variant core::option::Option::None"><code>None</code></a> whenever equivalent indexing operation would panic.</p>
|
||
<h5 id="examples-8"><a class="doc-anchor" href="#examples-8">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>v = String::from(<span class="string">"🗻∈🌏"</span>);
|
||
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="string">"🗻"</span>), v.get(<span class="number">0</span>..<span class="number">4</span>));
|
||
|
||
<span class="comment">// indices not on UTF-8 sequence boundaries
|
||
</span><span class="macro">assert!</span>(v.get(<span class="number">1</span>..).is_none());
|
||
<span class="macro">assert!</span>(v.get(..<span class="number">8</span>).is_none());
|
||
|
||
<span class="comment">// out of bounds
|
||
</span><span class="macro">assert!</span>(v.get(..<span class="number">42</span>).is_none());</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.get_unchecked" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.20.0">1.20.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#481">source</a></span><h4 class="code-header">pub unsafe fn <a href="#method.get_unchecked" class="fn">get_unchecked</a><I>(&self, i: I) -> &<I as <a class="trait" href="https://doc.rust-lang.org/nightly/core/slice/index/trait.SliceIndex.html" title="trait core::slice::index::SliceIndex">SliceIndex</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/slice/index/trait.SliceIndex.html#associatedtype.Output" title="type core::slice::index::SliceIndex::Output">Output</a><div class="where">where
|
||
I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/slice/index/trait.SliceIndex.html" title="trait core::slice::index::SliceIndex">SliceIndex</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>>,</div></h4></section></summary><div class="docblock"><p>Returns an unchecked subslice of <code>str</code>.</p>
|
||
<p>This is the unchecked alternative to indexing the <code>str</code>.</p>
|
||
<h5 id="safety-1"><a class="doc-anchor" href="#safety-1">§</a>Safety</h5>
|
||
<p>Callers of this function are responsible that these preconditions are
|
||
satisfied:</p>
|
||
<ul>
|
||
<li>The starting index must not exceed the ending index;</li>
|
||
<li>Indexes must be within bounds of the original slice;</li>
|
||
<li>Indexes must lie on UTF-8 sequence boundaries.</li>
|
||
</ul>
|
||
<p>Failing that, the returned string slice may reference invalid memory or
|
||
violate the invariants communicated by the <code>str</code> type.</p>
|
||
<h5 id="examples-9"><a class="doc-anchor" href="#examples-9">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>v = <span class="string">"🗻∈🌏"</span>;
|
||
<span class="kw">unsafe </span>{
|
||
<span class="macro">assert_eq!</span>(<span class="string">"🗻"</span>, v.get_unchecked(<span class="number">0</span>..<span class="number">4</span>));
|
||
<span class="macro">assert_eq!</span>(<span class="string">"∈"</span>, v.get_unchecked(<span class="number">4</span>..<span class="number">7</span>));
|
||
<span class="macro">assert_eq!</span>(<span class="string">"🌏"</span>, v.get_unchecked(<span class="number">7</span>..<span class="number">11</span>));
|
||
}</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.slice_unchecked" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.6.0">1.6.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#567">source</a></span><h4 class="code-header">pub unsafe fn <a href="#method.slice_unchecked" class="fn">slice_unchecked</a>(&self, begin: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, end: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></h4></section><span class="item-info"><div class="stab deprecated"><span class="emoji">👎</span><span>Deprecated since 1.29.0: use <code>get_unchecked(begin..end)</code> instead</span></div></span></summary><div class="docblock"><p>Creates a string slice from another string slice, bypassing safety
|
||
checks.</p>
|
||
<p>This is generally not recommended, use with caution! For a safe
|
||
alternative see <a href="https://doc.rust-lang.org/nightly/std/primitive.str.html" title="primitive str"><code>str</code></a> and <a href="https://doc.rust-lang.org/nightly/core/ops/index/trait.Index.html" title="trait core::ops::index::Index"><code>Index</code></a>.</p>
|
||
<p>This new slice goes from <code>begin</code> to <code>end</code>, including <code>begin</code> but
|
||
excluding <code>end</code>.</p>
|
||
<p>To get a mutable string slice instead, see the
|
||
<a href="https://doc.rust-lang.org/nightly/std/primitive.str.html#method.slice_mut_unchecked" title="method str::slice_mut_unchecked"><code>slice_mut_unchecked</code></a> method.</p>
|
||
<h5 id="safety-2"><a class="doc-anchor" href="#safety-2">§</a>Safety</h5>
|
||
<p>Callers of this function are responsible that three preconditions are
|
||
satisfied:</p>
|
||
<ul>
|
||
<li><code>begin</code> must not exceed <code>end</code>.</li>
|
||
<li><code>begin</code> and <code>end</code> must be byte positions within the string slice.</li>
|
||
<li><code>begin</code> and <code>end</code> must lie on UTF-8 sequence boundaries.</li>
|
||
</ul>
|
||
<h5 id="examples-10"><a class="doc-anchor" href="#examples-10">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>s = <span class="string">"Löwe 老虎 Léopard"</span>;
|
||
|
||
<span class="kw">unsafe </span>{
|
||
<span class="macro">assert_eq!</span>(<span class="string">"Löwe 老虎 Léopard"</span>, s.slice_unchecked(<span class="number">0</span>, <span class="number">21</span>));
|
||
}
|
||
|
||
<span class="kw">let </span>s = <span class="string">"Hello, world!"</span>;
|
||
|
||
<span class="kw">unsafe </span>{
|
||
<span class="macro">assert_eq!</span>(<span class="string">"world"</span>, s.slice_unchecked(<span class="number">7</span>, <span class="number">12</span>));
|
||
}</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.split_at" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.6.0">1.6.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#640">source</a></span><h4 class="code-header">pub fn <a href="#method.split_at" class="fn">split_at</a>(&self, mid: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> (&<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>)</h4></section></summary><div class="docblock"><p>Divides one string slice into two at an index.</p>
|
||
<p>The argument, <code>mid</code>, should be a byte offset from the start of the
|
||
string. It must also be on the boundary of a UTF-8 code point.</p>
|
||
<p>The two slices returned go from the start of the string slice to <code>mid</code>,
|
||
and from <code>mid</code> to the end of the string slice.</p>
|
||
<p>To get mutable string slices instead, see the <a href="https://doc.rust-lang.org/nightly/std/primitive.str.html#method.split_at_mut" title="method str::split_at_mut"><code>split_at_mut</code></a>
|
||
method.</p>
|
||
<h5 id="panics-1"><a class="doc-anchor" href="#panics-1">§</a>Panics</h5>
|
||
<p>Panics if <code>mid</code> is not on a UTF-8 code point boundary, or if it is past
|
||
the end of the last code point of the string slice. For a non-panicking
|
||
alternative see <a href="https://doc.rust-lang.org/nightly/std/primitive.str.html#method.split_at_checked" title="method str::split_at_checked"><code>split_at_checked</code></a>.</p>
|
||
<h5 id="examples-11"><a class="doc-anchor" href="#examples-11">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>s = <span class="string">"Per Martin-Löf"</span>;
|
||
|
||
<span class="kw">let </span>(first, last) = s.split_at(<span class="number">3</span>);
|
||
|
||
<span class="macro">assert_eq!</span>(<span class="string">"Per"</span>, first);
|
||
<span class="macro">assert_eq!</span>(<span class="string">" Martin-Löf"</span>, last);</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.split_at_checked" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.80.0">1.80.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#719">source</a></span><h4 class="code-header">pub fn <a href="#method.split_at_checked" class="fn">split_at_checked</a>(&self, mid: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><(&<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>)></h4></section></summary><div class="docblock"><p>Divides one string slice into two at an index.</p>
|
||
<p>The argument, <code>mid</code>, should be a valid byte offset from the start of the
|
||
string. It must also be on the boundary of a UTF-8 code point. The
|
||
method returns <code>None</code> if that’s not the case.</p>
|
||
<p>The two slices returned go from the start of the string slice to <code>mid</code>,
|
||
and from <code>mid</code> to the end of the string slice.</p>
|
||
<p>To get mutable string slices instead, see the <a href="https://doc.rust-lang.org/nightly/std/primitive.str.html#method.split_at_mut_checked" title="method str::split_at_mut_checked"><code>split_at_mut_checked</code></a>
|
||
method.</p>
|
||
<h5 id="examples-12"><a class="doc-anchor" href="#examples-12">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>s = <span class="string">"Per Martin-Löf"</span>;
|
||
|
||
<span class="kw">let </span>(first, last) = s.split_at_checked(<span class="number">3</span>).unwrap();
|
||
<span class="macro">assert_eq!</span>(<span class="string">"Per"</span>, first);
|
||
<span class="macro">assert_eq!</span>(<span class="string">" Martin-Löf"</span>, last);
|
||
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">None</span>, s.split_at_checked(<span class="number">13</span>)); <span class="comment">// Inside “ö”
|
||
</span><span class="macro">assert_eq!</span>(<span class="prelude-val">None</span>, s.split_at_checked(<span class="number">16</span>)); <span class="comment">// Beyond the string length</span></code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.chars" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.6.0">1.6.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#837">source</a></span><h4 class="code-header">pub fn <a href="#method.chars" class="fn">chars</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/iter/struct.Chars.html" title="struct core::str::iter::Chars">Chars</a><'_></h4></section></summary><div class="docblock"><p>Returns an iterator over the <a href="https://doc.rust-lang.org/nightly/std/primitive.char.html" title="primitive char"><code>char</code></a>s of a string slice.</p>
|
||
<p>As a string slice consists of valid UTF-8, we can iterate through a
|
||
string slice by <a href="https://doc.rust-lang.org/nightly/std/primitive.char.html" title="primitive char"><code>char</code></a>. This method returns such an iterator.</p>
|
||
<p>It’s important to remember that <a href="https://doc.rust-lang.org/nightly/std/primitive.char.html" title="primitive char"><code>char</code></a> represents a Unicode Scalar
|
||
Value, and might not match your idea of what a ‘character’ is. Iteration
|
||
over grapheme clusters may be what you actually want. This functionality
|
||
is not provided by Rust’s standard library, check crates.io instead.</p>
|
||
<h5 id="examples-13"><a class="doc-anchor" href="#examples-13">§</a>Examples</h5>
|
||
<p>Basic usage:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>word = <span class="string">"goodbye"</span>;
|
||
|
||
<span class="kw">let </span>count = word.chars().count();
|
||
<span class="macro">assert_eq!</span>(<span class="number">7</span>, count);
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>chars = word.chars();
|
||
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="string">'g'</span>), chars.next());
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="string">'o'</span>), chars.next());
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="string">'o'</span>), chars.next());
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="string">'d'</span>), chars.next());
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="string">'b'</span>), chars.next());
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="string">'y'</span>), chars.next());
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="string">'e'</span>), chars.next());
|
||
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">None</span>, chars.next());</code></pre></div>
|
||
<p>Remember, <a href="https://doc.rust-lang.org/nightly/std/primitive.char.html" title="primitive char"><code>char</code></a>s might not match your intuition about characters:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>y = <span class="string">"y̆"</span>;
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>chars = y.chars();
|
||
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="string">'y'</span>), chars.next()); <span class="comment">// not 'y̆'
|
||
</span><span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="string">'\u{0306}'</span>), chars.next());
|
||
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">None</span>, chars.next());</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.char_indices" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.6.0">1.6.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#894">source</a></span><h4 class="code-header">pub fn <a href="#method.char_indices" class="fn">char_indices</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/iter/struct.CharIndices.html" title="struct core::str::iter::CharIndices">CharIndices</a><'_></h4></section></summary><div class="docblock"><p>Returns an iterator over the <a href="https://doc.rust-lang.org/nightly/std/primitive.char.html" title="primitive char"><code>char</code></a>s of a string slice, and their
|
||
positions.</p>
|
||
<p>As a string slice consists of valid UTF-8, we can iterate through a
|
||
string slice by <a href="https://doc.rust-lang.org/nightly/std/primitive.char.html" title="primitive char"><code>char</code></a>. This method returns an iterator of both
|
||
these <a href="https://doc.rust-lang.org/nightly/std/primitive.char.html" title="primitive char"><code>char</code></a>s, as well as their byte positions.</p>
|
||
<p>The iterator yields tuples. The position is first, the <a href="https://doc.rust-lang.org/nightly/std/primitive.char.html" title="primitive char"><code>char</code></a> is
|
||
second.</p>
|
||
<h5 id="examples-14"><a class="doc-anchor" href="#examples-14">§</a>Examples</h5>
|
||
<p>Basic usage:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>word = <span class="string">"goodbye"</span>;
|
||
|
||
<span class="kw">let </span>count = word.char_indices().count();
|
||
<span class="macro">assert_eq!</span>(<span class="number">7</span>, count);
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>char_indices = word.char_indices();
|
||
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>((<span class="number">0</span>, <span class="string">'g'</span>)), char_indices.next());
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>((<span class="number">1</span>, <span class="string">'o'</span>)), char_indices.next());
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>((<span class="number">2</span>, <span class="string">'o'</span>)), char_indices.next());
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>((<span class="number">3</span>, <span class="string">'d'</span>)), char_indices.next());
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>((<span class="number">4</span>, <span class="string">'b'</span>)), char_indices.next());
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>((<span class="number">5</span>, <span class="string">'y'</span>)), char_indices.next());
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>((<span class="number">6</span>, <span class="string">'e'</span>)), char_indices.next());
|
||
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">None</span>, char_indices.next());</code></pre></div>
|
||
<p>Remember, <a href="https://doc.rust-lang.org/nightly/std/primitive.char.html" title="primitive char"><code>char</code></a>s might not match your intuition about characters:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>yes = <span class="string">"y̆es"</span>;
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>char_indices = yes.char_indices();
|
||
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>((<span class="number">0</span>, <span class="string">'y'</span>)), char_indices.next()); <span class="comment">// not (0, 'y̆')
|
||
</span><span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>((<span class="number">1</span>, <span class="string">'\u{0306}'</span>)), char_indices.next());
|
||
|
||
<span class="comment">// note the 3 here - the previous character took up two bytes
|
||
</span><span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>((<span class="number">3</span>, <span class="string">'e'</span>)), char_indices.next());
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>((<span class="number">4</span>, <span class="string">'s'</span>)), char_indices.next());
|
||
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">None</span>, char_indices.next());</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.bytes" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.6.0">1.6.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#917">source</a></span><h4 class="code-header">pub fn <a href="#method.bytes" class="fn">bytes</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/iter/struct.Bytes.html" title="struct core::str::iter::Bytes">Bytes</a><'_></h4></section></summary><div class="docblock"><p>Returns an iterator over the bytes of a string slice.</p>
|
||
<p>As a string slice consists of a sequence of bytes, we can iterate
|
||
through a string slice by byte. This method returns such an iterator.</p>
|
||
<h5 id="examples-15"><a class="doc-anchor" href="#examples-15">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span><span class="kw-2">mut </span>bytes = <span class="string">"bors"</span>.bytes();
|
||
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="string">b'b'</span>), bytes.next());
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="string">b'o'</span>), bytes.next());
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="string">b'r'</span>), bytes.next());
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="string">b's'</span>), bytes.next());
|
||
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">None</span>, bytes.next());</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.split_whitespace" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.6.0">1.6.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#969">source</a></span><h4 class="code-header">pub fn <a href="#method.split_whitespace" class="fn">split_whitespace</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/iter/struct.SplitWhitespace.html" title="struct core::str::iter::SplitWhitespace">SplitWhitespace</a><'_></h4></section></summary><div class="docblock"><p>Splits a string slice by whitespace.</p>
|
||
<p>The iterator returned will return string slices that are sub-slices of
|
||
the original string slice, separated by any amount of whitespace.</p>
|
||
<p>‘Whitespace’ is defined according to the terms of the Unicode Derived
|
||
Core Property <code>White_Space</code>. If you only want to split on ASCII whitespace
|
||
instead, use <a href="https://doc.rust-lang.org/nightly/std/primitive.str.html#method.split_ascii_whitespace" title="method str::split_ascii_whitespace"><code>split_ascii_whitespace</code></a>.</p>
|
||
<h5 id="examples-16"><a class="doc-anchor" href="#examples-16">§</a>Examples</h5>
|
||
<p>Basic usage:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span><span class="kw-2">mut </span>iter = <span class="string">"A few words"</span>.split_whitespace();
|
||
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="string">"A"</span>), iter.next());
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="string">"few"</span>), iter.next());
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="string">"words"</span>), iter.next());
|
||
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">None</span>, iter.next());</code></pre></div>
|
||
<p>All kinds of whitespace are considered:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span><span class="kw-2">mut </span>iter = <span class="string">" Mary had\ta\u{2009}little \n\t lamb"</span>.split_whitespace();
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="string">"Mary"</span>), iter.next());
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="string">"had"</span>), iter.next());
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="string">"a"</span>), iter.next());
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="string">"little"</span>), iter.next());
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="string">"lamb"</span>), iter.next());
|
||
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">None</span>, iter.next());</code></pre></div>
|
||
<p>If the string is empty or all whitespace, the iterator yields no string slices:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">assert_eq!</span>(<span class="string">""</span>.split_whitespace().next(), <span class="prelude-val">None</span>);
|
||
<span class="macro">assert_eq!</span>(<span class="string">" "</span>.split_whitespace().next(), <span class="prelude-val">None</span>);</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.split_ascii_whitespace" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.34.0">1.34.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#1018">source</a></span><h4 class="code-header">pub fn <a href="#method.split_ascii_whitespace" class="fn">split_ascii_whitespace</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/iter/struct.SplitAsciiWhitespace.html" title="struct core::str::iter::SplitAsciiWhitespace">SplitAsciiWhitespace</a><'_></h4></section></summary><div class="docblock"><p>Splits a string slice by ASCII whitespace.</p>
|
||
<p>The iterator returned will return string slices that are sub-slices of
|
||
the original string slice, separated by any amount of ASCII whitespace.</p>
|
||
<p>To split by Unicode <code>Whitespace</code> instead, use <a href="https://doc.rust-lang.org/nightly/std/primitive.str.html#method.split_whitespace" title="method str::split_whitespace"><code>split_whitespace</code></a>.</p>
|
||
<h5 id="examples-17"><a class="doc-anchor" href="#examples-17">§</a>Examples</h5>
|
||
<p>Basic usage:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span><span class="kw-2">mut </span>iter = <span class="string">"A few words"</span>.split_ascii_whitespace();
|
||
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="string">"A"</span>), iter.next());
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="string">"few"</span>), iter.next());
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="string">"words"</span>), iter.next());
|
||
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">None</span>, iter.next());</code></pre></div>
|
||
<p>All kinds of ASCII whitespace are considered:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span><span class="kw-2">mut </span>iter = <span class="string">" Mary had\ta little \n\t lamb"</span>.split_ascii_whitespace();
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="string">"Mary"</span>), iter.next());
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="string">"had"</span>), iter.next());
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="string">"a"</span>), iter.next());
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="string">"little"</span>), iter.next());
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="string">"lamb"</span>), iter.next());
|
||
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">None</span>, iter.next());</code></pre></div>
|
||
<p>If the string is empty or all ASCII whitespace, the iterator yields no string slices:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">assert_eq!</span>(<span class="string">""</span>.split_ascii_whitespace().next(), <span class="prelude-val">None</span>);
|
||
<span class="macro">assert_eq!</span>(<span class="string">" "</span>.split_ascii_whitespace().next(), <span class="prelude-val">None</span>);</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.lines" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.6.0">1.6.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#1071">source</a></span><h4 class="code-header">pub fn <a href="#method.lines" class="fn">lines</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/iter/struct.Lines.html" title="struct core::str::iter::Lines">Lines</a><'_></h4></section></summary><div class="docblock"><p>Returns an iterator over the lines of a string, as string slices.</p>
|
||
<p>Lines are split at line endings that are either newlines (<code>\n</code>) or
|
||
sequences of a carriage return followed by a line feed (<code>\r\n</code>).</p>
|
||
<p>Line terminators are not included in the lines returned by the iterator.</p>
|
||
<p>Note that any carriage return (<code>\r</code>) not immediately followed by a
|
||
line feed (<code>\n</code>) does not split a line. These carriage returns are
|
||
thereby included in the produced lines.</p>
|
||
<p>The final line ending is optional. A string that ends with a final line
|
||
ending will return the same lines as an otherwise identical string
|
||
without a final line ending.</p>
|
||
<h5 id="examples-18"><a class="doc-anchor" href="#examples-18">§</a>Examples</h5>
|
||
<p>Basic usage:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>text = <span class="string">"foo\r\nbar\n\nbaz\r"</span>;
|
||
<span class="kw">let </span><span class="kw-2">mut </span>lines = text.lines();
|
||
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="string">"foo"</span>), lines.next());
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="string">"bar"</span>), lines.next());
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="string">""</span>), lines.next());
|
||
<span class="comment">// Trailing carriage return is included in the last line
|
||
</span><span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="string">"baz\r"</span>), lines.next());
|
||
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">None</span>, lines.next());</code></pre></div>
|
||
<p>The final line does not require any ending:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>text = <span class="string">"foo\nbar\n\r\nbaz"</span>;
|
||
<span class="kw">let </span><span class="kw-2">mut </span>lines = text.lines();
|
||
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="string">"foo"</span>), lines.next());
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="string">"bar"</span>), lines.next());
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="string">""</span>), lines.next());
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="string">"baz"</span>), lines.next());
|
||
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">None</span>, lines.next());</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.lines_any" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.6.0">1.6.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#1080">source</a></span><h4 class="code-header">pub fn <a href="#method.lines_any" class="fn">lines_any</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/iter/struct.LinesAny.html" title="struct core::str::iter::LinesAny">LinesAny</a><'_></h4></section><span class="item-info"><div class="stab deprecated"><span class="emoji">👎</span><span>Deprecated since 1.4.0: use lines() instead now</span></div></span></summary><div class="docblock"><p>Returns an iterator over the lines of a string.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.encode_utf16" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.8.0">1.8.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#1099">source</a></span><h4 class="code-header">pub fn <a href="#method.encode_utf16" class="fn">encode_utf16</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/iter/struct.EncodeUtf16.html" title="struct core::str::iter::EncodeUtf16">EncodeUtf16</a><'_></h4></section></summary><div class="docblock"><p>Returns an iterator of <code>u16</code> over the string encoded as UTF-16.</p>
|
||
<h5 id="examples-19"><a class="doc-anchor" href="#examples-19">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>text = <span class="string">"Zażółć gęślą jaźń"</span>;
|
||
|
||
<span class="kw">let </span>utf8_len = text.len();
|
||
<span class="kw">let </span>utf16_len = text.encode_utf16().count();
|
||
|
||
<span class="macro">assert!</span>(utf16_len <= utf8_len);</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.contains" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.6.0">1.6.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#1124">source</a></span><h4 class="code-header">pub fn <a href="#method.contains" class="fn">contains</a><P>(&self, pat: P) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a><div class="where">where
|
||
P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html" title="trait core::str::pattern::Pattern">Pattern</a>,</div></h4></section></summary><div class="docblock"><p>Returns <code>true</code> if the given pattern matches a sub-slice of
|
||
this string slice.</p>
|
||
<p>Returns <code>false</code> if it does not.</p>
|
||
<p>The <a href="https://doc.rust-lang.org/nightly/core/str/pattern/index.html" title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, <a href="https://doc.rust-lang.org/nightly/std/primitive.char.html" title="primitive char"><code>char</code></a>, a slice of <a href="https://doc.rust-lang.org/nightly/std/primitive.char.html" title="primitive char"><code>char</code></a>s, or a
|
||
function or closure that determines if a character matches.</p>
|
||
<h5 id="examples-20"><a class="doc-anchor" href="#examples-20">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>bananas = <span class="string">"bananas"</span>;
|
||
|
||
<span class="macro">assert!</span>(bananas.contains(<span class="string">"nana"</span>));
|
||
<span class="macro">assert!</span>(!bananas.contains(<span class="string">"apples"</span>));</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.starts_with" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.6.0">1.6.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#1162">source</a></span><h4 class="code-header">pub fn <a href="#method.starts_with" class="fn">starts_with</a><P>(&self, pat: P) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a><div class="where">where
|
||
P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html" title="trait core::str::pattern::Pattern">Pattern</a>,</div></h4></section></summary><div class="docblock"><p>Returns <code>true</code> if the given pattern matches a prefix of this
|
||
string slice.</p>
|
||
<p>Returns <code>false</code> if it does not.</p>
|
||
<p>The <a href="https://doc.rust-lang.org/nightly/core/str/pattern/index.html" title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, in which case this function will return true if
|
||
the <code>&str</code> is a prefix of this string slice.</p>
|
||
<p>The <a href="https://doc.rust-lang.org/nightly/core/str/pattern/index.html" title="mod core::str::pattern">pattern</a> can also be a <a href="https://doc.rust-lang.org/nightly/std/primitive.char.html" title="primitive char"><code>char</code></a>, a slice of <a href="https://doc.rust-lang.org/nightly/std/primitive.char.html" title="primitive char"><code>char</code></a>s, or a
|
||
function or closure that determines if a character matches.
|
||
These will only be checked against the first character of this string slice.
|
||
Look at the second example below regarding behavior for slices of <a href="https://doc.rust-lang.org/nightly/std/primitive.char.html" title="primitive char"><code>char</code></a>s.</p>
|
||
<h5 id="examples-21"><a class="doc-anchor" href="#examples-21">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>bananas = <span class="string">"bananas"</span>;
|
||
|
||
<span class="macro">assert!</span>(bananas.starts_with(<span class="string">"bana"</span>));
|
||
<span class="macro">assert!</span>(!bananas.starts_with(<span class="string">"nana"</span>));</code></pre></div>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>bananas = <span class="string">"bananas"</span>;
|
||
|
||
<span class="comment">// Note that both of these assert successfully.
|
||
</span><span class="macro">assert!</span>(bananas.starts_with(<span class="kw-2">&</span>[<span class="string">'b'</span>, <span class="string">'a'</span>, <span class="string">'n'</span>, <span class="string">'a'</span>]));
|
||
<span class="macro">assert!</span>(bananas.starts_with(<span class="kw-2">&</span>[<span class="string">'a'</span>, <span class="string">'b'</span>, <span class="string">'c'</span>, <span class="string">'d'</span>]));</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.ends_with" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.6.0">1.6.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#1187-1189">source</a></span><h4 class="code-header">pub fn <a href="#method.ends_with" class="fn">ends_with</a><P>(&self, pat: P) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a><div class="where">where
|
||
P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html" title="trait core::str::pattern::Pattern">Pattern</a>,
|
||
<P as <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html" title="trait core::str::pattern::Pattern">Pattern</a>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html#associatedtype.Searcher" title="type core::str::pattern::Pattern::Searcher">Searcher</a><'a>: for<'a> <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.ReverseSearcher.html" title="trait core::str::pattern::ReverseSearcher">ReverseSearcher</a><'a>,</div></h4></section></summary><div class="docblock"><p>Returns <code>true</code> if the given pattern matches a suffix of this
|
||
string slice.</p>
|
||
<p>Returns <code>false</code> if it does not.</p>
|
||
<p>The <a href="https://doc.rust-lang.org/nightly/core/str/pattern/index.html" title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, <a href="https://doc.rust-lang.org/nightly/std/primitive.char.html" title="primitive char"><code>char</code></a>, a slice of <a href="https://doc.rust-lang.org/nightly/std/primitive.char.html" title="primitive char"><code>char</code></a>s, or a
|
||
function or closure that determines if a character matches.</p>
|
||
<h5 id="examples-22"><a class="doc-anchor" href="#examples-22">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>bananas = <span class="string">"bananas"</span>;
|
||
|
||
<span class="macro">assert!</span>(bananas.ends_with(<span class="string">"anas"</span>));
|
||
<span class="macro">assert!</span>(!bananas.ends_with(<span class="string">"nana"</span>));</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.find" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.6.0">1.6.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#1238">source</a></span><h4 class="code-header">pub fn <a href="#method.find" class="fn">find</a><P>(&self, pat: P) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>><div class="where">where
|
||
P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html" title="trait core::str::pattern::Pattern">Pattern</a>,</div></h4></section></summary><div class="docblock"><p>Returns the byte index of the first character of this string slice that
|
||
matches the pattern.</p>
|
||
<p>Returns <a href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html#variant.None" title="variant core::option::Option::None"><code>None</code></a> if the pattern doesn’t match.</p>
|
||
<p>The <a href="https://doc.rust-lang.org/nightly/core/str/pattern/index.html" title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, <a href="https://doc.rust-lang.org/nightly/std/primitive.char.html" title="primitive char"><code>char</code></a>, a slice of <a href="https://doc.rust-lang.org/nightly/std/primitive.char.html" title="primitive char"><code>char</code></a>s, or a
|
||
function or closure that determines if a character matches.</p>
|
||
<h5 id="examples-23"><a class="doc-anchor" href="#examples-23">§</a>Examples</h5>
|
||
<p>Simple patterns:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>s = <span class="string">"Löwe 老虎 Léopard Gepardi"</span>;
|
||
|
||
<span class="macro">assert_eq!</span>(s.find(<span class="string">'L'</span>), <span class="prelude-val">Some</span>(<span class="number">0</span>));
|
||
<span class="macro">assert_eq!</span>(s.find(<span class="string">'é'</span>), <span class="prelude-val">Some</span>(<span class="number">14</span>));
|
||
<span class="macro">assert_eq!</span>(s.find(<span class="string">"pard"</span>), <span class="prelude-val">Some</span>(<span class="number">17</span>));</code></pre></div>
|
||
<p>More complex patterns using point-free style and closures:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>s = <span class="string">"Löwe 老虎 Léopard"</span>;
|
||
|
||
<span class="macro">assert_eq!</span>(s.find(char::is_whitespace), <span class="prelude-val">Some</span>(<span class="number">5</span>));
|
||
<span class="macro">assert_eq!</span>(s.find(char::is_lowercase), <span class="prelude-val">Some</span>(<span class="number">1</span>));
|
||
<span class="macro">assert_eq!</span>(s.find(|c: char| c.is_whitespace() || c.is_lowercase()), <span class="prelude-val">Some</span>(<span class="number">1</span>));
|
||
<span class="macro">assert_eq!</span>(s.find(|c: char| (c < <span class="string">'o'</span>) && (c > <span class="string">'a'</span>)), <span class="prelude-val">Some</span>(<span class="number">4</span>));</code></pre></div>
|
||
<p>Not finding the pattern:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>s = <span class="string">"Löwe 老虎 Léopard"</span>;
|
||
<span class="kw">let </span>x: <span class="kw-2">&</span>[<span class="kw">_</span>] = <span class="kw-2">&</span>[<span class="string">'1'</span>, <span class="string">'2'</span>];
|
||
|
||
<span class="macro">assert_eq!</span>(s.find(x), <span class="prelude-val">None</span>);</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.rfind" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.6.0">1.6.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#1284-1286">source</a></span><h4 class="code-header">pub fn <a href="#method.rfind" class="fn">rfind</a><P>(&self, pat: P) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>><div class="where">where
|
||
P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html" title="trait core::str::pattern::Pattern">Pattern</a>,
|
||
<P as <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html" title="trait core::str::pattern::Pattern">Pattern</a>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html#associatedtype.Searcher" title="type core::str::pattern::Pattern::Searcher">Searcher</a><'a>: for<'a> <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.ReverseSearcher.html" title="trait core::str::pattern::ReverseSearcher">ReverseSearcher</a><'a>,</div></h4></section></summary><div class="docblock"><p>Returns the byte index for the first character of the last match of the pattern in
|
||
this string slice.</p>
|
||
<p>Returns <a href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html#variant.None" title="variant core::option::Option::None"><code>None</code></a> if the pattern doesn’t match.</p>
|
||
<p>The <a href="https://doc.rust-lang.org/nightly/core/str/pattern/index.html" title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, <a href="https://doc.rust-lang.org/nightly/std/primitive.char.html" title="primitive char"><code>char</code></a>, a slice of <a href="https://doc.rust-lang.org/nightly/std/primitive.char.html" title="primitive char"><code>char</code></a>s, or a
|
||
function or closure that determines if a character matches.</p>
|
||
<h5 id="examples-24"><a class="doc-anchor" href="#examples-24">§</a>Examples</h5>
|
||
<p>Simple patterns:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>s = <span class="string">"Löwe 老虎 Léopard Gepardi"</span>;
|
||
|
||
<span class="macro">assert_eq!</span>(s.rfind(<span class="string">'L'</span>), <span class="prelude-val">Some</span>(<span class="number">13</span>));
|
||
<span class="macro">assert_eq!</span>(s.rfind(<span class="string">'é'</span>), <span class="prelude-val">Some</span>(<span class="number">14</span>));
|
||
<span class="macro">assert_eq!</span>(s.rfind(<span class="string">"pard"</span>), <span class="prelude-val">Some</span>(<span class="number">24</span>));</code></pre></div>
|
||
<p>More complex patterns with closures:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>s = <span class="string">"Löwe 老虎 Léopard"</span>;
|
||
|
||
<span class="macro">assert_eq!</span>(s.rfind(char::is_whitespace), <span class="prelude-val">Some</span>(<span class="number">12</span>));
|
||
<span class="macro">assert_eq!</span>(s.rfind(char::is_lowercase), <span class="prelude-val">Some</span>(<span class="number">20</span>));</code></pre></div>
|
||
<p>Not finding the pattern:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>s = <span class="string">"Löwe 老虎 Léopard"</span>;
|
||
<span class="kw">let </span>x: <span class="kw-2">&</span>[<span class="kw">_</span>] = <span class="kw-2">&</span>[<span class="string">'1'</span>, <span class="string">'2'</span>];
|
||
|
||
<span class="macro">assert_eq!</span>(s.rfind(x), <span class="prelude-val">None</span>);</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.split" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.6.0">1.6.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#1406">source</a></span><h4 class="code-header">pub fn <a href="#method.split" class="fn">split</a><P>(&self, pat: P) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/iter/struct.Split.html" title="struct core::str::iter::Split">Split</a><'_, P><div class="where">where
|
||
P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html" title="trait core::str::pattern::Pattern">Pattern</a>,</div></h4></section></summary><div class="docblock"><p>Returns an iterator over substrings of this string slice, separated by
|
||
characters matched by a pattern.</p>
|
||
<p>The <a href="https://doc.rust-lang.org/nightly/core/str/pattern/index.html" title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, <a href="https://doc.rust-lang.org/nightly/std/primitive.char.html" title="primitive char"><code>char</code></a>, a slice of <a href="https://doc.rust-lang.org/nightly/std/primitive.char.html" title="primitive char"><code>char</code></a>s, or a
|
||
function or closure that determines if a character matches.</p>
|
||
<h5 id="iterator-behavior"><a class="doc-anchor" href="#iterator-behavior">§</a>Iterator behavior</h5>
|
||
<p>The returned iterator will be a <a href="https://doc.rust-lang.org/nightly/core/iter/traits/double_ended/trait.DoubleEndedIterator.html" title="trait core::iter::traits::double_ended::DoubleEndedIterator"><code>DoubleEndedIterator</code></a> if the pattern
|
||
allows a reverse search and forward/reverse search yields the same
|
||
elements. This is true for, e.g., <a href="https://doc.rust-lang.org/nightly/std/primitive.char.html" title="primitive char"><code>char</code></a>, but not for <code>&str</code>.</p>
|
||
<p>If the pattern allows a reverse search but its results might differ
|
||
from a forward search, the <a href="https://doc.rust-lang.org/nightly/std/primitive.str.html#method.rsplit" title="method str::rsplit"><code>rsplit</code></a> method can be used.</p>
|
||
<h5 id="examples-25"><a class="doc-anchor" href="#examples-25">§</a>Examples</h5>
|
||
<p>Simple patterns:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>v: Vec<<span class="kw-2">&</span>str> = <span class="string">"Mary had a little lamb"</span>.split(<span class="string">' '</span>).collect();
|
||
<span class="macro">assert_eq!</span>(v, [<span class="string">"Mary"</span>, <span class="string">"had"</span>, <span class="string">"a"</span>, <span class="string">"little"</span>, <span class="string">"lamb"</span>]);
|
||
|
||
<span class="kw">let </span>v: Vec<<span class="kw-2">&</span>str> = <span class="string">""</span>.split(<span class="string">'X'</span>).collect();
|
||
<span class="macro">assert_eq!</span>(v, [<span class="string">""</span>]);
|
||
|
||
<span class="kw">let </span>v: Vec<<span class="kw-2">&</span>str> = <span class="string">"lionXXtigerXleopard"</span>.split(<span class="string">'X'</span>).collect();
|
||
<span class="macro">assert_eq!</span>(v, [<span class="string">"lion"</span>, <span class="string">""</span>, <span class="string">"tiger"</span>, <span class="string">"leopard"</span>]);
|
||
|
||
<span class="kw">let </span>v: Vec<<span class="kw-2">&</span>str> = <span class="string">"lion::tiger::leopard"</span>.split(<span class="string">"::"</span>).collect();
|
||
<span class="macro">assert_eq!</span>(v, [<span class="string">"lion"</span>, <span class="string">"tiger"</span>, <span class="string">"leopard"</span>]);
|
||
|
||
<span class="kw">let </span>v: Vec<<span class="kw-2">&</span>str> = <span class="string">"abc1def2ghi"</span>.split(char::is_numeric).collect();
|
||
<span class="macro">assert_eq!</span>(v, [<span class="string">"abc"</span>, <span class="string">"def"</span>, <span class="string">"ghi"</span>]);
|
||
|
||
<span class="kw">let </span>v: Vec<<span class="kw-2">&</span>str> = <span class="string">"lionXtigerXleopard"</span>.split(char::is_uppercase).collect();
|
||
<span class="macro">assert_eq!</span>(v, [<span class="string">"lion"</span>, <span class="string">"tiger"</span>, <span class="string">"leopard"</span>]);</code></pre></div>
|
||
<p>If the pattern is a slice of chars, split on each occurrence of any of the characters:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>v: Vec<<span class="kw-2">&</span>str> = <span class="string">"2020-11-03 23:59"</span>.split(<span class="kw-2">&</span>[<span class="string">'-'</span>, <span class="string">' '</span>, <span class="string">':'</span>, <span class="string">'@'</span>][..]).collect();
|
||
<span class="macro">assert_eq!</span>(v, [<span class="string">"2020"</span>, <span class="string">"11"</span>, <span class="string">"03"</span>, <span class="string">"23"</span>, <span class="string">"59"</span>]);</code></pre></div>
|
||
<p>A more complex pattern, using a closure:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>v: Vec<<span class="kw-2">&</span>str> = <span class="string">"abc1defXghi"</span>.split(|c| c == <span class="string">'1' </span>|| c == <span class="string">'X'</span>).collect();
|
||
<span class="macro">assert_eq!</span>(v, [<span class="string">"abc"</span>, <span class="string">"def"</span>, <span class="string">"ghi"</span>]);</code></pre></div>
|
||
<p>If a string contains multiple contiguous separators, you will end up
|
||
with empty strings in the output:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>x = <span class="string">"||||a||b|c"</span>.to_string();
|
||
<span class="kw">let </span>d: Vec<<span class="kw">_</span>> = x.split(<span class="string">'|'</span>).collect();
|
||
|
||
<span class="macro">assert_eq!</span>(d, <span class="kw-2">&</span>[<span class="string">""</span>, <span class="string">""</span>, <span class="string">""</span>, <span class="string">""</span>, <span class="string">"a"</span>, <span class="string">""</span>, <span class="string">"b"</span>, <span class="string">"c"</span>]);</code></pre></div>
|
||
<p>Contiguous separators are separated by the empty string.</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>x = <span class="string">"(///)"</span>.to_string();
|
||
<span class="kw">let </span>d: Vec<<span class="kw">_</span>> = x.split(<span class="string">'/'</span>).collect();
|
||
|
||
<span class="macro">assert_eq!</span>(d, <span class="kw-2">&</span>[<span class="string">"("</span>, <span class="string">""</span>, <span class="string">""</span>, <span class="string">")"</span>]);</code></pre></div>
|
||
<p>Separators at the start or end of a string are neighbored
|
||
by empty strings.</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>d: Vec<<span class="kw">_</span>> = <span class="string">"010"</span>.split(<span class="string">"0"</span>).collect();
|
||
<span class="macro">assert_eq!</span>(d, <span class="kw-2">&</span>[<span class="string">""</span>, <span class="string">"1"</span>, <span class="string">""</span>]);</code></pre></div>
|
||
<p>When the empty string is used as a separator, it separates
|
||
every character in the string, along with the beginning
|
||
and end of the string.</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>f: Vec<<span class="kw">_</span>> = <span class="string">"rust"</span>.split(<span class="string">""</span>).collect();
|
||
<span class="macro">assert_eq!</span>(f, <span class="kw-2">&</span>[<span class="string">""</span>, <span class="string">"r"</span>, <span class="string">"u"</span>, <span class="string">"s"</span>, <span class="string">"t"</span>, <span class="string">""</span>]);</code></pre></div>
|
||
<p>Contiguous separators can lead to possibly surprising behavior
|
||
when whitespace is used as the separator. This code is correct:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>x = <span class="string">" a b c"</span>.to_string();
|
||
<span class="kw">let </span>d: Vec<<span class="kw">_</span>> = x.split(<span class="string">' '</span>).collect();
|
||
|
||
<span class="macro">assert_eq!</span>(d, <span class="kw-2">&</span>[<span class="string">""</span>, <span class="string">""</span>, <span class="string">""</span>, <span class="string">""</span>, <span class="string">"a"</span>, <span class="string">""</span>, <span class="string">"b"</span>, <span class="string">"c"</span>]);</code></pre></div>
|
||
<p>It does <em>not</em> give you:</p>
|
||
|
||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="macro">assert_eq!</span>(d, <span class="kw-2">&</span>[<span class="string">"a"</span>, <span class="string">"b"</span>, <span class="string">"c"</span>]);</code></pre></div>
|
||
<p>Use <a href="https://doc.rust-lang.org/nightly/std/primitive.str.html#method.split_whitespace" title="method str::split_whitespace"><code>split_whitespace</code></a> for this behavior.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.split_inclusive" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.51.0">1.51.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#1447">source</a></span><h4 class="code-header">pub fn <a href="#method.split_inclusive" class="fn">split_inclusive</a><P>(&self, pat: P) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/iter/struct.SplitInclusive.html" title="struct core::str::iter::SplitInclusive">SplitInclusive</a><'_, P><div class="where">where
|
||
P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html" title="trait core::str::pattern::Pattern">Pattern</a>,</div></h4></section></summary><div class="docblock"><p>Returns an iterator over substrings of this string slice, separated by
|
||
characters matched by a pattern.</p>
|
||
<p>Differs from the iterator produced by <code>split</code> in that <code>split_inclusive</code>
|
||
leaves the matched part as the terminator of the substring.</p>
|
||
<p>The <a href="https://doc.rust-lang.org/nightly/core/str/pattern/index.html" title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, <a href="https://doc.rust-lang.org/nightly/std/primitive.char.html" title="primitive char"><code>char</code></a>, a slice of <a href="https://doc.rust-lang.org/nightly/std/primitive.char.html" title="primitive char"><code>char</code></a>s, or a
|
||
function or closure that determines if a character matches.</p>
|
||
<h5 id="examples-26"><a class="doc-anchor" href="#examples-26">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>v: Vec<<span class="kw-2">&</span>str> = <span class="string">"Mary had a little lamb\nlittle lamb\nlittle lamb."
|
||
</span>.split_inclusive(<span class="string">'\n'</span>).collect();
|
||
<span class="macro">assert_eq!</span>(v, [<span class="string">"Mary had a little lamb\n"</span>, <span class="string">"little lamb\n"</span>, <span class="string">"little lamb."</span>]);</code></pre></div>
|
||
<p>If the last element of the string is matched,
|
||
that element will be considered the terminator of the preceding substring.
|
||
That substring will be the last item returned by the iterator.</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>v: Vec<<span class="kw-2">&</span>str> = <span class="string">"Mary had a little lamb\nlittle lamb\nlittle lamb.\n"
|
||
</span>.split_inclusive(<span class="string">'\n'</span>).collect();
|
||
<span class="macro">assert_eq!</span>(v, [<span class="string">"Mary had a little lamb\n"</span>, <span class="string">"little lamb\n"</span>, <span class="string">"little lamb.\n"</span>]);</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.rsplit" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.6.0">1.6.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#1502-1504">source</a></span><h4 class="code-header">pub fn <a href="#method.rsplit" class="fn">rsplit</a><P>(&self, pat: P) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/iter/struct.RSplit.html" title="struct core::str::iter::RSplit">RSplit</a><'_, P><div class="where">where
|
||
P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html" title="trait core::str::pattern::Pattern">Pattern</a>,
|
||
<P as <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html" title="trait core::str::pattern::Pattern">Pattern</a>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html#associatedtype.Searcher" title="type core::str::pattern::Pattern::Searcher">Searcher</a><'a>: for<'a> <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.ReverseSearcher.html" title="trait core::str::pattern::ReverseSearcher">ReverseSearcher</a><'a>,</div></h4></section></summary><div class="docblock"><p>Returns an iterator over substrings of the given string slice, separated
|
||
by characters matched by a pattern and yielded in reverse order.</p>
|
||
<p>The <a href="https://doc.rust-lang.org/nightly/core/str/pattern/index.html" title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, <a href="https://doc.rust-lang.org/nightly/std/primitive.char.html" title="primitive char"><code>char</code></a>, a slice of <a href="https://doc.rust-lang.org/nightly/std/primitive.char.html" title="primitive char"><code>char</code></a>s, or a
|
||
function or closure that determines if a character matches.</p>
|
||
<h5 id="iterator-behavior-1"><a class="doc-anchor" href="#iterator-behavior-1">§</a>Iterator behavior</h5>
|
||
<p>The returned iterator requires that the pattern supports a reverse
|
||
search, and it will be a <a href="https://doc.rust-lang.org/nightly/core/iter/traits/double_ended/trait.DoubleEndedIterator.html" title="trait core::iter::traits::double_ended::DoubleEndedIterator"><code>DoubleEndedIterator</code></a> if a forward/reverse
|
||
search yields the same elements.</p>
|
||
<p>For iterating from the front, the <a href="https://doc.rust-lang.org/nightly/std/primitive.str.html#method.split" title="method str::split"><code>split</code></a> method can be used.</p>
|
||
<h5 id="examples-27"><a class="doc-anchor" href="#examples-27">§</a>Examples</h5>
|
||
<p>Simple patterns:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>v: Vec<<span class="kw-2">&</span>str> = <span class="string">"Mary had a little lamb"</span>.rsplit(<span class="string">' '</span>).collect();
|
||
<span class="macro">assert_eq!</span>(v, [<span class="string">"lamb"</span>, <span class="string">"little"</span>, <span class="string">"a"</span>, <span class="string">"had"</span>, <span class="string">"Mary"</span>]);
|
||
|
||
<span class="kw">let </span>v: Vec<<span class="kw-2">&</span>str> = <span class="string">""</span>.rsplit(<span class="string">'X'</span>).collect();
|
||
<span class="macro">assert_eq!</span>(v, [<span class="string">""</span>]);
|
||
|
||
<span class="kw">let </span>v: Vec<<span class="kw-2">&</span>str> = <span class="string">"lionXXtigerXleopard"</span>.rsplit(<span class="string">'X'</span>).collect();
|
||
<span class="macro">assert_eq!</span>(v, [<span class="string">"leopard"</span>, <span class="string">"tiger"</span>, <span class="string">""</span>, <span class="string">"lion"</span>]);
|
||
|
||
<span class="kw">let </span>v: Vec<<span class="kw-2">&</span>str> = <span class="string">"lion::tiger::leopard"</span>.rsplit(<span class="string">"::"</span>).collect();
|
||
<span class="macro">assert_eq!</span>(v, [<span class="string">"leopard"</span>, <span class="string">"tiger"</span>, <span class="string">"lion"</span>]);</code></pre></div>
|
||
<p>A more complex pattern, using a closure:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>v: Vec<<span class="kw-2">&</span>str> = <span class="string">"abc1defXghi"</span>.rsplit(|c| c == <span class="string">'1' </span>|| c == <span class="string">'X'</span>).collect();
|
||
<span class="macro">assert_eq!</span>(v, [<span class="string">"ghi"</span>, <span class="string">"def"</span>, <span class="string">"abc"</span>]);</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.split_terminator" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.6.0">1.6.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#1551">source</a></span><h4 class="code-header">pub fn <a href="#method.split_terminator" class="fn">split_terminator</a><P>(&self, pat: P) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/iter/struct.SplitTerminator.html" title="struct core::str::iter::SplitTerminator">SplitTerminator</a><'_, P><div class="where">where
|
||
P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html" title="trait core::str::pattern::Pattern">Pattern</a>,</div></h4></section></summary><div class="docblock"><p>Returns an iterator over substrings of the given string slice, separated
|
||
by characters matched by a pattern.</p>
|
||
<p>The <a href="https://doc.rust-lang.org/nightly/core/str/pattern/index.html" title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, <a href="https://doc.rust-lang.org/nightly/std/primitive.char.html" title="primitive char"><code>char</code></a>, a slice of <a href="https://doc.rust-lang.org/nightly/std/primitive.char.html" title="primitive char"><code>char</code></a>s, or a
|
||
function or closure that determines if a character matches.</p>
|
||
<p>Equivalent to <a href="https://doc.rust-lang.org/nightly/std/primitive.str.html#method.split" title="method str::split"><code>split</code></a>, except that the trailing substring
|
||
is skipped if empty.</p>
|
||
<p>This method can be used for string data that is <em>terminated</em>,
|
||
rather than <em>separated</em> by a pattern.</p>
|
||
<h5 id="iterator-behavior-2"><a class="doc-anchor" href="#iterator-behavior-2">§</a>Iterator behavior</h5>
|
||
<p>The returned iterator will be a <a href="https://doc.rust-lang.org/nightly/core/iter/traits/double_ended/trait.DoubleEndedIterator.html" title="trait core::iter::traits::double_ended::DoubleEndedIterator"><code>DoubleEndedIterator</code></a> if the pattern
|
||
allows a reverse search and forward/reverse search yields the same
|
||
elements. This is true for, e.g., <a href="https://doc.rust-lang.org/nightly/std/primitive.char.html" title="primitive char"><code>char</code></a>, but not for <code>&str</code>.</p>
|
||
<p>If the pattern allows a reverse search but its results might differ
|
||
from a forward search, the <a href="https://doc.rust-lang.org/nightly/std/primitive.str.html#method.rsplit_terminator" title="method str::rsplit_terminator"><code>rsplit_terminator</code></a> method can be used.</p>
|
||
<h5 id="examples-28"><a class="doc-anchor" href="#examples-28">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>v: Vec<<span class="kw-2">&</span>str> = <span class="string">"A.B."</span>.split_terminator(<span class="string">'.'</span>).collect();
|
||
<span class="macro">assert_eq!</span>(v, [<span class="string">"A"</span>, <span class="string">"B"</span>]);
|
||
|
||
<span class="kw">let </span>v: Vec<<span class="kw-2">&</span>str> = <span class="string">"A..B.."</span>.split_terminator(<span class="string">"."</span>).collect();
|
||
<span class="macro">assert_eq!</span>(v, [<span class="string">"A"</span>, <span class="string">""</span>, <span class="string">"B"</span>, <span class="string">""</span>]);
|
||
|
||
<span class="kw">let </span>v: Vec<<span class="kw-2">&</span>str> = <span class="string">"A.B:C.D"</span>.split_terminator(<span class="kw-2">&</span>[<span class="string">'.'</span>, <span class="string">':'</span>][..]).collect();
|
||
<span class="macro">assert_eq!</span>(v, [<span class="string">"A"</span>, <span class="string">"B"</span>, <span class="string">"C"</span>, <span class="string">"D"</span>]);</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.rsplit_terminator" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.6.0">1.6.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#1597-1599">source</a></span><h4 class="code-header">pub fn <a href="#method.rsplit_terminator" class="fn">rsplit_terminator</a><P>(&self, pat: P) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/iter/struct.RSplitTerminator.html" title="struct core::str::iter::RSplitTerminator">RSplitTerminator</a><'_, P><div class="where">where
|
||
P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html" title="trait core::str::pattern::Pattern">Pattern</a>,
|
||
<P as <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html" title="trait core::str::pattern::Pattern">Pattern</a>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html#associatedtype.Searcher" title="type core::str::pattern::Pattern::Searcher">Searcher</a><'a>: for<'a> <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.ReverseSearcher.html" title="trait core::str::pattern::ReverseSearcher">ReverseSearcher</a><'a>,</div></h4></section></summary><div class="docblock"><p>Returns an iterator over substrings of <code>self</code>, separated by characters
|
||
matched by a pattern and yielded in reverse order.</p>
|
||
<p>The <a href="https://doc.rust-lang.org/nightly/core/str/pattern/index.html" title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, <a href="https://doc.rust-lang.org/nightly/std/primitive.char.html" title="primitive char"><code>char</code></a>, a slice of <a href="https://doc.rust-lang.org/nightly/std/primitive.char.html" title="primitive char"><code>char</code></a>s, or a
|
||
function or closure that determines if a character matches.</p>
|
||
<p>Equivalent to <a href="https://doc.rust-lang.org/nightly/std/primitive.str.html#method.split" title="method str::split"><code>split</code></a>, except that the trailing substring is
|
||
skipped if empty.</p>
|
||
<p>This method can be used for string data that is <em>terminated</em>,
|
||
rather than <em>separated</em> by a pattern.</p>
|
||
<h5 id="iterator-behavior-3"><a class="doc-anchor" href="#iterator-behavior-3">§</a>Iterator behavior</h5>
|
||
<p>The returned iterator requires that the pattern supports a
|
||
reverse search, and it will be double ended if a forward/reverse
|
||
search yields the same elements.</p>
|
||
<p>For iterating from the front, the <a href="https://doc.rust-lang.org/nightly/std/primitive.str.html#method.split_terminator" title="method str::split_terminator"><code>split_terminator</code></a> method can be
|
||
used.</p>
|
||
<h5 id="examples-29"><a class="doc-anchor" href="#examples-29">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>v: Vec<<span class="kw-2">&</span>str> = <span class="string">"A.B."</span>.rsplit_terminator(<span class="string">'.'</span>).collect();
|
||
<span class="macro">assert_eq!</span>(v, [<span class="string">"B"</span>, <span class="string">"A"</span>]);
|
||
|
||
<span class="kw">let </span>v: Vec<<span class="kw-2">&</span>str> = <span class="string">"A..B.."</span>.rsplit_terminator(<span class="string">"."</span>).collect();
|
||
<span class="macro">assert_eq!</span>(v, [<span class="string">""</span>, <span class="string">"B"</span>, <span class="string">""</span>, <span class="string">"A"</span>]);
|
||
|
||
<span class="kw">let </span>v: Vec<<span class="kw-2">&</span>str> = <span class="string">"A.B:C.D"</span>.rsplit_terminator(<span class="kw-2">&</span>[<span class="string">'.'</span>, <span class="string">':'</span>][..]).collect();
|
||
<span class="macro">assert_eq!</span>(v, [<span class="string">"D"</span>, <span class="string">"C"</span>, <span class="string">"B"</span>, <span class="string">"A"</span>]);</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.splitn" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.6.0">1.6.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#1652">source</a></span><h4 class="code-header">pub fn <a href="#method.splitn" class="fn">splitn</a><P>(&self, n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, pat: P) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/iter/struct.SplitN.html" title="struct core::str::iter::SplitN">SplitN</a><'_, P><div class="where">where
|
||
P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html" title="trait core::str::pattern::Pattern">Pattern</a>,</div></h4></section></summary><div class="docblock"><p>Returns an iterator over substrings of the given string slice, separated
|
||
by a pattern, restricted to returning at most <code>n</code> items.</p>
|
||
<p>If <code>n</code> substrings are returned, the last substring (the <code>n</code>th substring)
|
||
will contain the remainder of the string.</p>
|
||
<p>The <a href="https://doc.rust-lang.org/nightly/core/str/pattern/index.html" title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, <a href="https://doc.rust-lang.org/nightly/std/primitive.char.html" title="primitive char"><code>char</code></a>, a slice of <a href="https://doc.rust-lang.org/nightly/std/primitive.char.html" title="primitive char"><code>char</code></a>s, or a
|
||
function or closure that determines if a character matches.</p>
|
||
<h5 id="iterator-behavior-4"><a class="doc-anchor" href="#iterator-behavior-4">§</a>Iterator behavior</h5>
|
||
<p>The returned iterator will not be double ended, because it is
|
||
not efficient to support.</p>
|
||
<p>If the pattern allows a reverse search, the <a href="https://doc.rust-lang.org/nightly/std/primitive.str.html#method.rsplitn" title="method str::rsplitn"><code>rsplitn</code></a> method can be
|
||
used.</p>
|
||
<h5 id="examples-30"><a class="doc-anchor" href="#examples-30">§</a>Examples</h5>
|
||
<p>Simple patterns:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>v: Vec<<span class="kw-2">&</span>str> = <span class="string">"Mary had a little lambda"</span>.splitn(<span class="number">3</span>, <span class="string">' '</span>).collect();
|
||
<span class="macro">assert_eq!</span>(v, [<span class="string">"Mary"</span>, <span class="string">"had"</span>, <span class="string">"a little lambda"</span>]);
|
||
|
||
<span class="kw">let </span>v: Vec<<span class="kw-2">&</span>str> = <span class="string">"lionXXtigerXleopard"</span>.splitn(<span class="number">3</span>, <span class="string">"X"</span>).collect();
|
||
<span class="macro">assert_eq!</span>(v, [<span class="string">"lion"</span>, <span class="string">""</span>, <span class="string">"tigerXleopard"</span>]);
|
||
|
||
<span class="kw">let </span>v: Vec<<span class="kw-2">&</span>str> = <span class="string">"abcXdef"</span>.splitn(<span class="number">1</span>, <span class="string">'X'</span>).collect();
|
||
<span class="macro">assert_eq!</span>(v, [<span class="string">"abcXdef"</span>]);
|
||
|
||
<span class="kw">let </span>v: Vec<<span class="kw-2">&</span>str> = <span class="string">""</span>.splitn(<span class="number">1</span>, <span class="string">'X'</span>).collect();
|
||
<span class="macro">assert_eq!</span>(v, [<span class="string">""</span>]);</code></pre></div>
|
||
<p>A more complex pattern, using a closure:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>v: Vec<<span class="kw-2">&</span>str> = <span class="string">"abc1defXghi"</span>.splitn(<span class="number">2</span>, |c| c == <span class="string">'1' </span>|| c == <span class="string">'X'</span>).collect();
|
||
<span class="macro">assert_eq!</span>(v, [<span class="string">"abc"</span>, <span class="string">"defXghi"</span>]);</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.rsplitn" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.6.0">1.6.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#1701-1703">source</a></span><h4 class="code-header">pub fn <a href="#method.rsplitn" class="fn">rsplitn</a><P>(&self, n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, pat: P) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/iter/struct.RSplitN.html" title="struct core::str::iter::RSplitN">RSplitN</a><'_, P><div class="where">where
|
||
P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html" title="trait core::str::pattern::Pattern">Pattern</a>,
|
||
<P as <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html" title="trait core::str::pattern::Pattern">Pattern</a>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html#associatedtype.Searcher" title="type core::str::pattern::Pattern::Searcher">Searcher</a><'a>: for<'a> <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.ReverseSearcher.html" title="trait core::str::pattern::ReverseSearcher">ReverseSearcher</a><'a>,</div></h4></section></summary><div class="docblock"><p>Returns an iterator over substrings of this string slice, separated by a
|
||
pattern, starting from the end of the string, restricted to returning at
|
||
most <code>n</code> items.</p>
|
||
<p>If <code>n</code> substrings are returned, the last substring (the <code>n</code>th substring)
|
||
will contain the remainder of the string.</p>
|
||
<p>The <a href="https://doc.rust-lang.org/nightly/core/str/pattern/index.html" title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, <a href="https://doc.rust-lang.org/nightly/std/primitive.char.html" title="primitive char"><code>char</code></a>, a slice of <a href="https://doc.rust-lang.org/nightly/std/primitive.char.html" title="primitive char"><code>char</code></a>s, or a
|
||
function or closure that determines if a character matches.</p>
|
||
<h5 id="iterator-behavior-5"><a class="doc-anchor" href="#iterator-behavior-5">§</a>Iterator behavior</h5>
|
||
<p>The returned iterator will not be double ended, because it is not
|
||
efficient to support.</p>
|
||
<p>For splitting from the front, the <a href="https://doc.rust-lang.org/nightly/std/primitive.str.html#method.splitn" title="method str::splitn"><code>splitn</code></a> method can be used.</p>
|
||
<h5 id="examples-31"><a class="doc-anchor" href="#examples-31">§</a>Examples</h5>
|
||
<p>Simple patterns:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>v: Vec<<span class="kw-2">&</span>str> = <span class="string">"Mary had a little lamb"</span>.rsplitn(<span class="number">3</span>, <span class="string">' '</span>).collect();
|
||
<span class="macro">assert_eq!</span>(v, [<span class="string">"lamb"</span>, <span class="string">"little"</span>, <span class="string">"Mary had a"</span>]);
|
||
|
||
<span class="kw">let </span>v: Vec<<span class="kw-2">&</span>str> = <span class="string">"lionXXtigerXleopard"</span>.rsplitn(<span class="number">3</span>, <span class="string">'X'</span>).collect();
|
||
<span class="macro">assert_eq!</span>(v, [<span class="string">"leopard"</span>, <span class="string">"tiger"</span>, <span class="string">"lionX"</span>]);
|
||
|
||
<span class="kw">let </span>v: Vec<<span class="kw-2">&</span>str> = <span class="string">"lion::tiger::leopard"</span>.rsplitn(<span class="number">2</span>, <span class="string">"::"</span>).collect();
|
||
<span class="macro">assert_eq!</span>(v, [<span class="string">"leopard"</span>, <span class="string">"lion::tiger"</span>]);</code></pre></div>
|
||
<p>A more complex pattern, using a closure:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>v: Vec<<span class="kw-2">&</span>str> = <span class="string">"abc1defXghi"</span>.rsplitn(<span class="number">2</span>, |c| c == <span class="string">'1' </span>|| c == <span class="string">'X'</span>).collect();
|
||
<span class="macro">assert_eq!</span>(v, [<span class="string">"ghi"</span>, <span class="string">"abc1def"</span>]);</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.split_once" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.52.0">1.52.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#1721">source</a></span><h4 class="code-header">pub fn <a href="#method.split_once" class="fn">split_once</a><P>(&self, delimiter: P) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><(&<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>)><div class="where">where
|
||
P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html" title="trait core::str::pattern::Pattern">Pattern</a>,</div></h4></section></summary><div class="docblock"><p>Splits the string on the first occurrence of the specified delimiter and
|
||
returns prefix before delimiter and suffix after delimiter.</p>
|
||
<h5 id="examples-32"><a class="doc-anchor" href="#examples-32">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">assert_eq!</span>(<span class="string">"cfg"</span>.split_once(<span class="string">'='</span>), <span class="prelude-val">None</span>);
|
||
<span class="macro">assert_eq!</span>(<span class="string">"cfg="</span>.split_once(<span class="string">'='</span>), <span class="prelude-val">Some</span>((<span class="string">"cfg"</span>, <span class="string">""</span>)));
|
||
<span class="macro">assert_eq!</span>(<span class="string">"cfg=foo"</span>.split_once(<span class="string">'='</span>), <span class="prelude-val">Some</span>((<span class="string">"cfg"</span>, <span class="string">"foo"</span>)));
|
||
<span class="macro">assert_eq!</span>(<span class="string">"cfg=foo=bar"</span>.split_once(<span class="string">'='</span>), <span class="prelude-val">Some</span>((<span class="string">"cfg"</span>, <span class="string">"foo=bar"</span>)));</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.rsplit_once" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.52.0">1.52.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#1739-1741">source</a></span><h4 class="code-header">pub fn <a href="#method.rsplit_once" class="fn">rsplit_once</a><P>(&self, delimiter: P) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><(&<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>)><div class="where">where
|
||
P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html" title="trait core::str::pattern::Pattern">Pattern</a>,
|
||
<P as <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html" title="trait core::str::pattern::Pattern">Pattern</a>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html#associatedtype.Searcher" title="type core::str::pattern::Pattern::Searcher">Searcher</a><'a>: for<'a> <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.ReverseSearcher.html" title="trait core::str::pattern::ReverseSearcher">ReverseSearcher</a><'a>,</div></h4></section></summary><div class="docblock"><p>Splits the string on the last occurrence of the specified delimiter and
|
||
returns prefix before delimiter and suffix after delimiter.</p>
|
||
<h5 id="examples-33"><a class="doc-anchor" href="#examples-33">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">assert_eq!</span>(<span class="string">"cfg"</span>.rsplit_once(<span class="string">'='</span>), <span class="prelude-val">None</span>);
|
||
<span class="macro">assert_eq!</span>(<span class="string">"cfg=foo"</span>.rsplit_once(<span class="string">'='</span>), <span class="prelude-val">Some</span>((<span class="string">"cfg"</span>, <span class="string">"foo"</span>)));
|
||
<span class="macro">assert_eq!</span>(<span class="string">"cfg=foo=bar"</span>.rsplit_once(<span class="string">'='</span>), <span class="prelude-val">Some</span>((<span class="string">"cfg=foo"</span>, <span class="string">"bar"</span>)));</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.matches" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.6.0">1.6.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#1779">source</a></span><h4 class="code-header">pub fn <a href="#method.matches" class="fn">matches</a><P>(&self, pat: P) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/iter/struct.Matches.html" title="struct core::str::iter::Matches">Matches</a><'_, P><div class="where">where
|
||
P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html" title="trait core::str::pattern::Pattern">Pattern</a>,</div></h4></section></summary><div class="docblock"><p>Returns an iterator over the disjoint matches of a pattern within the
|
||
given string slice.</p>
|
||
<p>The <a href="https://doc.rust-lang.org/nightly/core/str/pattern/index.html" title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, <a href="https://doc.rust-lang.org/nightly/std/primitive.char.html" title="primitive char"><code>char</code></a>, a slice of <a href="https://doc.rust-lang.org/nightly/std/primitive.char.html" title="primitive char"><code>char</code></a>s, or a
|
||
function or closure that determines if a character matches.</p>
|
||
<h5 id="iterator-behavior-6"><a class="doc-anchor" href="#iterator-behavior-6">§</a>Iterator behavior</h5>
|
||
<p>The returned iterator will be a <a href="https://doc.rust-lang.org/nightly/core/iter/traits/double_ended/trait.DoubleEndedIterator.html" title="trait core::iter::traits::double_ended::DoubleEndedIterator"><code>DoubleEndedIterator</code></a> if the pattern
|
||
allows a reverse search and forward/reverse search yields the same
|
||
elements. This is true for, e.g., <a href="https://doc.rust-lang.org/nightly/std/primitive.char.html" title="primitive char"><code>char</code></a>, but not for <code>&str</code>.</p>
|
||
<p>If the pattern allows a reverse search but its results might differ
|
||
from a forward search, the <a href="https://doc.rust-lang.org/nightly/std/primitive.str.html#method.rmatches" title="method str::rmatches"><code>rmatches</code></a> method can be used.</p>
|
||
<h5 id="examples-34"><a class="doc-anchor" href="#examples-34">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>v: Vec<<span class="kw-2">&</span>str> = <span class="string">"abcXXXabcYYYabc"</span>.matches(<span class="string">"abc"</span>).collect();
|
||
<span class="macro">assert_eq!</span>(v, [<span class="string">"abc"</span>, <span class="string">"abc"</span>, <span class="string">"abc"</span>]);
|
||
|
||
<span class="kw">let </span>v: Vec<<span class="kw-2">&</span>str> = <span class="string">"1abc2abc3"</span>.matches(char::is_numeric).collect();
|
||
<span class="macro">assert_eq!</span>(v, [<span class="string">"1"</span>, <span class="string">"2"</span>, <span class="string">"3"</span>]);</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.rmatches" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.6.0">1.6.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#1813-1815">source</a></span><h4 class="code-header">pub fn <a href="#method.rmatches" class="fn">rmatches</a><P>(&self, pat: P) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/iter/struct.RMatches.html" title="struct core::str::iter::RMatches">RMatches</a><'_, P><div class="where">where
|
||
P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html" title="trait core::str::pattern::Pattern">Pattern</a>,
|
||
<P as <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html" title="trait core::str::pattern::Pattern">Pattern</a>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html#associatedtype.Searcher" title="type core::str::pattern::Pattern::Searcher">Searcher</a><'a>: for<'a> <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.ReverseSearcher.html" title="trait core::str::pattern::ReverseSearcher">ReverseSearcher</a><'a>,</div></h4></section></summary><div class="docblock"><p>Returns an iterator over the disjoint matches of a pattern within this
|
||
string slice, yielded in reverse order.</p>
|
||
<p>The <a href="https://doc.rust-lang.org/nightly/core/str/pattern/index.html" title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, <a href="https://doc.rust-lang.org/nightly/std/primitive.char.html" title="primitive char"><code>char</code></a>, a slice of <a href="https://doc.rust-lang.org/nightly/std/primitive.char.html" title="primitive char"><code>char</code></a>s, or a
|
||
function or closure that determines if a character matches.</p>
|
||
<h5 id="iterator-behavior-7"><a class="doc-anchor" href="#iterator-behavior-7">§</a>Iterator behavior</h5>
|
||
<p>The returned iterator requires that the pattern supports a reverse
|
||
search, and it will be a <a href="https://doc.rust-lang.org/nightly/core/iter/traits/double_ended/trait.DoubleEndedIterator.html" title="trait core::iter::traits::double_ended::DoubleEndedIterator"><code>DoubleEndedIterator</code></a> if a forward/reverse
|
||
search yields the same elements.</p>
|
||
<p>For iterating from the front, the <a href="https://doc.rust-lang.org/nightly/std/primitive.str.html#method.matches" title="method str::matches"><code>matches</code></a> method can be used.</p>
|
||
<h5 id="examples-35"><a class="doc-anchor" href="#examples-35">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>v: Vec<<span class="kw-2">&</span>str> = <span class="string">"abcXXXabcYYYabc"</span>.rmatches(<span class="string">"abc"</span>).collect();
|
||
<span class="macro">assert_eq!</span>(v, [<span class="string">"abc"</span>, <span class="string">"abc"</span>, <span class="string">"abc"</span>]);
|
||
|
||
<span class="kw">let </span>v: Vec<<span class="kw-2">&</span>str> = <span class="string">"1abc2abc3"</span>.rmatches(char::is_numeric).collect();
|
||
<span class="macro">assert_eq!</span>(v, [<span class="string">"3"</span>, <span class="string">"2"</span>, <span class="string">"1"</span>]);</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.match_indices" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.6.0">1.6.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#1857">source</a></span><h4 class="code-header">pub fn <a href="#method.match_indices" class="fn">match_indices</a><P>(&self, pat: P) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/iter/struct.MatchIndices.html" title="struct core::str::iter::MatchIndices">MatchIndices</a><'_, P><div class="where">where
|
||
P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html" title="trait core::str::pattern::Pattern">Pattern</a>,</div></h4></section></summary><div class="docblock"><p>Returns an iterator over the disjoint matches of a pattern within this string
|
||
slice as well as the index that the match starts at.</p>
|
||
<p>For matches of <code>pat</code> within <code>self</code> that overlap, only the indices
|
||
corresponding to the first match are returned.</p>
|
||
<p>The <a href="https://doc.rust-lang.org/nightly/core/str/pattern/index.html" title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, <a href="https://doc.rust-lang.org/nightly/std/primitive.char.html" title="primitive char"><code>char</code></a>, a slice of <a href="https://doc.rust-lang.org/nightly/std/primitive.char.html" title="primitive char"><code>char</code></a>s, or a
|
||
function or closure that determines if a character matches.</p>
|
||
<h5 id="iterator-behavior-8"><a class="doc-anchor" href="#iterator-behavior-8">§</a>Iterator behavior</h5>
|
||
<p>The returned iterator will be a <a href="https://doc.rust-lang.org/nightly/core/iter/traits/double_ended/trait.DoubleEndedIterator.html" title="trait core::iter::traits::double_ended::DoubleEndedIterator"><code>DoubleEndedIterator</code></a> if the pattern
|
||
allows a reverse search and forward/reverse search yields the same
|
||
elements. This is true for, e.g., <a href="https://doc.rust-lang.org/nightly/std/primitive.char.html" title="primitive char"><code>char</code></a>, but not for <code>&str</code>.</p>
|
||
<p>If the pattern allows a reverse search but its results might differ
|
||
from a forward search, the <a href="https://doc.rust-lang.org/nightly/std/primitive.str.html#method.rmatch_indices" title="method str::rmatch_indices"><code>rmatch_indices</code></a> method can be used.</p>
|
||
<h5 id="examples-36"><a class="doc-anchor" href="#examples-36">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>v: Vec<<span class="kw">_</span>> = <span class="string">"abcXXXabcYYYabc"</span>.match_indices(<span class="string">"abc"</span>).collect();
|
||
<span class="macro">assert_eq!</span>(v, [(<span class="number">0</span>, <span class="string">"abc"</span>), (<span class="number">6</span>, <span class="string">"abc"</span>), (<span class="number">12</span>, <span class="string">"abc"</span>)]);
|
||
|
||
<span class="kw">let </span>v: Vec<<span class="kw">_</span>> = <span class="string">"1abcabc2"</span>.match_indices(<span class="string">"abc"</span>).collect();
|
||
<span class="macro">assert_eq!</span>(v, [(<span class="number">1</span>, <span class="string">"abc"</span>), (<span class="number">4</span>, <span class="string">"abc"</span>)]);
|
||
|
||
<span class="kw">let </span>v: Vec<<span class="kw">_</span>> = <span class="string">"ababa"</span>.match_indices(<span class="string">"aba"</span>).collect();
|
||
<span class="macro">assert_eq!</span>(v, [(<span class="number">0</span>, <span class="string">"aba"</span>)]); <span class="comment">// only the first `aba`</span></code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.rmatch_indices" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.6.0">1.6.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#1897-1899">source</a></span><h4 class="code-header">pub fn <a href="#method.rmatch_indices" class="fn">rmatch_indices</a><P>(&self, pat: P) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/iter/struct.RMatchIndices.html" title="struct core::str::iter::RMatchIndices">RMatchIndices</a><'_, P><div class="where">where
|
||
P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html" title="trait core::str::pattern::Pattern">Pattern</a>,
|
||
<P as <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html" title="trait core::str::pattern::Pattern">Pattern</a>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html#associatedtype.Searcher" title="type core::str::pattern::Pattern::Searcher">Searcher</a><'a>: for<'a> <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.ReverseSearcher.html" title="trait core::str::pattern::ReverseSearcher">ReverseSearcher</a><'a>,</div></h4></section></summary><div class="docblock"><p>Returns an iterator over the disjoint matches of a pattern within <code>self</code>,
|
||
yielded in reverse order along with the index of the match.</p>
|
||
<p>For matches of <code>pat</code> within <code>self</code> that overlap, only the indices
|
||
corresponding to the last match are returned.</p>
|
||
<p>The <a href="https://doc.rust-lang.org/nightly/core/str/pattern/index.html" title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, <a href="https://doc.rust-lang.org/nightly/std/primitive.char.html" title="primitive char"><code>char</code></a>, a slice of <a href="https://doc.rust-lang.org/nightly/std/primitive.char.html" title="primitive char"><code>char</code></a>s, or a
|
||
function or closure that determines if a character matches.</p>
|
||
<h5 id="iterator-behavior-9"><a class="doc-anchor" href="#iterator-behavior-9">§</a>Iterator behavior</h5>
|
||
<p>The returned iterator requires that the pattern supports a reverse
|
||
search, and it will be a <a href="https://doc.rust-lang.org/nightly/core/iter/traits/double_ended/trait.DoubleEndedIterator.html" title="trait core::iter::traits::double_ended::DoubleEndedIterator"><code>DoubleEndedIterator</code></a> if a forward/reverse
|
||
search yields the same elements.</p>
|
||
<p>For iterating from the front, the <a href="https://doc.rust-lang.org/nightly/std/primitive.str.html#method.match_indices" title="method str::match_indices"><code>match_indices</code></a> method can be used.</p>
|
||
<h5 id="examples-37"><a class="doc-anchor" href="#examples-37">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>v: Vec<<span class="kw">_</span>> = <span class="string">"abcXXXabcYYYabc"</span>.rmatch_indices(<span class="string">"abc"</span>).collect();
|
||
<span class="macro">assert_eq!</span>(v, [(<span class="number">12</span>, <span class="string">"abc"</span>), (<span class="number">6</span>, <span class="string">"abc"</span>), (<span class="number">0</span>, <span class="string">"abc"</span>)]);
|
||
|
||
<span class="kw">let </span>v: Vec<<span class="kw">_</span>> = <span class="string">"1abcabc2"</span>.rmatch_indices(<span class="string">"abc"</span>).collect();
|
||
<span class="macro">assert_eq!</span>(v, [(<span class="number">4</span>, <span class="string">"abc"</span>), (<span class="number">1</span>, <span class="string">"abc"</span>)]);
|
||
|
||
<span class="kw">let </span>v: Vec<<span class="kw">_</span>> = <span class="string">"ababa"</span>.rmatch_indices(<span class="string">"aba"</span>).collect();
|
||
<span class="macro">assert_eq!</span>(v, [(<span class="number">2</span>, <span class="string">"aba"</span>)]); <span class="comment">// only the last `aba`</span></code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.trim" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.6.0">1.6.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#1921">source</a></span><h4 class="code-header">pub fn <a href="#method.trim" class="fn">trim</a>(&self) -> &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></h4></section></summary><div class="docblock"><p>Returns a string slice with leading and trailing whitespace removed.</p>
|
||
<p>‘Whitespace’ is defined according to the terms of the Unicode Derived
|
||
Core Property <code>White_Space</code>, which includes newlines.</p>
|
||
<h5 id="examples-38"><a class="doc-anchor" href="#examples-38">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>s = <span class="string">"\n Hello\tworld\t\n"</span>;
|
||
|
||
<span class="macro">assert_eq!</span>(<span class="string">"Hello\tworld"</span>, s.trim());</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.trim_start" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.30.0">1.30.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#1960">source</a></span><h4 class="code-header">pub fn <a href="#method.trim_start" class="fn">trim_start</a>(&self) -> &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></h4></section></summary><div class="docblock"><p>Returns a string slice with leading whitespace removed.</p>
|
||
<p>‘Whitespace’ is defined according to the terms of the Unicode Derived
|
||
Core Property <code>White_Space</code>, which includes newlines.</p>
|
||
<h5 id="text-directionality"><a class="doc-anchor" href="#text-directionality">§</a>Text directionality</h5>
|
||
<p>A string is a sequence of bytes. <code>start</code> in this context means the first
|
||
position of that byte string; for a left-to-right language like English or
|
||
Russian, this will be left side, and for right-to-left languages like
|
||
Arabic or Hebrew, this will be the right side.</p>
|
||
<h5 id="examples-39"><a class="doc-anchor" href="#examples-39">§</a>Examples</h5>
|
||
<p>Basic usage:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>s = <span class="string">"\n Hello\tworld\t\n"</span>;
|
||
<span class="macro">assert_eq!</span>(<span class="string">"Hello\tworld\t\n"</span>, s.trim_start());</code></pre></div>
|
||
<p>Directionality:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>s = <span class="string">" English "</span>;
|
||
<span class="macro">assert!</span>(<span class="prelude-val">Some</span>(<span class="string">'E'</span>) == s.trim_start().chars().next());
|
||
|
||
<span class="kw">let </span>s = <span class="string">" עברית "</span>;
|
||
<span class="macro">assert!</span>(<span class="prelude-val">Some</span>(<span class="string">'ע'</span>) == s.trim_start().chars().next());</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.trim_end" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.30.0">1.30.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#1999">source</a></span><h4 class="code-header">pub fn <a href="#method.trim_end" class="fn">trim_end</a>(&self) -> &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></h4></section></summary><div class="docblock"><p>Returns a string slice with trailing whitespace removed.</p>
|
||
<p>‘Whitespace’ is defined according to the terms of the Unicode Derived
|
||
Core Property <code>White_Space</code>, which includes newlines.</p>
|
||
<h5 id="text-directionality-1"><a class="doc-anchor" href="#text-directionality-1">§</a>Text directionality</h5>
|
||
<p>A string is a sequence of bytes. <code>end</code> in this context means the last
|
||
position of that byte string; for a left-to-right language like English or
|
||
Russian, this will be right side, and for right-to-left languages like
|
||
Arabic or Hebrew, this will be the left side.</p>
|
||
<h5 id="examples-40"><a class="doc-anchor" href="#examples-40">§</a>Examples</h5>
|
||
<p>Basic usage:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>s = <span class="string">"\n Hello\tworld\t\n"</span>;
|
||
<span class="macro">assert_eq!</span>(<span class="string">"\n Hello\tworld"</span>, s.trim_end());</code></pre></div>
|
||
<p>Directionality:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>s = <span class="string">" English "</span>;
|
||
<span class="macro">assert!</span>(<span class="prelude-val">Some</span>(<span class="string">'h'</span>) == s.trim_end().chars().rev().next());
|
||
|
||
<span class="kw">let </span>s = <span class="string">" עברית "</span>;
|
||
<span class="macro">assert!</span>(<span class="prelude-val">Some</span>(<span class="string">'ת'</span>) == s.trim_end().chars().rev().next());</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.trim_left" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.6.0">1.6.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#2039">source</a></span><h4 class="code-header">pub fn <a href="#method.trim_left" class="fn">trim_left</a>(&self) -> &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></h4></section><span class="item-info"><div class="stab deprecated"><span class="emoji">👎</span><span>Deprecated since 1.33.0: superseded by <code>trim_start</code></span></div></span></summary><div class="docblock"><p>Returns a string slice with leading whitespace removed.</p>
|
||
<p>‘Whitespace’ is defined according to the terms of the Unicode Derived
|
||
Core Property <code>White_Space</code>.</p>
|
||
<h5 id="text-directionality-2"><a class="doc-anchor" href="#text-directionality-2">§</a>Text directionality</h5>
|
||
<p>A string is a sequence of bytes. ‘Left’ in this context means the first
|
||
position of that byte string; for a language like Arabic or Hebrew
|
||
which are ‘right to left’ rather than ‘left to right’, this will be
|
||
the <em>right</em> side, not the left.</p>
|
||
<h5 id="examples-41"><a class="doc-anchor" href="#examples-41">§</a>Examples</h5>
|
||
<p>Basic usage:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>s = <span class="string">" Hello\tworld\t"</span>;
|
||
|
||
<span class="macro">assert_eq!</span>(<span class="string">"Hello\tworld\t"</span>, s.trim_left());</code></pre></div>
|
||
<p>Directionality:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>s = <span class="string">" English"</span>;
|
||
<span class="macro">assert!</span>(<span class="prelude-val">Some</span>(<span class="string">'E'</span>) == s.trim_left().chars().next());
|
||
|
||
<span class="kw">let </span>s = <span class="string">" עברית"</span>;
|
||
<span class="macro">assert!</span>(<span class="prelude-val">Some</span>(<span class="string">'ע'</span>) == s.trim_left().chars().next());</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.trim_right" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.6.0">1.6.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#2079">source</a></span><h4 class="code-header">pub fn <a href="#method.trim_right" class="fn">trim_right</a>(&self) -> &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></h4></section><span class="item-info"><div class="stab deprecated"><span class="emoji">👎</span><span>Deprecated since 1.33.0: superseded by <code>trim_end</code></span></div></span></summary><div class="docblock"><p>Returns a string slice with trailing whitespace removed.</p>
|
||
<p>‘Whitespace’ is defined according to the terms of the Unicode Derived
|
||
Core Property <code>White_Space</code>.</p>
|
||
<h5 id="text-directionality-3"><a class="doc-anchor" href="#text-directionality-3">§</a>Text directionality</h5>
|
||
<p>A string is a sequence of bytes. ‘Right’ in this context means the last
|
||
position of that byte string; for a language like Arabic or Hebrew
|
||
which are ‘right to left’ rather than ‘left to right’, this will be
|
||
the <em>left</em> side, not the right.</p>
|
||
<h5 id="examples-42"><a class="doc-anchor" href="#examples-42">§</a>Examples</h5>
|
||
<p>Basic usage:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>s = <span class="string">" Hello\tworld\t"</span>;
|
||
|
||
<span class="macro">assert_eq!</span>(<span class="string">" Hello\tworld"</span>, s.trim_right());</code></pre></div>
|
||
<p>Directionality:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>s = <span class="string">"English "</span>;
|
||
<span class="macro">assert!</span>(<span class="prelude-val">Some</span>(<span class="string">'h'</span>) == s.trim_right().chars().rev().next());
|
||
|
||
<span class="kw">let </span>s = <span class="string">"עברית "</span>;
|
||
<span class="macro">assert!</span>(<span class="prelude-val">Some</span>(<span class="string">'ת'</span>) == s.trim_right().chars().rev().next());</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.trim_matches" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.6.0">1.6.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#2112-2114">source</a></span><h4 class="code-header">pub fn <a href="#method.trim_matches" class="fn">trim_matches</a><P>(&self, pat: P) -> &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a><div class="where">where
|
||
P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html" title="trait core::str::pattern::Pattern">Pattern</a>,
|
||
<P as <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html" title="trait core::str::pattern::Pattern">Pattern</a>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html#associatedtype.Searcher" title="type core::str::pattern::Pattern::Searcher">Searcher</a><'a>: for<'a> <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.DoubleEndedSearcher.html" title="trait core::str::pattern::DoubleEndedSearcher">DoubleEndedSearcher</a><'a>,</div></h4></section></summary><div class="docblock"><p>Returns a string slice with all prefixes and suffixes that match a
|
||
pattern repeatedly removed.</p>
|
||
<p>The <a href="https://doc.rust-lang.org/nightly/core/str/pattern/index.html" title="mod core::str::pattern">pattern</a> can be a <a href="https://doc.rust-lang.org/nightly/std/primitive.char.html" title="primitive char"><code>char</code></a>, a slice of <a href="https://doc.rust-lang.org/nightly/std/primitive.char.html" title="primitive char"><code>char</code></a>s, or a function
|
||
or closure that determines if a character matches.</p>
|
||
<h5 id="examples-43"><a class="doc-anchor" href="#examples-43">§</a>Examples</h5>
|
||
<p>Simple patterns:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">assert_eq!</span>(<span class="string">"11foo1bar11"</span>.trim_matches(<span class="string">'1'</span>), <span class="string">"foo1bar"</span>);
|
||
<span class="macro">assert_eq!</span>(<span class="string">"123foo1bar123"</span>.trim_matches(char::is_numeric), <span class="string">"foo1bar"</span>);
|
||
|
||
<span class="kw">let </span>x: <span class="kw-2">&</span>[<span class="kw">_</span>] = <span class="kw-2">&</span>[<span class="string">'1'</span>, <span class="string">'2'</span>];
|
||
<span class="macro">assert_eq!</span>(<span class="string">"12foo1bar12"</span>.trim_matches(x), <span class="string">"foo1bar"</span>);</code></pre></div>
|
||
<p>A more complex pattern, using a closure:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">assert_eq!</span>(<span class="string">"1foo1barXX"</span>.trim_matches(|c| c == <span class="string">'1' </span>|| c == <span class="string">'X'</span>), <span class="string">"foo1bar"</span>);</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.trim_start_matches" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.30.0">1.30.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#2159">source</a></span><h4 class="code-header">pub fn <a href="#method.trim_start_matches" class="fn">trim_start_matches</a><P>(&self, pat: P) -> &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a><div class="where">where
|
||
P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html" title="trait core::str::pattern::Pattern">Pattern</a>,</div></h4></section></summary><div class="docblock"><p>Returns a string slice with all prefixes that match a pattern
|
||
repeatedly removed.</p>
|
||
<p>The <a href="https://doc.rust-lang.org/nightly/core/str/pattern/index.html" title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, <a href="https://doc.rust-lang.org/nightly/std/primitive.char.html" title="primitive char"><code>char</code></a>, a slice of <a href="https://doc.rust-lang.org/nightly/std/primitive.char.html" title="primitive char"><code>char</code></a>s, or a
|
||
function or closure that determines if a character matches.</p>
|
||
<h5 id="text-directionality-4"><a class="doc-anchor" href="#text-directionality-4">§</a>Text directionality</h5>
|
||
<p>A string is a sequence of bytes. <code>start</code> in this context means the first
|
||
position of that byte string; for a left-to-right language like English or
|
||
Russian, this will be left side, and for right-to-left languages like
|
||
Arabic or Hebrew, this will be the right side.</p>
|
||
<h5 id="examples-44"><a class="doc-anchor" href="#examples-44">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">assert_eq!</span>(<span class="string">"11foo1bar11"</span>.trim_start_matches(<span class="string">'1'</span>), <span class="string">"foo1bar11"</span>);
|
||
<span class="macro">assert_eq!</span>(<span class="string">"123foo1bar123"</span>.trim_start_matches(char::is_numeric), <span class="string">"foo1bar123"</span>);
|
||
|
||
<span class="kw">let </span>x: <span class="kw-2">&</span>[<span class="kw">_</span>] = <span class="kw-2">&</span>[<span class="string">'1'</span>, <span class="string">'2'</span>];
|
||
<span class="macro">assert_eq!</span>(<span class="string">"12foo1bar12"</span>.trim_start_matches(x), <span class="string">"foo1bar12"</span>);</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.strip_prefix" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.45.0">1.45.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#2192">source</a></span><h4 class="code-header">pub fn <a href="#method.strip_prefix" class="fn">strip_prefix</a><P>(&self, prefix: P) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>><div class="where">where
|
||
P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html" title="trait core::str::pattern::Pattern">Pattern</a>,</div></h4></section></summary><div class="docblock"><p>Returns a string slice with the prefix removed.</p>
|
||
<p>If the string starts with the pattern <code>prefix</code>, returns the substring after the prefix,
|
||
wrapped in <code>Some</code>. Unlike <code>trim_start_matches</code>, this method removes the prefix exactly once.</p>
|
||
<p>If the string does not start with <code>prefix</code>, returns <code>None</code>.</p>
|
||
<p>The <a href="https://doc.rust-lang.org/nightly/core/str/pattern/index.html" title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, <a href="https://doc.rust-lang.org/nightly/std/primitive.char.html" title="primitive char"><code>char</code></a>, a slice of <a href="https://doc.rust-lang.org/nightly/std/primitive.char.html" title="primitive char"><code>char</code></a>s, or a
|
||
function or closure that determines if a character matches.</p>
|
||
<h5 id="examples-45"><a class="doc-anchor" href="#examples-45">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">assert_eq!</span>(<span class="string">"foo:bar"</span>.strip_prefix(<span class="string">"foo:"</span>), <span class="prelude-val">Some</span>(<span class="string">"bar"</span>));
|
||
<span class="macro">assert_eq!</span>(<span class="string">"foo:bar"</span>.strip_prefix(<span class="string">"bar"</span>), <span class="prelude-val">None</span>);
|
||
<span class="macro">assert_eq!</span>(<span class="string">"foofoo"</span>.strip_prefix(<span class="string">"foo"</span>), <span class="prelude-val">Some</span>(<span class="string">"foo"</span>));</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.strip_suffix" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.45.0">1.45.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#2219-2221">source</a></span><h4 class="code-header">pub fn <a href="#method.strip_suffix" class="fn">strip_suffix</a><P>(&self, suffix: P) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>><div class="where">where
|
||
P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html" title="trait core::str::pattern::Pattern">Pattern</a>,
|
||
<P as <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html" title="trait core::str::pattern::Pattern">Pattern</a>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html#associatedtype.Searcher" title="type core::str::pattern::Pattern::Searcher">Searcher</a><'a>: for<'a> <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.ReverseSearcher.html" title="trait core::str::pattern::ReverseSearcher">ReverseSearcher</a><'a>,</div></h4></section></summary><div class="docblock"><p>Returns a string slice with the suffix removed.</p>
|
||
<p>If the string ends with the pattern <code>suffix</code>, returns the substring before the suffix,
|
||
wrapped in <code>Some</code>. Unlike <code>trim_end_matches</code>, this method removes the suffix exactly once.</p>
|
||
<p>If the string does not end with <code>suffix</code>, returns <code>None</code>.</p>
|
||
<p>The <a href="https://doc.rust-lang.org/nightly/core/str/pattern/index.html" title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, <a href="https://doc.rust-lang.org/nightly/std/primitive.char.html" title="primitive char"><code>char</code></a>, a slice of <a href="https://doc.rust-lang.org/nightly/std/primitive.char.html" title="primitive char"><code>char</code></a>s, or a
|
||
function or closure that determines if a character matches.</p>
|
||
<h5 id="examples-46"><a class="doc-anchor" href="#examples-46">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">assert_eq!</span>(<span class="string">"bar:foo"</span>.strip_suffix(<span class="string">":foo"</span>), <span class="prelude-val">Some</span>(<span class="string">"bar"</span>));
|
||
<span class="macro">assert_eq!</span>(<span class="string">"bar:foo"</span>.strip_suffix(<span class="string">"bar"</span>), <span class="prelude-val">None</span>);
|
||
<span class="macro">assert_eq!</span>(<span class="string">"foofoo"</span>.strip_suffix(<span class="string">"foo"</span>), <span class="prelude-val">Some</span>(<span class="string">"foo"</span>));</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.trim_end_matches" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.30.0">1.30.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#2262-2264">source</a></span><h4 class="code-header">pub fn <a href="#method.trim_end_matches" class="fn">trim_end_matches</a><P>(&self, pat: P) -> &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a><div class="where">where
|
||
P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html" title="trait core::str::pattern::Pattern">Pattern</a>,
|
||
<P as <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html" title="trait core::str::pattern::Pattern">Pattern</a>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html#associatedtype.Searcher" title="type core::str::pattern::Pattern::Searcher">Searcher</a><'a>: for<'a> <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.ReverseSearcher.html" title="trait core::str::pattern::ReverseSearcher">ReverseSearcher</a><'a>,</div></h4></section></summary><div class="docblock"><p>Returns a string slice with all suffixes that match a pattern
|
||
repeatedly removed.</p>
|
||
<p>The <a href="https://doc.rust-lang.org/nightly/core/str/pattern/index.html" title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, <a href="https://doc.rust-lang.org/nightly/std/primitive.char.html" title="primitive char"><code>char</code></a>, a slice of <a href="https://doc.rust-lang.org/nightly/std/primitive.char.html" title="primitive char"><code>char</code></a>s, or a
|
||
function or closure that determines if a character matches.</p>
|
||
<h5 id="text-directionality-5"><a class="doc-anchor" href="#text-directionality-5">§</a>Text directionality</h5>
|
||
<p>A string is a sequence of bytes. <code>end</code> in this context means the last
|
||
position of that byte string; for a left-to-right language like English or
|
||
Russian, this will be right side, and for right-to-left languages like
|
||
Arabic or Hebrew, this will be the left side.</p>
|
||
<h5 id="examples-47"><a class="doc-anchor" href="#examples-47">§</a>Examples</h5>
|
||
<p>Simple patterns:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">assert_eq!</span>(<span class="string">"11foo1bar11"</span>.trim_end_matches(<span class="string">'1'</span>), <span class="string">"11foo1bar"</span>);
|
||
<span class="macro">assert_eq!</span>(<span class="string">"123foo1bar123"</span>.trim_end_matches(char::is_numeric), <span class="string">"123foo1bar"</span>);
|
||
|
||
<span class="kw">let </span>x: <span class="kw-2">&</span>[<span class="kw">_</span>] = <span class="kw-2">&</span>[<span class="string">'1'</span>, <span class="string">'2'</span>];
|
||
<span class="macro">assert_eq!</span>(<span class="string">"12foo1bar12"</span>.trim_end_matches(x), <span class="string">"12foo1bar"</span>);</code></pre></div>
|
||
<p>A more complex pattern, using a closure:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">assert_eq!</span>(<span class="string">"1fooX"</span>.trim_end_matches(|c| c == <span class="string">'1' </span>|| c == <span class="string">'X'</span>), <span class="string">"1foo"</span>);</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.trim_left_matches" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.6.0">1.6.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#2306">source</a></span><h4 class="code-header">pub fn <a href="#method.trim_left_matches" class="fn">trim_left_matches</a><P>(&self, pat: P) -> &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a><div class="where">where
|
||
P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html" title="trait core::str::pattern::Pattern">Pattern</a>,</div></h4></section><span class="item-info"><div class="stab deprecated"><span class="emoji">👎</span><span>Deprecated since 1.33.0: superseded by <code>trim_start_matches</code></span></div></span></summary><div class="docblock"><p>Returns a string slice with all prefixes that match a pattern
|
||
repeatedly removed.</p>
|
||
<p>The <a href="https://doc.rust-lang.org/nightly/core/str/pattern/index.html" title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, <a href="https://doc.rust-lang.org/nightly/std/primitive.char.html" title="primitive char"><code>char</code></a>, a slice of <a href="https://doc.rust-lang.org/nightly/std/primitive.char.html" title="primitive char"><code>char</code></a>s, or a
|
||
function or closure that determines if a character matches.</p>
|
||
<h5 id="text-directionality-6"><a class="doc-anchor" href="#text-directionality-6">§</a>Text directionality</h5>
|
||
<p>A string is a sequence of bytes. ‘Left’ in this context means the first
|
||
position of that byte string; for a language like Arabic or Hebrew
|
||
which are ‘right to left’ rather than ‘left to right’, this will be
|
||
the <em>right</em> side, not the left.</p>
|
||
<h5 id="examples-48"><a class="doc-anchor" href="#examples-48">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">assert_eq!</span>(<span class="string">"11foo1bar11"</span>.trim_left_matches(<span class="string">'1'</span>), <span class="string">"foo1bar11"</span>);
|
||
<span class="macro">assert_eq!</span>(<span class="string">"123foo1bar123"</span>.trim_left_matches(char::is_numeric), <span class="string">"foo1bar123"</span>);
|
||
|
||
<span class="kw">let </span>x: <span class="kw-2">&</span>[<span class="kw">_</span>] = <span class="kw-2">&</span>[<span class="string">'1'</span>, <span class="string">'2'</span>];
|
||
<span class="macro">assert_eq!</span>(<span class="string">"12foo1bar12"</span>.trim_left_matches(x), <span class="string">"foo1bar12"</span>);</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.trim_right_matches" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.6.0">1.6.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#2349-2351">source</a></span><h4 class="code-header">pub fn <a href="#method.trim_right_matches" class="fn">trim_right_matches</a><P>(&self, pat: P) -> &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a><div class="where">where
|
||
P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html" title="trait core::str::pattern::Pattern">Pattern</a>,
|
||
<P as <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html" title="trait core::str::pattern::Pattern">Pattern</a>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html#associatedtype.Searcher" title="type core::str::pattern::Pattern::Searcher">Searcher</a><'a>: for<'a> <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.ReverseSearcher.html" title="trait core::str::pattern::ReverseSearcher">ReverseSearcher</a><'a>,</div></h4></section><span class="item-info"><div class="stab deprecated"><span class="emoji">👎</span><span>Deprecated since 1.33.0: superseded by <code>trim_end_matches</code></span></div></span></summary><div class="docblock"><p>Returns a string slice with all suffixes that match a pattern
|
||
repeatedly removed.</p>
|
||
<p>The <a href="https://doc.rust-lang.org/nightly/core/str/pattern/index.html" title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, <a href="https://doc.rust-lang.org/nightly/std/primitive.char.html" title="primitive char"><code>char</code></a>, a slice of <a href="https://doc.rust-lang.org/nightly/std/primitive.char.html" title="primitive char"><code>char</code></a>s, or a
|
||
function or closure that determines if a character matches.</p>
|
||
<h5 id="text-directionality-7"><a class="doc-anchor" href="#text-directionality-7">§</a>Text directionality</h5>
|
||
<p>A string is a sequence of bytes. ‘Right’ in this context means the last
|
||
position of that byte string; for a language like Arabic or Hebrew
|
||
which are ‘right to left’ rather than ‘left to right’, this will be
|
||
the <em>left</em> side, not the right.</p>
|
||
<h5 id="examples-49"><a class="doc-anchor" href="#examples-49">§</a>Examples</h5>
|
||
<p>Simple patterns:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">assert_eq!</span>(<span class="string">"11foo1bar11"</span>.trim_right_matches(<span class="string">'1'</span>), <span class="string">"11foo1bar"</span>);
|
||
<span class="macro">assert_eq!</span>(<span class="string">"123foo1bar123"</span>.trim_right_matches(char::is_numeric), <span class="string">"123foo1bar"</span>);
|
||
|
||
<span class="kw">let </span>x: <span class="kw-2">&</span>[<span class="kw">_</span>] = <span class="kw-2">&</span>[<span class="string">'1'</span>, <span class="string">'2'</span>];
|
||
<span class="macro">assert_eq!</span>(<span class="string">"12foo1bar12"</span>.trim_right_matches(x), <span class="string">"12foo1bar"</span>);</code></pre></div>
|
||
<p>A more complex pattern, using a closure:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">assert_eq!</span>(<span class="string">"1fooX"</span>.trim_right_matches(|c| c == <span class="string">'1' </span>|| c == <span class="string">'X'</span>), <span class="string">"1foo"</span>);</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.parse" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.6.0">1.6.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#2401">source</a></span><h4 class="code-header">pub fn <a href="#method.parse" class="fn">parse</a><F>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><F, <F as <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/traits/trait.FromStr.html" title="trait core::str::traits::FromStr">FromStr</a>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/str/traits/trait.FromStr.html#associatedtype.Err" title="type core::str::traits::FromStr::Err">Err</a>><div class="where">where
|
||
F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/traits/trait.FromStr.html" title="trait core::str::traits::FromStr">FromStr</a>,</div></h4></section></summary><div class="docblock"><p>Parses this string slice into another type.</p>
|
||
<p>Because <code>parse</code> is so general, it can cause problems with type
|
||
inference. As such, <code>parse</code> is one of the few times you’ll see
|
||
the syntax affectionately known as the ‘turbofish’: <code>::<></code>. This
|
||
helps the inference algorithm understand specifically which type
|
||
you’re trying to parse into.</p>
|
||
<p><code>parse</code> can parse into any type that implements the <a href="https://doc.rust-lang.org/nightly/core/str/traits/trait.FromStr.html" title="trait core::str::traits::FromStr"><code>FromStr</code></a> trait.</p>
|
||
<h5 id="errors"><a class="doc-anchor" href="#errors">§</a>Errors</h5>
|
||
<p>Will return <a href="https://doc.rust-lang.org/nightly/core/str/traits/trait.FromStr.html#associatedtype.Err" title="associated type core::str::traits::FromStr::Err"><code>Err</code></a> if it’s not possible to parse this string slice into
|
||
the desired type.</p>
|
||
<h5 id="examples-50"><a class="doc-anchor" href="#examples-50">§</a>Examples</h5>
|
||
<p>Basic usage</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>four: u32 = <span class="string">"4"</span>.parse().unwrap();
|
||
|
||
<span class="macro">assert_eq!</span>(<span class="number">4</span>, four);</code></pre></div>
|
||
<p>Using the ‘turbofish’ instead of annotating <code>four</code>:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>four = <span class="string">"4"</span>.parse::<u32>();
|
||
|
||
<span class="macro">assert_eq!</span>(<span class="prelude-val">Ok</span>(<span class="number">4</span>), four);</code></pre></div>
|
||
<p>Failing to parse:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>nope = <span class="string">"j"</span>.parse::<u32>();
|
||
|
||
<span class="macro">assert!</span>(nope.is_err());</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.is_ascii" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.23.0">1.23.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#2420">source</a></span><h4 class="code-header">pub fn <a href="#method.is_ascii" class="fn">is_ascii</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Checks if all characters in this string are within the ASCII range.</p>
|
||
<h5 id="examples-51"><a class="doc-anchor" href="#examples-51">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>ascii = <span class="string">"hello!\n"</span>;
|
||
<span class="kw">let </span>non_ascii = <span class="string">"Grüße, Jürgen ❤"</span>;
|
||
|
||
<span class="macro">assert!</span>(ascii.is_ascii());
|
||
<span class="macro">assert!</span>(!non_ascii.is_ascii());</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.as_ascii" class="method"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#2432">source</a><h4 class="code-header">pub fn <a href="#method.as_ascii" class="fn">as_ascii</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&[<a class="enum" href="https://doc.rust-lang.org/nightly/core/ascii/ascii_char/enum.AsciiChar.html" title="enum core::ascii::ascii_char::AsciiChar">AsciiChar</a>]></h4></section><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>ascii_char</code>)</span></div></span></summary><div class="docblock"><p>If this string slice <a href="https://doc.rust-lang.org/nightly/std/primitive.str.html#method.is_ascii" title="method str::is_ascii"><code>is_ascii</code></a>, returns it as a slice
|
||
of <a href="https://doc.rust-lang.org/nightly/core/ascii/ascii_char/enum.AsciiChar.html" title="enum core::ascii::ascii_char::AsciiChar">ASCII characters</a>, otherwise returns <code>None</code>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.eq_ignore_ascii_case" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.23.0">1.23.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#2452">source</a></span><h4 class="code-header">pub fn <a href="#method.eq_ignore_ascii_case" class="fn">eq_ignore_ascii_case</a>(&self, other: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Checks that two strings are an ASCII case-insensitive match.</p>
|
||
<p>Same as <code>to_ascii_lowercase(a) == to_ascii_lowercase(b)</code>,
|
||
but without allocating and copying temporaries.</p>
|
||
<h5 id="examples-52"><a class="doc-anchor" href="#examples-52">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">assert!</span>(<span class="string">"Ferris"</span>.eq_ignore_ascii_case(<span class="string">"FERRIS"</span>));
|
||
<span class="macro">assert!</span>(<span class="string">"Ferrös"</span>.eq_ignore_ascii_case(<span class="string">"FERRöS"</span>));
|
||
<span class="macro">assert!</span>(!<span class="string">"Ferrös"</span>.eq_ignore_ascii_case(<span class="string">"FERRÖS"</span>));</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.trim_ascii_start" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.80.0">1.80.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#2531">source</a></span><h4 class="code-header">pub fn <a href="#method.trim_ascii_start" class="fn">trim_ascii_start</a>(&self) -> &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></h4></section></summary><div class="docblock"><p>Returns a string slice with leading ASCII whitespace removed.</p>
|
||
<p>‘Whitespace’ refers to the definition used by
|
||
<a href="https://doc.rust-lang.org/nightly/std/primitive.u8.html#method.is_ascii_whitespace" title="method u8::is_ascii_whitespace"><code>u8::is_ascii_whitespace</code></a>.</p>
|
||
<h5 id="examples-53"><a class="doc-anchor" href="#examples-53">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">assert_eq!</span>(<span class="string">" \t \u{3000}hello world\n"</span>.trim_ascii_start(), <span class="string">"\u{3000}hello world\n"</span>);
|
||
<span class="macro">assert_eq!</span>(<span class="string">" "</span>.trim_ascii_start(), <span class="string">""</span>);
|
||
<span class="macro">assert_eq!</span>(<span class="string">""</span>.trim_ascii_start(), <span class="string">""</span>);</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.trim_ascii_end" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.80.0">1.80.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#2556">source</a></span><h4 class="code-header">pub fn <a href="#method.trim_ascii_end" class="fn">trim_ascii_end</a>(&self) -> &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></h4></section></summary><div class="docblock"><p>Returns a string slice with trailing ASCII whitespace removed.</p>
|
||
<p>‘Whitespace’ refers to the definition used by
|
||
<a href="https://doc.rust-lang.org/nightly/std/primitive.u8.html#method.is_ascii_whitespace" title="method u8::is_ascii_whitespace"><code>u8::is_ascii_whitespace</code></a>.</p>
|
||
<h5 id="examples-54"><a class="doc-anchor" href="#examples-54">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">assert_eq!</span>(<span class="string">"\r hello world\u{3000}\n "</span>.trim_ascii_end(), <span class="string">"\r hello world\u{3000}"</span>);
|
||
<span class="macro">assert_eq!</span>(<span class="string">" "</span>.trim_ascii_end(), <span class="string">""</span>);
|
||
<span class="macro">assert_eq!</span>(<span class="string">""</span>.trim_ascii_end(), <span class="string">""</span>);</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.trim_ascii" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.80.0">1.80.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#2582">source</a></span><h4 class="code-header">pub fn <a href="#method.trim_ascii" class="fn">trim_ascii</a>(&self) -> &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></h4></section></summary><div class="docblock"><p>Returns a string slice with leading and trailing ASCII whitespace
|
||
removed.</p>
|
||
<p>‘Whitespace’ refers to the definition used by
|
||
<a href="https://doc.rust-lang.org/nightly/std/primitive.u8.html#method.is_ascii_whitespace" title="method u8::is_ascii_whitespace"><code>u8::is_ascii_whitespace</code></a>.</p>
|
||
<h5 id="examples-55"><a class="doc-anchor" href="#examples-55">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">assert_eq!</span>(<span class="string">"\r hello world\n "</span>.trim_ascii(), <span class="string">"hello world"</span>);
|
||
<span class="macro">assert_eq!</span>(<span class="string">" "</span>.trim_ascii(), <span class="string">""</span>);
|
||
<span class="macro">assert_eq!</span>(<span class="string">""</span>.trim_ascii(), <span class="string">""</span>);</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.escape_debug" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.34.0">1.34.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#2625">source</a></span><h4 class="code-header">pub fn <a href="#method.escape_debug" class="fn">escape_debug</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/iter/struct.EscapeDebug.html" title="struct core::str::iter::EscapeDebug">EscapeDebug</a><'_></h4></section></summary><div class="docblock"><p>Returns an iterator that escapes each char in <code>self</code> with <a href="https://doc.rust-lang.org/nightly/std/primitive.char.html#method.escape_debug" title="method char::escape_debug"><code>char::escape_debug</code></a>.</p>
|
||
<p>Note: only extended grapheme codepoints that begin the string will be
|
||
escaped.</p>
|
||
<h5 id="examples-56"><a class="doc-anchor" href="#examples-56">§</a>Examples</h5>
|
||
<p>As an iterator:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">for </span>c <span class="kw">in </span><span class="string">"❤\n!"</span>.escape_debug() {
|
||
<span class="macro">print!</span>(<span class="string">"{c}"</span>);
|
||
}
|
||
<span class="macro">println!</span>();</code></pre></div>
|
||
<p>Using <code>println!</code> directly:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">println!</span>(<span class="string">"{}"</span>, <span class="string">"❤\n!"</span>.escape_debug());</code></pre></div>
|
||
<p>Both are equivalent to:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">println!</span>(<span class="string">"❤\\n!"</span>);</code></pre></div>
|
||
<p>Using <code>to_string</code>:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">assert_eq!</span>(<span class="string">"❤\n!"</span>.escape_debug().to_string(), <span class="string">"❤\\n!"</span>);</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.escape_default" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.34.0">1.34.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#2671">source</a></span><h4 class="code-header">pub fn <a href="#method.escape_default" class="fn">escape_default</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/iter/struct.EscapeDefault.html" title="struct core::str::iter::EscapeDefault">EscapeDefault</a><'_></h4></section></summary><div class="docblock"><p>Returns an iterator that escapes each char in <code>self</code> with <a href="https://doc.rust-lang.org/nightly/std/primitive.char.html#method.escape_default" title="method char::escape_default"><code>char::escape_default</code></a>.</p>
|
||
<h5 id="examples-57"><a class="doc-anchor" href="#examples-57">§</a>Examples</h5>
|
||
<p>As an iterator:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">for </span>c <span class="kw">in </span><span class="string">"❤\n!"</span>.escape_default() {
|
||
<span class="macro">print!</span>(<span class="string">"{c}"</span>);
|
||
}
|
||
<span class="macro">println!</span>();</code></pre></div>
|
||
<p>Using <code>println!</code> directly:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">println!</span>(<span class="string">"{}"</span>, <span class="string">"❤\n!"</span>.escape_default());</code></pre></div>
|
||
<p>Both are equivalent to:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">println!</span>(<span class="string">"\\u{{2764}}\\n!"</span>);</code></pre></div>
|
||
<p>Using <code>to_string</code>:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">assert_eq!</span>(<span class="string">"❤\n!"</span>.escape_default().to_string(), <span class="string">"\\u{2764}\\n!"</span>);</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.escape_unicode" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.34.0">1.34.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#2709">source</a></span><h4 class="code-header">pub fn <a href="#method.escape_unicode" class="fn">escape_unicode</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/iter/struct.EscapeUnicode.html" title="struct core::str::iter::EscapeUnicode">EscapeUnicode</a><'_></h4></section></summary><div class="docblock"><p>Returns an iterator that escapes each char in <code>self</code> with <a href="https://doc.rust-lang.org/nightly/std/primitive.char.html#method.escape_unicode" title="method char::escape_unicode"><code>char::escape_unicode</code></a>.</p>
|
||
<h5 id="examples-58"><a class="doc-anchor" href="#examples-58">§</a>Examples</h5>
|
||
<p>As an iterator:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">for </span>c <span class="kw">in </span><span class="string">"❤\n!"</span>.escape_unicode() {
|
||
<span class="macro">print!</span>(<span class="string">"{c}"</span>);
|
||
}
|
||
<span class="macro">println!</span>();</code></pre></div>
|
||
<p>Using <code>println!</code> directly:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">println!</span>(<span class="string">"{}"</span>, <span class="string">"❤\n!"</span>.escape_unicode());</code></pre></div>
|
||
<p>Both are equivalent to:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">println!</span>(<span class="string">"\\u{{2764}}\\u{{a}}\\u{{21}}"</span>);</code></pre></div>
|
||
<p>Using <code>to_string</code>:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">assert_eq!</span>(<span class="string">"❤\n!"</span>.escape_unicode().to_string(), <span class="string">"\\u{2764}\\u{a}\\u{21}"</span>);</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.substr_range" class="method"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#2742">source</a><h4 class="code-header">pub fn <a href="#method.substr_range" class="fn">substr_range</a>(&self, substr: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/core/ops/range/struct.Range.html" title="struct core::ops::range::Range">Range</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>>></h4></section><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>substr_range</code>)</span></div></span></summary><div class="docblock"><p>Returns the range that a substring points to.</p>
|
||
<p>Returns <code>None</code> if <code>substr</code> does not point within <code>self</code>.</p>
|
||
<p>Unlike <a href="https://doc.rust-lang.org/nightly/std/primitive.str.html#method.find" title="method str::find"><code>str::find</code></a>, <strong>this does not search through the string</strong>.
|
||
Instead, it uses pointer arithmetic to find where in the string
|
||
<code>substr</code> is derived from.</p>
|
||
<p>This is useful for extending <a href="https://doc.rust-lang.org/nightly/std/primitive.str.html#method.split" title="method str::split"><code>str::split</code></a> and similar methods.</p>
|
||
<p>Note that this method may return false positives (typically either
|
||
<code>Some(0..0)</code> or <code>Some(self.len()..self.len())</code>) if <code>substr</code> is a
|
||
zero-length <code>str</code> that points at the beginning or end of another,
|
||
independent, <code>str</code>.</p>
|
||
<h5 id="examples-59"><a class="doc-anchor" href="#examples-59">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="attr">#![feature(substr_range)]
|
||
|
||
</span><span class="kw">let </span>data = <span class="string">"a, b, b, a"</span>;
|
||
<span class="kw">let </span><span class="kw-2">mut </span>iter = data.split(<span class="string">", "</span>).map(|s| data.substr_range(s).unwrap());
|
||
|
||
<span class="macro">assert_eq!</span>(iter.next(), <span class="prelude-val">Some</span>(<span class="number">0</span>..<span class="number">1</span>));
|
||
<span class="macro">assert_eq!</span>(iter.next(), <span class="prelude-val">Some</span>(<span class="number">3</span>..<span class="number">4</span>));
|
||
<span class="macro">assert_eq!</span>(iter.next(), <span class="prelude-val">Some</span>(<span class="number">6</span>..<span class="number">7</span>));
|
||
<span class="macro">assert_eq!</span>(iter.next(), <span class="prelude-val">Some</span>(<span class="number">9</span>..<span class="number">10</span>));</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.as_str" class="method"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#2753">source</a><h4 class="code-header">pub fn <a href="#method.as_str" class="fn">as_str</a>(&self) -> &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></h4></section><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>str_as_str</code>)</span></div></span></summary><div class="docblock"><p>Returns the same string as a string slice <code>&str</code>.</p>
|
||
<p>This method is redundant when used directly on <code>&str</code>, but
|
||
it helps dereferencing other string-like types to string slices,
|
||
for example references to <code>Box<str></code> or <code>Arc<str></code>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.replace" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.36.0">1.36.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/alloc/str.rs.html#271">source</a></span><h4 class="code-header">pub fn <a href="#method.replace" class="fn">replace</a><P>(&self, from: P, to: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a><div class="where">where
|
||
P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html" title="trait core::str::pattern::Pattern">Pattern</a>,</div></h4></section></summary><div class="docblock"><p>Replaces all matches of a pattern with another string.</p>
|
||
<p><code>replace</code> creates a new <a href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String"><code>String</code></a>, and copies the data from this string slice into it.
|
||
While doing so, it attempts to find matches of a pattern. If it finds any, it
|
||
replaces them with the replacement string slice.</p>
|
||
<h5 id="examples-60"><a class="doc-anchor" href="#examples-60">§</a>Examples</h5>
|
||
<p>Basic usage:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>s = <span class="string">"this is old"</span>;
|
||
|
||
<span class="macro">assert_eq!</span>(<span class="string">"this is new"</span>, s.replace(<span class="string">"old"</span>, <span class="string">"new"</span>));
|
||
<span class="macro">assert_eq!</span>(<span class="string">"than an old"</span>, s.replace(<span class="string">"is"</span>, <span class="string">"an"</span>));</code></pre></div>
|
||
<p>When the pattern doesn’t match, it returns this string slice as <a href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String"><code>String</code></a>:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>s = <span class="string">"this is old"</span>;
|
||
<span class="macro">assert_eq!</span>(s, s.replace(<span class="string">"cookie monster"</span>, <span class="string">"little lamb"</span>));</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.replacen" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.36.0">1.36.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/alloc/str.rs.html#311">source</a></span><h4 class="code-header">pub fn <a href="#method.replacen" class="fn">replacen</a><P>(&self, pat: P, to: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, count: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a><div class="where">where
|
||
P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html" title="trait core::str::pattern::Pattern">Pattern</a>,</div></h4></section></summary><div class="docblock"><p>Replaces first N matches of a pattern with another string.</p>
|
||
<p><code>replacen</code> creates a new <a href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String"><code>String</code></a>, and copies the data from this string slice into it.
|
||
While doing so, it attempts to find matches of a pattern. If it finds any, it
|
||
replaces them with the replacement string slice at most <code>count</code> times.</p>
|
||
<h5 id="examples-61"><a class="doc-anchor" href="#examples-61">§</a>Examples</h5>
|
||
<p>Basic usage:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>s = <span class="string">"foo foo 123 foo"</span>;
|
||
<span class="macro">assert_eq!</span>(<span class="string">"new new 123 foo"</span>, s.replacen(<span class="string">"foo"</span>, <span class="string">"new"</span>, <span class="number">2</span>));
|
||
<span class="macro">assert_eq!</span>(<span class="string">"faa fao 123 foo"</span>, s.replacen(<span class="string">'o'</span>, <span class="string">"a"</span>, <span class="number">3</span>));
|
||
<span class="macro">assert_eq!</span>(<span class="string">"foo foo new23 foo"</span>, s.replacen(char::is_numeric, <span class="string">"new"</span>, <span class="number">1</span>));</code></pre></div>
|
||
<p>When the pattern doesn’t match, it returns this string slice as <a href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String"><code>String</code></a>:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>s = <span class="string">"this is old"</span>;
|
||
<span class="macro">assert_eq!</span>(s, s.replacen(<span class="string">"cookie monster"</span>, <span class="string">"little lamb"</span>, <span class="number">10</span>));</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.to_lowercase" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.36.0">1.36.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/alloc/str.rs.html#368">source</a></span><h4 class="code-header">pub fn <a href="#method.to_lowercase" class="fn">to_lowercase</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></h4></section></summary><div class="docblock"><p>Returns the lowercase equivalent of this string slice, as a new <a href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String"><code>String</code></a>.</p>
|
||
<p>‘Lowercase’ is defined according to the terms of the Unicode Derived Core Property
|
||
<code>Lowercase</code>.</p>
|
||
<p>Since some characters can expand into multiple characters when changing
|
||
the case, this function returns a <a href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String"><code>String</code></a> instead of modifying the
|
||
parameter in-place.</p>
|
||
<h5 id="examples-62"><a class="doc-anchor" href="#examples-62">§</a>Examples</h5>
|
||
<p>Basic usage:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>s = <span class="string">"HELLO"</span>;
|
||
|
||
<span class="macro">assert_eq!</span>(<span class="string">"hello"</span>, s.to_lowercase());</code></pre></div>
|
||
<p>A tricky example, with sigma:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>sigma = <span class="string">"Σ"</span>;
|
||
|
||
<span class="macro">assert_eq!</span>(<span class="string">"σ"</span>, sigma.to_lowercase());
|
||
|
||
<span class="comment">// but at the end of a word, it's ς, not σ:
|
||
</span><span class="kw">let </span>odysseus = <span class="string">"ὈΔΥΣΣΕΎΣ"</span>;
|
||
|
||
<span class="macro">assert_eq!</span>(<span class="string">"ὀδυσσεύς"</span>, odysseus.to_lowercase());</code></pre></div>
|
||
<p>Languages without case are not changed:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>new_year = <span class="string">"农历新年"</span>;
|
||
|
||
<span class="macro">assert_eq!</span>(new_year, new_year.to_lowercase());</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.to_uppercase" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.36.0">1.36.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/alloc/str.rs.html#455">source</a></span><h4 class="code-header">pub fn <a href="#method.to_uppercase" class="fn">to_uppercase</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></h4></section></summary><div class="docblock"><p>Returns the uppercase equivalent of this string slice, as a new <a href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String"><code>String</code></a>.</p>
|
||
<p>‘Uppercase’ is defined according to the terms of the Unicode Derived Core Property
|
||
<code>Uppercase</code>.</p>
|
||
<p>Since some characters can expand into multiple characters when changing
|
||
the case, this function returns a <a href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String"><code>String</code></a> instead of modifying the
|
||
parameter in-place.</p>
|
||
<h5 id="examples-63"><a class="doc-anchor" href="#examples-63">§</a>Examples</h5>
|
||
<p>Basic usage:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>s = <span class="string">"hello"</span>;
|
||
|
||
<span class="macro">assert_eq!</span>(<span class="string">"HELLO"</span>, s.to_uppercase());</code></pre></div>
|
||
<p>Scripts without case are not changed:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>new_year = <span class="string">"农历新年"</span>;
|
||
|
||
<span class="macro">assert_eq!</span>(new_year, new_year.to_uppercase());</code></pre></div>
|
||
<p>One character can become multiple:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>s = <span class="string">"tschüß"</span>;
|
||
|
||
<span class="macro">assert_eq!</span>(<span class="string">"TSCHÜSS"</span>, s.to_uppercase());</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.repeat" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.36.0">1.36.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/alloc/str.rs.html#518">source</a></span><h4 class="code-header">pub fn <a href="#method.repeat" class="fn">repeat</a>(&self, n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></h4></section></summary><div class="docblock"><p>Creates a new <a href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String"><code>String</code></a> by repeating a string <code>n</code> times.</p>
|
||
<h5 id="panics-2"><a class="doc-anchor" href="#panics-2">§</a>Panics</h5>
|
||
<p>This function will panic if the capacity would overflow.</p>
|
||
<h5 id="examples-64"><a class="doc-anchor" href="#examples-64">§</a>Examples</h5>
|
||
<p>Basic usage:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">assert_eq!</span>(<span class="string">"abc"</span>.repeat(<span class="number">4</span>), String::from(<span class="string">"abcabcabcabc"</span>));</code></pre></div>
|
||
<p>A panic upon overflow:</p>
|
||
|
||
<div class="example-wrap should_panic"><a href="#" class="tooltip" title="This example panics">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="comment">// this will panic at runtime
|
||
</span><span class="kw">let </span>huge = <span class="string">"0123456789abcdef"</span>.repeat(usize::MAX);</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.to_ascii_uppercase" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.36.0">1.36.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/alloc/str.rs.html#548">source</a></span><h4 class="code-header">pub fn <a href="#method.to_ascii_uppercase" class="fn">to_ascii_uppercase</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></h4></section></summary><div class="docblock"><p>Returns a copy of this string where each character is mapped to its
|
||
ASCII upper case equivalent.</p>
|
||
<p>ASCII letters ‘a’ to ‘z’ are mapped to ‘A’ to ‘Z’,
|
||
but non-ASCII letters are unchanged.</p>
|
||
<p>To uppercase the value in-place, use <a href="https://doc.rust-lang.org/nightly/std/primitive.str.html#method.make_ascii_uppercase" title="method str::make_ascii_uppercase"><code>make_ascii_uppercase</code></a>.</p>
|
||
<p>To uppercase ASCII characters in addition to non-ASCII characters, use
|
||
<a href="#method.to_uppercase"><code>to_uppercase</code></a>.</p>
|
||
<h5 id="examples-65"><a class="doc-anchor" href="#examples-65">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>s = <span class="string">"Grüße, Jürgen ❤"</span>;
|
||
|
||
<span class="macro">assert_eq!</span>(<span class="string">"GRüßE, JüRGEN ❤"</span>, s.to_ascii_uppercase());</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.to_ascii_lowercase" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.36.0">1.36.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/alloc/str.rs.html#580">source</a></span><h4 class="code-header">pub fn <a href="#method.to_ascii_lowercase" class="fn">to_ascii_lowercase</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></h4></section></summary><div class="docblock"><p>Returns a copy of this string where each character is mapped to its
|
||
ASCII lower case equivalent.</p>
|
||
<p>ASCII letters ‘A’ to ‘Z’ are mapped to ‘a’ to ‘z’,
|
||
but non-ASCII letters are unchanged.</p>
|
||
<p>To lowercase the value in-place, use <a href="https://doc.rust-lang.org/nightly/std/primitive.str.html#method.make_ascii_lowercase" title="method str::make_ascii_lowercase"><code>make_ascii_lowercase</code></a>.</p>
|
||
<p>To lowercase ASCII characters in addition to non-ASCII characters, use
|
||
<a href="#method.to_lowercase"><code>to_lowercase</code></a>.</p>
|
||
<h5 id="examples-66"><a class="doc-anchor" href="#examples-66">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>s = <span class="string">"Grüße, Jürgen ❤"</span>;
|
||
|
||
<span class="macro">assert_eq!</span>(<span class="string">"grüße, jürgen ❤"</span>, s.to_ascii_lowercase());</code></pre></div>
|
||
</div></details></div></details><h2 id="trait-implementations" class="section-header">Trait Implementations<a href="#trait-implementations" class="anchor">§</a></h2><div id="trait-implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-AsRef%3C%5Bu8%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#113-117">source</a><a href="#impl-AsRef%3C%5Bu8%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.as_ref-1" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#114-116">source</a><a href="#method.as_ref-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html#tymethod.as_ref" class="fn">as_ref</a>(&self) -> &[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>] <a href="#" class="tooltip" data-notable-ty="&[u8]">ⓘ</a></h4></section></summary><div class='docblock'>Converts this type into a shared reference of the (usually inferred) input type.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-AsRef%3CByteString%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#107-111">source</a><a href="#impl-AsRef%3CByteString%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><<a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a>> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.as_ref" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#108-110">source</a><a href="#method.as_ref" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html#tymethod.as_ref" class="fn">as_ref</a>(&self) -> &<a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h4></section></summary><div class='docblock'>Converts this type into a shared reference of the (usually inferred) input type.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-AsRef%3Cstr%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#119-123">source</a><a href="#impl-AsRef%3Cstr%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.as_ref-2" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#120-122">source</a><a href="#method.as_ref-2" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html#tymethod.as_ref" class="fn">as_ref</a>(&self) -> &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></h4></section></summary><div class='docblock'>Converts this type into a shared reference of the (usually inferred) input type.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Borrow%3Cstr%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#142-146">source</a><a href="#impl-Borrow%3Cstr%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.borrow" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#143-145">source</a><a href="#method.borrow" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow" class="fn">borrow</a>(&self) -> &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></h4></section></summary><div class='docblock'>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Clone-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#21">source</a><a href="#impl-Clone-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.clone" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#21">source</a><a href="#method.clone" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone" class="fn">clone</a>(&self) -> <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h4></section></summary><div class='docblock'>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.clone_from" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.6.0">1.6.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/clone.rs.html#174">source</a></span><a href="#method.clone_from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from" class="fn">clone_from</a>(&mut self, source: &Self)</h4></section></summary><div class='docblock'>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Debug-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#242-246">source</a><a href="#impl-Debug-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.fmt" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#243-245">source</a><a href="#method.fmt" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt" class="fn">fmt</a>(&self, fmt: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a><'_>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></h4></section></summary><div class='docblock'>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Default-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#21">source</a><a href="#impl-Default-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.default" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#21">source</a><a href="#method.default" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default" class="fn">default</a>() -> <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h4></section></summary><div class='docblock'>Returns the “default value” for a type. <a href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Deref-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#131-140">source</a><a href="#impl-Deref-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html" title="trait core::ops::deref::Deref">Deref</a> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Target" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#132">source</a><a href="#associatedtype.Target" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#associatedtype.Target" class="associatedtype">Target</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></h4></section></summary><div class='docblock'>The resulting type after dereferencing.</div></details><details class="toggle method-toggle" open><summary><section id="method.deref" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#135-139">source</a><a href="#method.deref" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#tymethod.deref" class="fn">deref</a>(&self) -> &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></h4></section></summary><div class='docblock'>Dereferences the value.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Deserialize%3C'de%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#275-283">source</a><a href="#impl-Deserialize%3C'de%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl<'de> <a class="trait" href="https://docs.rs/serde/1.0.210/serde/de/trait.Deserialize.html" title="trait serde::de::Deserialize">Deserialize</a><'de> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.deserialize" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#277-282">source</a><a href="#method.deserialize" class="anchor">§</a><h4 class="code-header">fn <a href="https://docs.rs/serde/1.0.210/serde/de/trait.Deserialize.html#tymethod.deserialize" class="fn">deserialize</a><D>(deserializer: D) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, D::<a class="associatedtype" href="https://docs.rs/serde/1.0.210/serde/de/trait.Deserializer.html#associatedtype.Error" title="type serde::de::Deserializer::Error">Error</a>><div class="where">where
|
||
D: <a class="trait" href="https://docs.rs/serde/1.0.210/serde/de/trait.Deserializer.html" title="trait serde::de::Deserializer">Deserializer</a><'de>,</div></h4></section></summary><div class='docblock'>Deserialize this value from the given Serde deserializer. <a href="https://docs.rs/serde/1.0.210/serde/de/trait.Deserialize.html#tymethod.deserialize">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Display-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#248-252">source</a><a href="#impl-Display-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.fmt-1" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#249-251">source</a><a href="#method.fmt-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt" class="fn">fmt</a>(&self, fmt: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a><'_>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></h4></section></summary><div class='docblock'>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-From%3C%26str%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#155-160">source</a><a href="#impl-From%3C%26str%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><&<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.from-1" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#157-159">source</a><a href="#method.from-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fn">from</a>(value: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> Self</h4></section></summary><div class='docblock'>Converts to this type from the input type.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-From%3CBox%3Cstr%3E%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#162-167">source</a><a href="#impl-From%3CBox%3Cstr%3E%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>>> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.from-2" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#164-166">source</a><a href="#method.from-2" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fn">from</a>(value: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>>) -> Self</h4></section></summary><div class='docblock'>Converts to this type from the input type.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-From%3CByteString%3E-for-String" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#169-174">source</a><a href="#impl-From%3CByteString%3E-for-String" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a>> for <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.from-3" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#171-173">source</a><a href="#method.from-3" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fn">from</a>(value: <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a>) -> Self</h4></section></summary><div class='docblock'>Converts to this type from the input type.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-From%3CString%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#148-153">source</a><a href="#impl-From%3CString%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.from" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#150-152">source</a><a href="#method.from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fn">from</a>(value: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>) -> Self</h4></section></summary><div class='docblock'>Converts to this type from the input type.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Hash-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#125-129">source</a><a href="#impl-Hash-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.hash" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#126-128">source</a><a href="#method.hash" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash" class="fn">hash</a><H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>>(&self, state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut H</a>)</h4></section></summary><div class='docblock'>Feeds this value into the given <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher"><code>Hasher</code></a>. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.hash_slice" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.6.0">1.6.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/hash/mod.rs.html#235-237">source</a></span><a href="#method.hash_slice" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice" class="fn">hash_slice</a><H>(data: &[Self], state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut H</a>)<div class="where">where
|
||
H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>,
|
||
Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class='docblock'>Feeds a slice of this type into the given <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher"><code>Hasher</code></a>. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Ord-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#21">source</a><a href="#impl-Ord-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.cmp" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#21">source</a><a href="#method.cmp" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#tymethod.cmp" class="fn">cmp</a>(&self, other: &<a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a></h4></section></summary><div class='docblock'>This method returns an <a href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering"><code>Ordering</code></a> between <code>self</code> and <code>other</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#tymethod.cmp">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.max" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.21.0">1.21.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#980-982">source</a></span><a href="#method.max" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.max" class="fn">max</a>(self, other: Self) -> Self<div class="where">where
|
||
Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class='docblock'>Compares and returns the maximum of two values. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.max">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.min" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.21.0">1.21.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#1001-1003">source</a></span><a href="#method.min" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.min" class="fn">min</a>(self, other: Self) -> Self<div class="where">where
|
||
Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class='docblock'>Compares and returns the minimum of two values. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.min">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.clamp" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.50.0">1.50.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#1027-1029">source</a></span><a href="#method.clamp" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.clamp" class="fn">clamp</a>(self, min: Self, max: Self) -> Self<div class="where">where
|
||
Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class='docblock'>Restrict a value to a certain interval. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.clamp">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-PartialEq%3CT%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#101-105">source</a><a href="#impl-PartialEq%3CT%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl<T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>>> <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><T> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.eq-1" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#102-104">source</a><a href="#method.eq-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq" class="fn">eq</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&T</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>.</div></details><details class="toggle method-toggle" open><summary><section id="method.ne-1" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.6.0">1.6.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#261">source</a></span><a href="#method.ne-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne" class="fn">ne</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&Rhs</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests for <code>!=</code>. The default implementation is almost always sufficient,
|
||
and should not be overridden without very good reason.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-PartialEq%3Cstr%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#95-99">source</a><a href="#impl-PartialEq%3Cstr%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.eq" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#96-98">source</a><a href="#method.eq" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq" class="fn">eq</a>(&self, other: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>.</div></details><details class="toggle method-toggle" open><summary><section id="method.ne" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.6.0">1.6.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#261">source</a></span><a href="#method.ne" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne" class="fn">ne</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&Rhs</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests for <code>!=</code>. The default implementation is almost always sufficient,
|
||
and should not be overridden without very good reason.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-PartialOrd-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#21">source</a><a href="#impl-PartialOrd-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.partial_cmp" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#21">source</a><a href="#method.partial_cmp" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp" class="fn">partial_cmp</a>(&self, other: &<a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>></h4></section></summary><div class='docblock'>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.lt" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.6.0">1.6.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#1335">source</a></span><a href="#method.lt" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt" class="fn">lt</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&Rhs</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests less than (for <code>self</code> and <code>other</code>) and is used by the <code><</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.le" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.6.0">1.6.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#1353">source</a></span><a href="#method.le" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le" class="fn">le</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&Rhs</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the
|
||
<code><=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.gt" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.6.0">1.6.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#1371">source</a></span><a href="#method.gt" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt" class="fn">gt</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&Rhs</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>></code>
|
||
operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.ge" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.6.0">1.6.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#1389">source</a></span><a href="#method.ge" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge" class="fn">ge</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&Rhs</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by
|
||
the <code>>=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Serialize-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#265-273">source</a><a href="#impl-Serialize-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://docs.rs/serde/1.0.210/serde/ser/trait.Serialize.html" title="trait serde::ser::Serialize">Serialize</a> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.serialize" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#267-272">source</a><a href="#method.serialize" class="anchor">§</a><h4 class="code-header">fn <a href="https://docs.rs/serde/1.0.210/serde/ser/trait.Serialize.html#tymethod.serialize" class="fn">serialize</a><S>(&self, serializer: S) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><S::<a class="associatedtype" href="https://docs.rs/serde/1.0.210/serde/ser/trait.Serializer.html#associatedtype.Ok" title="type serde::ser::Serializer::Ok">Ok</a>, S::<a class="associatedtype" href="https://docs.rs/serde/1.0.210/serde/ser/trait.Serializer.html#associatedtype.Error" title="type serde::ser::Serializer::Error">Error</a>><div class="where">where
|
||
S: <a class="trait" href="https://docs.rs/serde/1.0.210/serde/ser/trait.Serializer.html" title="trait serde::ser::Serializer">Serializer</a>,</div></h4></section></summary><div class='docblock'>Serialize this value into the given Serde serializer. <a href="https://docs.rs/serde/1.0.210/serde/ser/trait.Serialize.html#tymethod.serialize">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%26%5Bu8%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#176-184">source</a><a href="#impl-TryFrom%3C%26%5Bu8%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><&[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#177">source</a><a href="#associatedtype.Error" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#180-183">source</a><a href="#method.try_from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: &[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%26%5Bu8;+0%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%26%5Bu8;+0%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><&[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">0</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-5" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-5" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-5" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-5" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: &[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">0</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%26%5Bu8;+1%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%26%5Bu8;+1%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><&[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">1</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-7" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-7" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-7" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-7" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: &[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">1</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%26%5Bu8;+10%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%26%5Bu8;+10%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><&[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">10</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-25" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-25" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-25" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-25" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: &[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">10</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%26%5Bu8;+11%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%26%5Bu8;+11%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><&[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">11</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-27" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-27" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-27" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-27" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: &[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">11</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%26%5Bu8;+12%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%26%5Bu8;+12%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><&[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">12</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-29" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-29" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-29" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-29" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: &[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">12</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%26%5Bu8;+13%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%26%5Bu8;+13%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><&[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">13</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-31" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-31" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-31" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-31" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: &[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">13</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%26%5Bu8;+14%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%26%5Bu8;+14%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><&[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">14</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-33" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-33" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-33" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-33" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: &[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">14</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%26%5Bu8;+15%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%26%5Bu8;+15%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><&[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">15</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-35" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-35" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-35" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-35" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: &[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">15</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%26%5Bu8;+16%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%26%5Bu8;+16%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><&[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">16</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-37" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-37" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-37" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-37" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: &[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">16</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%26%5Bu8;+17%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%26%5Bu8;+17%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><&[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">17</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-39" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-39" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-39" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-39" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: &[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">17</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%26%5Bu8;+18%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%26%5Bu8;+18%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><&[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">18</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-41" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-41" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-41" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-41" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: &[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">18</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%26%5Bu8;+19%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%26%5Bu8;+19%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><&[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">19</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-43" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-43" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-43" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-43" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: &[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">19</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%26%5Bu8;+2%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%26%5Bu8;+2%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><&[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">2</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-9" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-9" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-9" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-9" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: &[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">2</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%26%5Bu8;+20%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%26%5Bu8;+20%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><&[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">20</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-45" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-45" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-45" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-45" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: &[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">20</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%26%5Bu8;+21%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%26%5Bu8;+21%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><&[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">21</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-47" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-47" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-47" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-47" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: &[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">21</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%26%5Bu8;+22%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%26%5Bu8;+22%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><&[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">22</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-49" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-49" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-49" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-49" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: &[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">22</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%26%5Bu8;+23%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%26%5Bu8;+23%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><&[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">23</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-51" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-51" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-51" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-51" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: &[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">23</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%26%5Bu8;+24%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%26%5Bu8;+24%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><&[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">24</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-53" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-53" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-53" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-53" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: &[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">24</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%26%5Bu8;+25%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%26%5Bu8;+25%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><&[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">25</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-55" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-55" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-55" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-55" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: &[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">25</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%26%5Bu8;+26%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%26%5Bu8;+26%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><&[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">26</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-57" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-57" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-57" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-57" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: &[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">26</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%26%5Bu8;+27%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%26%5Bu8;+27%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><&[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">27</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-59" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-59" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-59" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-59" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: &[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">27</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%26%5Bu8;+28%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%26%5Bu8;+28%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><&[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">28</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-61" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-61" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-61" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-61" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: &[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">28</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%26%5Bu8;+29%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%26%5Bu8;+29%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><&[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">29</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-63" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-63" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-63" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-63" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: &[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">29</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%26%5Bu8;+3%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%26%5Bu8;+3%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><&[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">3</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-11" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-11" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-11" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-11" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: &[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">3</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%26%5Bu8;+30%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%26%5Bu8;+30%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><&[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">30</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-65" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-65" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-65" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-65" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: &[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">30</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%26%5Bu8;+31%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%26%5Bu8;+31%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><&[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">31</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-67" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-67" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-67" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-67" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: &[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">31</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%26%5Bu8;+32%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%26%5Bu8;+32%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><&[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">32</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-69" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-69" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-69" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-69" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: &[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">32</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%26%5Bu8;+4%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%26%5Bu8;+4%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><&[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">4</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-13" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-13" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-13" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-13" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: &[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">4</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%26%5Bu8;+5%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%26%5Bu8;+5%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><&[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">5</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-15" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-15" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-15" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-15" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: &[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">5</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%26%5Bu8;+6%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%26%5Bu8;+6%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><&[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">6</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-17" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-17" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-17" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-17" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: &[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">6</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%26%5Bu8;+7%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%26%5Bu8;+7%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><&[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">7</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-19" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-19" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-19" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-19" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: &[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">7</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%26%5Bu8;+8%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%26%5Bu8;+8%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><&[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">8</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-21" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-21" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-21" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-21" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: &[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">8</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%26%5Bu8;+9%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%26%5Bu8;+9%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><&[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">9</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-23" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-23" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-23" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-23" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: &[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">9</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%5Bu8;+0%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%5Bu8;+0%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">0</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-4" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-4" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-4" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-4" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">0</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%5Bu8;+1%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%5Bu8;+1%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">1</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-6" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-6" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-6" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-6" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">1</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%5Bu8;+10%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%5Bu8;+10%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">10</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-24" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-24" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-24" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-24" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">10</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%5Bu8;+11%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%5Bu8;+11%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">11</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-26" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-26" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-26" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-26" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">11</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%5Bu8;+12%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%5Bu8;+12%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">12</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-28" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-28" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-28" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-28" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">12</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%5Bu8;+13%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%5Bu8;+13%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">13</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-30" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-30" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-30" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-30" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">13</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%5Bu8;+14%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%5Bu8;+14%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">14</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-32" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-32" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-32" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-32" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">14</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%5Bu8;+15%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%5Bu8;+15%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">15</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-34" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-34" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-34" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-34" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">15</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%5Bu8;+16%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%5Bu8;+16%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">16</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-36" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-36" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-36" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-36" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">16</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%5Bu8;+17%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%5Bu8;+17%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">17</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-38" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-38" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-38" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-38" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">17</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%5Bu8;+18%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%5Bu8;+18%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">18</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-40" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-40" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-40" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-40" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">18</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%5Bu8;+19%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%5Bu8;+19%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">19</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-42" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-42" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-42" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-42" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">19</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%5Bu8;+2%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%5Bu8;+2%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">2</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-8" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-8" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-8" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-8" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">2</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%5Bu8;+20%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%5Bu8;+20%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">20</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-44" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-44" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-44" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-44" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">20</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%5Bu8;+21%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%5Bu8;+21%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">21</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-46" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-46" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-46" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-46" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">21</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%5Bu8;+22%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%5Bu8;+22%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">22</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-48" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-48" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-48" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-48" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">22</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%5Bu8;+23%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%5Bu8;+23%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">23</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-50" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-50" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-50" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-50" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">23</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%5Bu8;+24%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%5Bu8;+24%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">24</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-52" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-52" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-52" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-52" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">24</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%5Bu8;+25%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%5Bu8;+25%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">25</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-54" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-54" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-54" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-54" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">25</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%5Bu8;+26%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%5Bu8;+26%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">26</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-56" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-56" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-56" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-56" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">26</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%5Bu8;+27%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%5Bu8;+27%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">27</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-58" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-58" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-58" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-58" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">27</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%5Bu8;+28%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%5Bu8;+28%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">28</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-60" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-60" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-60" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-60" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">28</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%5Bu8;+29%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%5Bu8;+29%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">29</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-62" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-62" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-62" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-62" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">29</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%5Bu8;+3%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%5Bu8;+3%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">3</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-10" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-10" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-10" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-10" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">3</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%5Bu8;+30%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%5Bu8;+30%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">30</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-64" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-64" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-64" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-64" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">30</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%5Bu8;+31%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%5Bu8;+31%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">31</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-66" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-66" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-66" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-66" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">31</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%5Bu8;+32%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%5Bu8;+32%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">32</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-68" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-68" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-68" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-68" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">32</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%5Bu8;+4%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%5Bu8;+4%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">4</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-12" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-12" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-12" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-12" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">4</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%5Bu8;+5%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%5Bu8;+5%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">5</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-14" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-14" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-14" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-14" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">5</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%5Bu8;+6%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%5Bu8;+6%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">6</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-16" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-16" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-16" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-16" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">6</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%5Bu8;+7%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%5Bu8;+7%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">7</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-18" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-18" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-18" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-18" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">7</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%5Bu8;+8%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%5Bu8;+8%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">8</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-20" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-20" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-20" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-20" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">8</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%5Bu8;+9%5D%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#impl-TryFrom%3C%5Bu8;+9%5D%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">9</a>]> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-22" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#associatedtype.Error-22" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-22" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#240">source</a><a href="#method.try_from-22" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">9</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3CBytes%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#196-204">source</a><a href="#impl-TryFrom%3CBytes%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><Bytes> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-2" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#197">source</a><a href="#associatedtype.Error-2" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-2" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#200-203">source</a><a href="#method.try_from-2" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: Bytes) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3CBytesMut%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#206-214">source</a><a href="#impl-TryFrom%3CBytesMut%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><BytesMut> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-3" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#207">source</a><a href="#associatedtype.Error-3" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-3" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#210-213">source</a><a href="#method.try_from-3" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: BytesMut) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3CVec%3Cu8%3E%3E-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#186-194">source</a><a href="#impl-TryFrom%3CVec%3Cu8%3E%3E-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>>> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-1" class="associatedtype trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#187">source</a><a href="#associatedtype.Error-1" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-1" class="method trait-impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#190-193">source</a><a href="#method.try_from-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><section id="impl-Eq-for-ByteString" class="impl"><a class="src rightside" href="../src/bytestring/lib.rs.html#21">source</a><a href="#impl-Eq-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></div><h2 id="synthetic-implementations" class="section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor">§</a></h2><div id="synthetic-implementations-list"><section id="impl-Freeze-for-ByteString" class="impl"><a href="#impl-Freeze-for-ByteString" class="anchor">§</a><h3 class="code-header">impl !<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Freeze.html" title="trait core::marker::Freeze">Freeze</a> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section><section id="impl-RefUnwindSafe-for-ByteString" class="impl"><a href="#impl-RefUnwindSafe-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section><section id="impl-Send-for-ByteString" class="impl"><a href="#impl-Send-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section><section id="impl-Sync-for-ByteString" class="impl"><a href="#impl-Sync-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section><section id="impl-Unpin-for-ByteString" class="impl"><a href="#impl-Unpin-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section><section id="impl-UnwindSafe-for-ByteString" class="impl"><a href="#impl-UnwindSafe-for-ByteString" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="struct" href="struct.ByteString.html" title="struct bytestring::ByteString">ByteString</a></h3></section></div><h2 id="blanket-implementations" class="section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor">§</a></h2><div id="blanket-implementations-list"><details class="toggle implementors-toggle"><summary><section id="impl-Any-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#138">source</a><a href="#impl-Any-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T<div class="where">where
|
||
T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.type_id" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#139">source</a><a href="#method.type_id" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fn">type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4></section></summary><div class='docblock'>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Borrow%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#209">source</a><a href="#impl-Borrow%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T<div class="where">where
|
||
T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.borrow-1" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#211">source</a><a href="#method.borrow-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow" class="fn">borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&T</a></h4></section></summary><div class='docblock'>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-BorrowMut%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#217">source</a><a href="#impl-BorrowMut%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T<div class="where">where
|
||
T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.borrow_mut" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218">source</a><a href="#method.borrow_mut" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fn">borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut T</a></h4></section></summary><div class='docblock'>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-CloneToUninit-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/clone.rs.html#273">source</a><a href="#impl-CloneToUninit-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.CloneToUninit.html" title="trait core::clone::CloneToUninit">CloneToUninit</a> for T<div class="where">where
|
||
T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.clone_to_uninit" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/clone.rs.html#275">source</a><a href="#method.clone_to_uninit" class="anchor">§</a><h4 class="code-header">unsafe fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.CloneToUninit.html#tymethod.clone_to_uninit" class="fn">clone_to_uninit</a>(&self, dst: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.pointer.html">*mut T</a>)</h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>clone_to_uninit</code>)</span></div></span><div class='docblock'>Performs copy-assignment from <code>self</code> to <code>dst</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.CloneToUninit.html#tymethod.clone_to_uninit">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-From%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#765">source</a><a href="#impl-From%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.from-4" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#768">source</a><a href="#method.from-4" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fn">from</a>(t: T) -> T</h4></section></summary><div class="docblock"><p>Returns the argument unchanged.</p>
|
||
</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Into%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#748-750">source</a><a href="#impl-Into%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T<div class="where">where
|
||
U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.into" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#758">source</a><a href="#method.into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into" class="fn">into</a>(self) -> U</h4></section></summary><div class="docblock"><p>Calls <code>U::from(self)</code>.</p>
|
||
<p>That is, this conversion is whatever the implementation of
|
||
<code><a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for U</code> chooses to do.</p>
|
||
</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-ToOwned-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#82-84">source</a><a href="#impl-ToOwned-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T<div class="where">where
|
||
T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Owned" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#86">source</a><a href="#associatedtype.Owned" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned" class="associatedtype">Owned</a> = T</h4></section></summary><div class='docblock'>The resulting type after obtaining ownership.</div></details><details class="toggle method-toggle" open><summary><section id="method.to_owned" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#87">source</a><a href="#method.to_owned" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned" class="fn">to_owned</a>(&self) -> T</h4></section></summary><div class='docblock'>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.clone_into" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#91">source</a><a href="#method.clone_into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into" class="fn">clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut T</a>)</h4></section></summary><div class='docblock'>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-ToString-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2660">source</a><a href="#impl-ToString-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html" title="trait alloc::string::ToString">ToString</a> for T<div class="where">where
|
||
T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.to_string" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2666">source</a><a href="#method.to_string" class="anchor">§</a><h4 class="code-header">default fn <a href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string" class="fn">to_string</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></h4></section></summary><div class='docblock'>Converts the given value to a <code>String</code>. <a href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-TryFrom%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#805-807">source</a><a href="#impl-TryFrom%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T<div class="where">where
|
||
U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-71" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#809">source</a><a href="#associatedtype.Error-71" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-70" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#812">source</a><a href="#method.try_from-70" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-TryInto%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#790-792">source</a><a href="#impl-TryInto%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T<div class="where">where
|
||
U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-70" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#794">source</a><a href="#associatedtype.Error-70" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error" class="associatedtype">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_into" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#797">source</a><a href="#method.try_into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into" class="fn">try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><section id="impl-DeserializeOwned-for-T" class="impl"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/de/mod.rs.html#614">source</a><a href="#impl-DeserializeOwned-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://docs.rs/serde/1.0.210/serde/de/trait.DeserializeOwned.html" title="trait serde::de::DeserializeOwned">DeserializeOwned</a> for T<div class="where">where
|
||
T: for<'de> <a class="trait" href="https://docs.rs/serde/1.0.210/serde/de/trait.Deserialize.html" title="trait serde::de::Deserialize">Deserialize</a><'de>,</div></h3></section></div><script type="text/json" id="notable-traits-data">{"&[u8]":"<h3>Notable traits for <code>&[<a class=\"primitive\" href=\"https://doc.rust-lang.org/nightly/std/primitive.u8.html\">u8</a>]</code></h3><pre><code><div class=\"where\">impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/io/trait.Read.html\" title=\"trait std::io::Read\">Read</a> for &[<a class=\"primitive\" href=\"https://doc.rust-lang.org/nightly/std/primitive.u8.html\">u8</a>]</div>"}</script></section></div></main></body></html> |