[−][src]Struct cql_tiny_text::TinyText
Tuple wrapping String
for working with TinyText
values in a CQL database.
Limited in size to 255 * 4 = 1020
bytes.
Methods
impl TinyText
[src]
Trait Implementations
impl Clone for TinyText
[src]
impl CqlReadable for TinyText
[src]
impl CqlStreamReadable for TinyText
[src]
fn read_to_stream(
db_location: &str,
stream: &mut dyn Write,
value_location: u64,
n_values: u64
) -> Result<()>
[src]
db_location: &str,
stream: &mut dyn Write,
value_location: u64,
n_values: u64
) -> Result<()>
impl CqlType for TinyText
[src]
type ValueType = Self
The type of value to read/write from the database.
const VALUE_SIZE: usize
[src]
impl CqlWritable for TinyText
[src]
fn write_to_db(
db_location: &str,
value_location: u64,
input_value: Self::ValueType
) -> Result<()>
[src]
db_location: &str,
value_location: u64,
input_value: Self::ValueType
) -> Result<()>
impl Debug for TinyText
[src]
impl Default for TinyText
[src]
impl Display for TinyText
[src]
impl Eq for TinyText
[src]
impl From<TinyText> for String
[src]
impl Hash for TinyText
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for TinyText
[src]
fn cmp(&self, other: &TinyText) -> Ordering
[src]
#[must_use]
fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]
fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]
fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<TinyText> for TinyText
[src]
impl PartialOrd<TinyText> for TinyText
[src]
fn partial_cmp(&self, other: &TinyText) -> Option<Ordering>
[src]
fn lt(&self, other: &TinyText) -> bool
[src]
fn le(&self, other: &TinyText) -> bool
[src]
fn gt(&self, other: &TinyText) -> bool
[src]
fn ge(&self, other: &TinyText) -> bool
[src]
impl StructuralEq for TinyText
[src]
impl StructuralPartialEq for TinyText
[src]
impl<'_> TryFrom<&'_ str> for TinyText
[src]
Attempts to convert the given &str to TinyText. Errors if the length of the &str excedes 1020 bytes.
Examples
use std::convert::TryFrom; let small_string = "s".repeat(1020); // 1 byte per char assert_eq!("s".repeat(1020), String::from(TinyText::try_from(small_string).unwrap())); let big_string = "s".repeat(1021); assert_eq!(Err(ValueTooLargeError), TinyText::try_from(big_string)); let small_utf8_string = "س".repeat(510); // 2 bytes per char assert_eq!("س".repeat(510), String::from(TinyText::try_from(small_utf8_string).unwrap())); let big_utf8_string = "س".repeat(511); assert_eq!(Err(ValueTooLargeError), TinyText::try_from(big_utf8_string));
type Error = ValueTooLargeError
The type returned in the event of a conversion error.
fn try_from(value: &str) -> Result<Self, Self::Error>
[src]
impl TryFrom<String> for TinyText
[src]
Attempts to convert the given string to TinyText. Errors if the length of the String excedes 1020 bytes.
Errors
Will return a ValueTooLargeError if the given string is larger than 1020 bytes.
Examples
use std::convert::TryFrom; let small_string = "s".repeat(1020); // 1 byte per char assert_eq!("s".repeat(1020), String::from(TinyText::try_from(small_string).unwrap())); let big_string = "s".repeat(1021); assert_eq!(Err(ValueTooLargeError), TinyText::try_from(big_string)); let small_utf8_string = "س".repeat(510); // 2 bytes per char assert_eq!("س".repeat(510), String::from(TinyText::try_from(small_utf8_string).unwrap())); let big_utf8_string = "س".repeat(511); assert_eq!(Err(ValueTooLargeError), TinyText::try_from(big_utf8_string));
Auto Trait Implementations
impl RefUnwindSafe for TinyText
impl Send for TinyText
impl Sync for TinyText
impl Unpin for TinyText
impl UnwindSafe for TinyText
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
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, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,