[−][src]Struct arraystring::CacheString
Newtype string that occupies 64 bytes in memory and is 64 bytes aligned (full cache line)
63 bytes of string
Methods
impl CacheString[src]
impl CacheStringpub fn new() -> Self | [src] |
Creates new empty CacheString.
let string = CacheString::new(); assert!(string.is_empty());
pub fn try_from_str<S>(s: S) -> Result<Self, OutOfBounds> where | [src] |
Creates new CacheString from string slice if length is lower or equal to capacity, otherwise returns an error.
let string = CacheString::try_from_str("My String")?; assert_eq!(string.as_str(), "My String"); assert_eq!(CacheString::try_from_str("")?.as_str(), ""); let out_of_bounds = "0".repeat(CacheString::capacity() as usize + 1); assert!(CacheString::try_from_str(out_of_bounds).is_err());
pub fn from_str_truncate<S>(string: S) -> Self where | [src] |
Creates new CacheString from string slice truncating size if bigger than capacity.
let string = CacheString::from_str_truncate("My String"); println!("{}", string); let truncate = "0".repeat(CacheString::capacity() as usize + 1); let truncated = "0".repeat(CacheString::capacity().into()); let string = CacheString::from_str_truncate(&truncate); assert_eq!(string.as_str(), truncated);
pub unsafe fn from_str_unchecked<S>(string: S) -> Self where | [src] |
Creates new CacheString from string slice assuming length is appropriate.
Safety
It's UB if string.len() > capacity.
let filled = "0".repeat(CacheString::capacity().into()); let string = unsafe { CacheString::from_str_unchecked(&filled) }; assert_eq!(string.as_str(), filled.as_str()); // Undefined behavior, don't do it // let out_of_bounds = "0".repeat(CacheString::capacity().into() + 1); // let ub = unsafe { CacheString::from_str_unchecked(out_of_bounds) };
pub fn try_from_iterator<U, I>(iter: I) -> Result<Self, OutOfBounds> where | [src] |
Creates new CacheString from string slice iterator if total length is lower or equal to capacity, otherwise returns an error.
let string = CacheString::try_from_iterator(&["My String", " My Other String"][..])?; assert_eq!(string.as_str(), "My String My Other String"); let out_of_bounds = (0..100).map(|_| "000"); assert!(CacheString::try_from_iterator(out_of_bounds).is_err());
pub fn from_iterator<U, I>(iter: I) -> Self where | [src] |
Creates new CacheString from string slice iterator truncating size if bigger than capacity.
let string = CacheString::from_iterator(&["My String", " Other String"][..]); assert_eq!(string.as_str(), "My String Other String"); let out_of_bounds = (0..400).map(|_| "000"); let truncated = "0".repeat(CacheString::capacity().into()); let truncate = CacheString::from_iterator(out_of_bounds); assert_eq!(truncate.as_str(), truncated.as_str());
pub unsafe fn from_iterator_unchecked<U, I>(iter: I) -> Self where | [src] |
Creates new CacheString from string slice iterator assuming length is appropriate.
Safety
It's UB if iter.map(|c| c.len()).sum() > capacity.
let string = unsafe { CacheString::from_iterator_unchecked(&["My String", " My Other String"][..]) }; assert_eq!(string.as_str(), "My String My Other String"); // Undefined behavior, don't do it // let out_of_bounds = (0..400).map(|_| "000"); // let undefined_behavior = unsafe { // CacheString::from_iterator_unchecked(out_of_bounds) // };
pub fn try_from_chars<I>(iter: I) -> Result<Self, OutOfBounds> where | [src] |
Creates new CacheString from char iterator if total length is lower or equal to capacity, otherwise returns an error.
let string = CacheString::try_from_chars("My String".chars())?; assert_eq!(string.as_str(), "My String"); let out_of_bounds = "0".repeat(CacheString::capacity() as usize + 1); assert!(CacheString::try_from_chars(out_of_bounds.chars()).is_err());
pub fn from_chars<I>(iter: I) -> Self where | [src] |
Creates new CacheString from char iterator truncating size if bigger than capacity.
let string = CacheString::from_chars("My String".chars()); assert_eq!(string.as_str(), "My String"); let out_of_bounds = "0".repeat(CacheString::capacity() as usize + 1); let truncated = "0".repeat(CacheString::capacity().into()); let truncate = CacheString::from_chars(out_of_bounds.chars()); assert_eq!(truncate.as_str(), truncated.as_str());
pub unsafe fn from_chars_unchecked<I>(iter: I) -> Self where | [src] |
Creates new CacheString from char iterator assuming length is appropriate.
Safety
It's UB if iter.map(|c| c.len_utf8()).sum() > capacity.
let string = unsafe { CacheString::from_chars_unchecked("My String".chars()) }; assert_eq!(string.as_str(), "My String"); // Undefined behavior, don't do it // let out_of_bounds = "000".repeat(400); // let undefined_behavior = unsafe { CacheString::from_chars_unchecked(out_of_bounds.chars()) };
pub fn try_from_utf8<B>(slice: B) -> Result<Self, Error> where | [src] |
Creates new CacheString from byte slice, returning Utf8 on invalid utf-8 data or OutOfBounds if bigger than capacity
let string = CacheString::try_from_utf8("My String")?; assert_eq!(string.as_str(), "My String"); let invalid_utf8 = [0, 159, 146, 150]; assert_eq!(CacheString::try_from_utf8(invalid_utf8), Err(Error::Utf8)); let out_of_bounds = "0000".repeat(400); assert_eq!(CacheString::try_from_utf8(out_of_bounds.as_bytes()), Err(Error::OutOfBounds));
pub fn from_utf8<B>(slice: B) -> Result<Self, Utf8> where | [src] |
Creates new CacheString from byte slice, returning Utf8 on invalid utf-8 data, truncating if bigger than capacity.
let string = CacheString::from_utf8("My String")?; assert_eq!(string.as_str(), "My String"); let invalid_utf8 = [0, 159, 146, 150]; assert_eq!(CacheString::from_utf8(invalid_utf8), Err(Utf8)); let out_of_bounds = "0".repeat(300); assert_eq!(CacheString::from_utf8(out_of_bounds.as_bytes())?.as_str(), "0".repeat(CacheString::capacity().into()).as_str());
pub unsafe fn from_utf8_unchecked<B>(slice: B) -> Self where | [src] |
Creates new CacheString from byte slice assuming it's utf-8 and of a appropriate size.
Safety
It's UB if slice is not a valid utf-8 string or slice.len() > capacity.
let string = unsafe { CacheString::from_utf8_unchecked("My String") }; assert_eq!(string.as_str(), "My String"); // Undefined behavior, don't do it // let out_of_bounds = "0".repeat(300); // let ub = unsafe { CacheString::from_utf8_unchecked(out_of_bounds)) };
pub fn try_from_utf16<B>(slice: B) -> Result<Self, Error> where | [src] |
Creates new CacheString from u16 slice, returning Utf16 on invalid utf-16 data or OutOfBounds if bigger than capacity
let music = [0xD834, 0xDD1E, 0x006d, 0x0075, 0x0073, 0x0069, 0x0063]; let string = CacheString::try_from_utf16(music)?; assert_eq!(string.as_str(), "𝄞music"); let invalid_utf16 = [0xD834, 0xDD1E, 0x006d, 0x0075, 0xD800, 0x0069, 0x0063]; assert_eq!(CacheString::try_from_utf16(invalid_utf16), Err(Error::Utf16)); let out_of_bounds: Vec<_> = (0..300).map(|_| 0).collect(); assert_eq!(CacheString::try_from_utf16(out_of_bounds), Err(Error::OutOfBounds));
pub fn from_utf16<B>(slice: B) -> Result<Self, Utf16> where | [src] |
Creates new CacheString from u16 slice, returning Utf16 on invalid utf-16 data, truncating if bigger than capacity.
let music = [0xD834, 0xDD1E, 0x006d, 0x0075, 0x0073, 0x0069, 0x0063]; let string = CacheString::from_utf16(music)?; assert_eq!(string.as_str(), "𝄞music"); let invalid_utf16 = [0xD834, 0xDD1E, 0x006d, 0x0075, 0xD800, 0x0069, 0x0063]; assert_eq!(CacheString::from_utf16(invalid_utf16), Err(Utf16)); let out_of_bounds: Vec<u16> = (0..300).map(|_| 0).collect(); assert_eq!(CacheString::from_utf16(out_of_bounds)?.as_str(), "\0".repeat(CacheString::capacity().into()).as_str());
pub fn from_utf16_lossy<B>(slice: B) -> Self where | [src] |
Creates new CacheString from u16 slice, replacing invalid utf-16 data with REPLACEMENT_CHARACTER (\u{FFFD}) and truncating size if bigger than capacity
let music = [0xD834, 0xDD1E, 0x006d, 0x0075, 0x0073, 0x0069, 0x0063]; let string = CacheString::from_utf16_lossy(music); assert_eq!(string.as_str(), "𝄞music"); let invalid_utf16 = [0xD834, 0xDD1E, 0x006d, 0x0075, 0xD800, 0x0069, 0x0063]; assert_eq!(CacheString::from_utf16_lossy(invalid_utf16).as_str(), "𝄞mu\u{FFFD}ic"); let out_of_bounds: Vec<u16> = (0..300).map(|_| 0).collect(); assert_eq!(CacheString::from_utf16_lossy(&out_of_bounds).as_str(), "\0".repeat(CacheString::capacity().into()).as_str());
pub fn capacity() -> u8 | [src] |
Returns maximum string capacity, defined at compile time, it will never change
Should always return 63 bytes
assert_eq!(CacheString::capacity(), 63);
Methods from Deref<Target = ArrayString<U63>>
pub fn as_str(&self) -> &str | [src] |
Extracts a string slice containing the entire ArrayString
let s = SmallString::try_from_str("My String")?; assert_eq!(s.as_str(), "My String");
pub fn as_mut_str(&mut self) -> &mut str | [src] |
Extracts a mutable string slice containing the entire ArrayString
let mut s = SmallString::try_from_str("My String")?; assert_eq!(s.as_mut_str(), "My String");
pub fn as_bytes(&self) -> &[u8] | [src] |
Extracts a byte slice containing the entire ArrayString
let s = SmallString::try_from_str("My String")?; assert_eq!(s.as_bytes(), "My String".as_bytes());
pub unsafe fn as_mut_bytes(&mut self) -> &mut [u8] | [src] |
Extracts a mutable string slice containing the entire ArrayString
let mut s = SmallString::try_from_str("My String")?; assert_eq!(unsafe { s.as_mut_bytes() }, "My String".as_bytes());
pub fn try_push_str<S>(&mut self, string: S) -> Result<(), OutOfBounds> where | [src] |
Pushes string slice to the end of the ArrayString if total size is lower or equal to capacity, otherwise returns an error.
let mut s = MaxString::try_from_str("My String")?; s.try_push_str(" My other String")?; assert_eq!(s.as_str(), "My String My other String"); assert!(s.try_push_str("0".repeat(MaxString::capacity().into())).is_err());
pub fn push_str<S>(&mut self, string: S) where | [src] |
Pushes string slice to the end of the ArrayString truncating total size if bigger than capacity.
let mut s = MaxString::try_from_str("My String")?; s.push_str(" My other String"); assert_eq!(s.as_str(), "My String My other String"); let mut s = SmallString::default(); s.push_str("0".repeat(SmallString::capacity() as usize + 1)); assert_eq!(s.as_str(), "0".repeat(SmallString::capacity().into()).as_str());
pub unsafe fn push_str_unchecked<S>(&mut self, string: S) where | [src] |
Pushes string slice to the end of the ArrayString assuming total size is appropriate.
Safety
It's UB if self.len() + string.len() > capacity.
let mut s = MaxString::try_from_str("My String")?; unsafe { s.push_str_unchecked(" My other String") }; assert_eq!(s.as_str(), "My String My other String"); // Undefined behavior, don't do it // let mut undefined_behavior = SmallString::default(); // undefined_behavior.push_str_unchecked("0".repeat(SmallString::capacity().into() + 1));
pub fn try_push(&mut self, character: char) -> Result<(), OutOfBounds> | [src] |
Inserts character to the end of the ArrayString erroring if total size if bigger than capacity.
let mut s = SmallString::try_from_str("My String")?; s.try_push('!')?; assert_eq!(s.as_str(), "My String!"); let mut s = SmallString::try_from_str(&"0".repeat(SmallString::capacity().into()))?; assert!(s.try_push('!').is_err());
pub unsafe fn push_unchecked(&mut self, ch: char) | [src] |
Inserts character to the end of the ArrayString assuming length is appropriate
Safety
It's UB if self.len() + character.len_utf8() > capacity
let mut s = SmallString::try_from_str("My String")?; unsafe { s.push_unchecked('!') }; assert_eq!(s.as_str(), "My String!"); // s = SmallString::try_from_str(&"0".repeat(SmallString::capacity().into()))?; // Undefined behavior, don't do it // s.push_unchecked('!');
pub fn truncate(&mut self, size: u8) -> Result<(), Utf8> | [src] |
Truncates ArrayString to specified size (if smaller than current size and a valid utf-8 char index).
let mut s = SmallString::try_from_str("My String")?; s.truncate(5)?; assert_eq!(s.as_str(), "My St"); // Does nothing s.truncate(6)?; assert_eq!(s.as_str(), "My St"); // Index is not at a valid char let mut s = SmallString::try_from_str("🤔")?; assert!(s.truncate(1).is_err());
pub fn pop(&mut self) -> Option<char> | [src] |
Removes last character from ArrayString, if any.
let mut s = SmallString::try_from_str("A🤔")?; assert_eq!(s.pop(), Some('🤔')); assert_eq!(s.pop(), Some('A')); assert_eq!(s.pop(), None);
pub fn trim(&mut self) | [src] |
Removes spaces from the beggining and end of the string
let mut string = MaxString::try_from_str(" to be trimmed ")?; string.trim(); assert_eq!(string.as_str(), "to be trimmed"); let mut string = SmallString::try_from_str(" 🤔")?; string.trim(); assert_eq!(string.as_str(), "🤔");
pub fn remove(&mut self, idx: u8) -> Result<char, Error> | [src] |
Removes specified char from ArrayString
let mut s = SmallString::try_from_str("ABCD🤔")?; assert_eq!(s.remove("ABCD🤔".len() as u8), Err(Error::OutOfBounds)); assert_eq!(s.remove(10), Err(Error::OutOfBounds)); assert_eq!(s.remove(6), Err(Error::Utf8)); assert_eq!(s.remove(0), Ok('A')); assert_eq!(s.as_str(), "BCD🤔"); assert_eq!(s.remove(2), Ok('D')); assert_eq!(s.as_str(), "BC🤔");
pub fn retain<F: FnMut(char) -> bool>(&mut self, f: F) | [src] |
Retains only the characters specified by the predicate.
let mut s = SmallString::try_from_str("ABCD🤔")?; s.retain(|c| c != '🤔'); assert_eq!(s.as_str(), "ABCD");
pub fn try_insert(&mut self, idx: u8, ch: char) -> Result<(), Error> | [src] |
Inserts character at specified index, returning error if total length is bigger than capacity.
Returns OutOfBounds if idx is out of bounds and Utf8 if idx is not a char position
let mut s = SmallString::try_from_str("ABCD🤔")?; s.try_insert(1, 'A')?; s.try_insert(2, 'B')?; assert_eq!(s.as_str(), "AABBCD🤔"); assert_eq!(s.try_insert(20, 'C'), Err(Error::OutOfBounds)); assert_eq!(s.try_insert(8, 'D'), Err(Error::Utf8)); let mut s = SmallString::try_from_str(&"0".repeat(SmallString::capacity().into()))?; assert_eq!(s.try_insert(0, 'C'), Err(Error::OutOfBounds));
pub unsafe fn insert_unchecked(&mut self, idx: u8, ch: char) | [src] |
Inserts character at specified index assuming length is appropriate
Safety
It's UB if idx does not lie on a utf-8 char boundary
It's UB if self.len() + character.len_utf8() > capacity
let mut s = SmallString::try_from_str("ABCD🤔")?; unsafe { s.insert_unchecked(1, 'A') }; unsafe { s.insert_unchecked(1, 'B') }; assert_eq!(s.as_str(), "ABABCD🤔"); // Undefined behavior, don't do it // s.insert(20, 'C'); // s.insert(8, 'D');
pub fn try_insert_str<S>(&mut self, idx: u8, s: S) -> Result<(), Error> where | [src] |
Inserts string slice at specified index, returning error if total length is bigger than capacity.
Returns OutOfBounds if idx is out of bounds
Returns Utf8 if idx is not a char position
let mut s = SmallString::try_from_str("ABCD🤔")?; s.try_insert_str(1, "AB")?; s.try_insert_str(1, "BC")?; assert_eq!(s.try_insert_str(1, "0".repeat(SmallString::capacity().into())), Err(Error::OutOfBounds)); assert_eq!(s.as_str(), "ABCABBCD🤔"); assert_eq!(s.try_insert_str(20, "C"), Err(Error::OutOfBounds)); assert_eq!(s.try_insert_str(10, "D"), Err(Error::Utf8));
pub fn insert_str<S>(&mut self, idx: u8, string: S) -> Result<(), Error> where | [src] |
Inserts string slice at specified index, truncating size if bigger than capacity.
Returns OutOfBounds if idx is out of bounds and Utf8 if idx is not a char position
let mut s = SmallString::try_from_str("ABCD🤔")?; s.insert_str(1, "AB")?; s.insert_str(1, "BC")?; assert_eq!(s.as_str(), "ABCABBCD🤔"); assert_eq!(s.insert_str(20, "C"), Err(Error::OutOfBounds)); assert_eq!(s.insert_str(10, "D"), Err(Error::Utf8)); s.clear(); s.insert_str(0, "0".repeat(SmallString::capacity() as usize + 10))?; assert_eq!(s.as_str(), "0".repeat(SmallString::capacity().into()).as_str());
pub unsafe fn insert_str_unchecked<S>(&mut self, idx: u8, string: S) where | [src] |
Inserts string slice at specified index, assuming total length is appropriate.
Safety
It's UB if idx does not lie on a utf-8 char boundary
It's UB if self.len() + string.len() > capacity
let mut s = SmallString::try_from_str("ABCD🤔")?; unsafe { s.insert_str_unchecked(1, "AB") }; unsafe { s.insert_str_unchecked(1, "BC") }; assert_eq!(s.as_str(), "ABCABBCD🤔"); // Undefined behavior, don't do it // unsafe { s.insert_str_unchecked(20, "C") }; // unsafe { s.insert_str_unchecked(10, "D") }; // unsafe { s.insert_str_unchecked(1, "0".repeat(SmallString::capacity().into())) };
pub fn len(&self) -> u8 | [src] |
Returns ArrayString length.
let mut s = SmallString::try_from_str("ABCD")?; assert_eq!(s.len(), 4); s.try_push('🤔')?; // Emojis use 4 bytes (this is the default rust behavior, length of u8) assert_eq!(s.len(), 8);
pub fn is_empty(&self) -> bool | [src] |
Checks if ArrayString is empty.
let mut s = SmallString::try_from_str("ABCD")?; assert!(!s.is_empty()); s.clear(); assert!(s.is_empty());
pub fn split_off(&mut self, at: u8) -> Result<Self, Error> | [src] |
Splits ArrayString in two if at is smaller than self.len().
Returns Utf8 if at does not lie at a valid utf-8 char boundary and OutOfBounds if it's out of bounds
let mut s = SmallString::try_from_str("AB🤔CD")?; assert_eq!(s.split_off(6)?.as_str(), "CD"); assert_eq!(s.as_str(), "AB🤔"); assert_eq!(s.split_off(20), Err(Error::OutOfBounds)); assert_eq!(s.split_off(4), Err(Error::Utf8));
pub fn clear(&mut self) | [src] |
Empties ArrayString
let mut s = SmallString::try_from_str("ABCD")?; assert!(!s.is_empty()); s.clear(); assert!(s.is_empty());
pub fn drain<R>(&mut self, range: R) -> Result<Drain<SIZE>, Error> where | [src] |
Creates a draining iterator that removes the specified range in the ArrayString and yields the removed chars.
Note: The element range is removed even if the iterator is not consumed until the end.
let mut s = SmallString::try_from_str("ABCD🤔")?; assert_eq!(s.drain(..3)?.collect::<Vec<_>>(), vec!['A', 'B', 'C']); assert_eq!(s.as_str(), "D🤔"); assert_eq!(s.drain(3..), Err(Error::Utf8)); assert_eq!(s.drain(10..), Err(Error::OutOfBounds));
pub fn replace_range<S, R>(&mut self, r: R, with: S) -> Result<(), Error> where | [src] |
Removes the specified range of the ArrayString, and replaces it with the given string. The given string doesn't need to have the same length as the range.
let mut s = SmallString::try_from_str("ABCD🤔")?; s.replace_range(2..4, "EFGHI")?; assert_eq!(s.as_str(), "ABEFGHI🤔"); assert_eq!(s.replace_range(9.., "J"), Err(Error::Utf8)); assert_eq!(s.replace_range(..90, "K"), Err(Error::OutOfBounds)); assert_eq!(s.replace_range(0..1, "0".repeat(SmallString::capacity().into())), Err(Error::OutOfBounds));
Trait Implementations
impl PartialEq<CacheString> for CacheString[src]
impl PartialEq<CacheString> for CacheStringfn eq(&self, other: &Self) -> bool | [src] |
| 1.0.0 [src] |
This method tests for !=.
impl<'a, 'b> PartialEq<str> for CacheString[src]
impl<'a, 'b> PartialEq<str> for CacheStringfn eq(&self, other: &str) -> bool | [src] |
| 1.0.0 [src] |
This method tests for !=.
impl Eq for CacheString[src]
impl Eq for CacheStringimpl PartialOrd<CacheString> for CacheString[src]
impl PartialOrd<CacheString> for CacheStringfn partial_cmp(&self, other: &Self) -> Option<Ordering> | [src] |
| 1.0.0 [src] |
This method tests less than (for self and other) and is used by the < operator. Read more
| 1.0.0 [src] |
This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
| 1.0.0 [src] |
This method tests greater than (for self and other) and is used by the > operator. Read more
| 1.0.0 [src] |
This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
impl Ord for CacheString[src]
impl Ord for CacheStringfn cmp(&self, other: &Self) -> Ordering | [src] |
fn max(self, other: Self) -> Self | 1.21.0 [src] |
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self | 1.21.0 [src] |
Compares and returns the minimum of two values. Read more
impl AsRef<str> for CacheString[src]
impl AsRef<str> for CacheStringimpl AsRef<[u8]> for CacheString[src]
impl AsRef<[u8]> for CacheStringimpl Clone for CacheString[src]
impl Clone for CacheStringfn clone(&self) -> CacheString | [src] |
fn clone_from(&mut self, source: &Self) | 1.0.0 [src] |
Performs copy-assignment from source. Read more
impl AsMut<str> for CacheString[src]
impl AsMut<str> for CacheStringimpl Default for CacheString[src]
impl Default for CacheStringfn default() -> CacheString | [src] |
impl Copy for CacheString[src]
impl Copy for CacheStringimpl Display for CacheString[src]
impl Display for CacheStringimpl Debug for CacheString[src]
impl Debug for CacheStringimpl Hash for CacheString[src]
impl Hash for CacheStringfn hash<H: Hasher>(&self, hasher: &mut H) | [src] |
fn hash_slice<H>(data: &[Self], state: &mut H) where | 1.3.0 [src] |
Feeds a slice of this type into the given [Hasher]. Read more
impl<'a> Add<&'a str> for CacheString[src]
impl<'a> Add<&'a str> for CacheStringtype Output = Self
The resulting type after applying the + operator.
fn add(self, other: &str) -> Self::Output | [src] |
impl Deref for CacheString[src]
impl Deref for CacheStringtype Target = ArrayString<U63>
The resulting type after dereferencing.
fn deref(&self) -> &Self::Target | [src] |
impl DerefMut for CacheString[src]
impl DerefMut for CacheStringfn deref_mut(&mut self) -> &mut ArrayString<U63> | [src] |
impl Write for CacheString[src]
impl Write for CacheStringfn write_str(&mut self, slice: &str) -> Result | [src] |
fn write_char(&mut self, c: char) -> Result<(), Error> | 1.1.0 [src] |
Writes a [char] into this writer, returning whether the write succeeded. Read more
fn write_fmt(&mut self, args: Arguments) -> Result<(), Error> | 1.0.0 [src] |
Glue for usage of the [write!] macro with implementors of this trait. Read more
impl FromStr for CacheString[src]
impl FromStr for CacheStringtype Err = OutOfBounds
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err> | [src] |
impl Borrow<str> for CacheString[src]
impl Borrow<str> for CacheStringimpl BorrowMut<str> for CacheString[src]
impl BorrowMut<str> for CacheStringfn borrow_mut(&mut self) -> &mut str | [src] |
impl<QS> SelectableExpression<QS> for CacheString[src]
impl<QS> SelectableExpression<QS> for CacheStringimpl<ST, DB> Queryable<ST, DB> for CacheString where
DB: Backend,
*const str: FromSql<ST, DB>, [src]
impl<ST, DB> Queryable<ST, DB> for CacheString where
DB: Backend,
*const str: FromSql<ST, DB>, type Row = Self
The Rust type you'd like to map from. Read more
fn build(row: Self::Row) -> Self | [src] |
impl<QS> AppearsOnTable<QS> for CacheString[src]
impl<QS> AppearsOnTable<QS> for CacheStringimpl Expression for CacheString[src]
impl Expression for CacheStringtype SqlType = VarChar
The type that this expression represents in SQL
impl<DB> ToSql<Text, DB> for CacheString where
DB: Backend, [src]
impl<DB> ToSql<Text, DB> for CacheString where
DB: Backend, impl<ST, DB> FromSqlRow<ST, DB> for CacheString where
DB: Backend,
*const str: FromSql<ST, DB>, [src]
impl<ST, DB> FromSqlRow<ST, DB> for CacheString where
DB: Backend,
*const str: FromSql<ST, DB>, const FIELDS_NEEDED: usize[src]
fn build_from_row<T: Row<DB>>(row: &mut T) -> Result<Self> | [src] |
impl<ST, DB> FromSql<ST, DB> for CacheString where
DB: Backend,
*const str: FromSql<ST, DB>, [src]
impl<ST, DB> FromSql<ST, DB> for CacheString where
DB: Backend,
*const str: FromSql<ST, DB>, impl<DB> QueryFragment<DB> for CacheString where
DB: Backend + HasSqlType<VarChar>, [src]
impl<DB> QueryFragment<DB> for CacheString where
DB: Backend + HasSqlType<VarChar>, fn walk_ast(&self, pass: AstPass<DB>) -> QueryResult<()> | [src] |
fn to_sql(&self, out: &mut <DB as Backend>::QueryBuilder) -> Result<(), Error> | [src] |
Converts this QueryFragment to its SQL representation. Read more
fn collect_binds( | [src] |
Serializes all bind parameters in this query. Read more
fn is_safe_to_cache_prepared(&self) -> Result<bool, Error> | [src] |
Is this query safe to store in the prepared statement cache? Read more
impl NonAggregate for CacheString[src]
impl NonAggregate for CacheStringimpl Serialize for CacheString[src]
impl Serialize for CacheStringimpl<'a> Deserialize<'a> for CacheString[src]
impl<'a> Deserialize<'a> for CacheStringfn deserialize<D: Deserializer<'a>>(des: D) -> Result<Self, D::Error> | [src] |
Auto Trait Implementations
impl Send for CacheString
impl Send for CacheStringimpl Sync for CacheString
impl Sync for CacheStringBlanket Implementations
impl<T, U> Into for T where
U: From<T>, [src]
impl<T, U> Into for T where
U: From<T>, impl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, impl<T> From for T[src]
impl<T> From for Timpl<T> ToString for T where
T: Display + ?Sized, [src]
impl<T> ToString for T where
T: Display + ?Sized, impl<T, U> TryFrom for T where
T: From<U>, [src]
impl<T, U> TryFrom for T where
T: From<U>, type Error = !
try_from)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> | [src] |
impl<T> Borrow for T where
T: ?Sized, [src]
impl<T> Borrow for T where
T: ?Sized, impl<T> Any for T where
T: 'static + ?Sized, [src]
impl<T> Any for T where
T: 'static + ?Sized, fn get_type_id(&self) -> TypeId | [src] |
impl<T, U> TryInto for T where
U: TryFrom<T>, [src]
impl<T, U> TryInto for T where
U: TryFrom<T>, type Error = <U as TryFrom<T>>::Error
try_from)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error> | [src] |
impl<T> BorrowMut for T where
T: ?Sized, [src]
impl<T> BorrowMut for T where
T: ?Sized, fn borrow_mut(&mut self) -> &mut T | [src] |
impl<T> Same for T[src]
impl<T> Same for Ttype Output = T
Should always be Self
impl<T> NullableExpressionMethods for T where
T: Expression, [src]
impl<T> NullableExpressionMethods for T where
T: Expression, fn nullable(self) -> Nullable<Self> | [src] |
Converts this potentially non-null expression into one which is treated as nullable. This method has no impact on the generated SQL, and is only used to allow certain comparisons that would otherwise fail to compile. Read more
impl<T> ExpressionMethods for T where
T: Expression,
<T as Expression>::SqlType: SingleValue, [src]
impl<T> ExpressionMethods for T where
T: Expression,
<T as Expression>::SqlType: SingleValue, fn eq<T>( | [src] |
Creates a SQL = expression. Read more
fn ne<T>( | [src] |
Creates a SQL != expression. Read more
fn eq_any<T>( | [src] |
Creates a SQL IN statement. Read more
fn ne_any<T>( | [src] |
use ne_all instead
Deprecated alias for ne_all Read more
fn ne_all<T>( | [src] |
Creates a SQL NOT IN statement. Read more
fn is_null(self) -> IsNull<Self> | [src] |
Creates a SQL IS NULL expression. Read more
fn is_not_null(self) -> IsNotNull<Self> | [src] |
Creates a SQL IS NOT NULL expression. Read more
fn gt<T>( | [src] |
Creates a SQL > expression. Read more
fn ge<T>( | [src] |
Creates a SQL >= expression. Read more
fn lt<T>( | [src] |
Creates a SQL < expression. Read more
fn le<T>( | [src] |
Creates a SQL <= expression. Read more
fn between<T, U>( | [src] |
Creates a SQL BETWEEN expression using the given lower and upper bounds. Read more
fn not_between<T, U>( | [src] |
Creates a SQL NOT BETWEEN expression using the given lower and upper bounds. Read more
fn desc(self) -> Desc<Self> | [src] |
Creates a SQL DESC expression, representing this expression in descending order. Read more
fn asc(self) -> Asc<Self> | [src] |
Creates a SQL ASC expression, representing this expression in ascending order. Read more
impl<T> IntoSql for T[src]
impl<T> IntoSql for Tfn into_sql<T>(self) -> Self::Expression where | [src] |
Convert self to an expression for Diesel's query builder. Read more
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression where | [src] |
Convert &self to an expression for Diesel's query builder. Read more
impl<QS, T, DB> BoxableExpression for T where
DB: Backend,
T: Expression + SelectableExpression<QS> + NonAggregate + QueryFragment<DB>, [src]
impl<QS, T, DB> BoxableExpression for T where
DB: Backend,
T: Expression + SelectableExpression<QS> + NonAggregate + QueryFragment<DB>, impl<T> TextExpressionMethods for T where
T: Expression,
<T as Expression>::SqlType: TextOrNullableText, [src]
impl<T> TextExpressionMethods for T where
T: Expression,
<T as Expression>::SqlType: TextOrNullableText, fn concat<T>( | [src] |
Concatenates two strings using the || operator. Read more
fn like<T>( | [src] |
Returns a SQL LIKE expression Read more
fn not_like<T>( | [src] |
Returns a SQL NOT LIKE expression Read more
impl<T> DeserializeOwned for T where
T: Deserialize<'de>, [src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,