pub enum Uri {
Url {
url: String,
},
Bytes {
val: Vec<u8>,
mime: String,
},
}Expand description
A struct which can either store byte information or a url
Variants§
Url
Represents a classic url of any type.
Fields
§
url: StringA url/uri, such as http://www.example.com
Bytes
Used (for ease of use) to represent binary data, will be encoded as base64, and will attempt to be decoded as such aswell.
Implementations§
Source§impl Uri
impl Uri
Sourcepub fn to_sql_raw(
this: Option<Self>,
) -> (Option<String>, Option<Vec<u8>>, Option<String>)
pub fn to_sql_raw( this: Option<Self>, ) -> (Option<String>, Option<Vec<u8>>, Option<String>)
Converts an Uri into something which can be used by a SqlContact
Sourcepub fn try_from_sql_raw(
tup: (Option<String>, Option<Vec<u8>>, Option<String>, String),
) -> Result<Option<Self>, SqlConversionError>
pub fn try_from_sql_raw( tup: (Option<String>, Option<Vec<u8>>, Option<String>, String), ) -> Result<Option<Self>, SqlConversionError>
This should only be used internally.
The first Option<String> is the url, the Option<Vec<u8>> a binary
value and the final Option<String> is the mime.
§Errors
Fails with an incomplete binary.
Trait Implementations§
Source§impl Ord for Uri
impl Ord for Uri
Source§impl PartialOrd for Uri
impl PartialOrd for Uri
impl Eq for Uri
impl StructuralPartialEq for Uri
Auto Trait Implementations§
impl Freeze for Uri
impl RefUnwindSafe for Uri
impl Send for Uri
impl Sync for Uri
impl Unpin for Uri
impl UnwindSafe for Uri
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoSql for T
impl<T> IntoSql for T
Source§fn into_sql<T>(self) -> Self::Expressionwhere
Self: Sized + AsExpression<T>,
fn into_sql<T>(self) -> Self::Expressionwhere
Self: Sized + AsExpression<T>,
Convert
self to an expression for Diesel’s query builder. Read moreSource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expressionwhere
&'a Self: AsExpression<T>,
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expressionwhere
&'a Self: AsExpression<T>,
Convert
&self to an expression for Diesel’s query builder. Read more