pub struct File {
pub display_type: DisplayType,
pub filename: String,
pub sha: String,
pub mime: String,
pub name: Option<String>,
pub description: Option<String>,
}Fields§
§display_type: DisplayType§filename: String§sha: String§mime: String§name: Option<String>§description: Option<String>Implementations§
Source§impl File
impl File
pub fn new( sha: &str, name: Option<&str>, description: Option<&str>, filename: &str, mime: &str, display_type: DisplayType, ) -> Self
pub fn from_mime(mime_str: &str) -> Result<Self, FromStrError>
pub fn from_mime_guess(mime: MimeGuess) -> Self
pub fn get_key(&self, str: &str) -> Option<&str>
pub fn fill_from_toml_map( self, map: &Map<String, Value>, ) -> Result<Self, FileError>
pub fn fill_from_json_map( self, map: &Map<String, Value>, ) -> Result<Self, FileError>
pub fn to_toml(&self) -> Map<String, Value>
pub fn image() -> Self
pub fn video() -> Self
pub fn audio() -> Self
pub fn download() -> Self
pub fn is_valid(&self) -> bool
pub fn url(&self, config: &FieldConfig) -> String
pub fn into_map( self, field_config_for_render: Option<&FieldConfig>, ) -> OrderMap<&'static str, String>
Source§impl File
impl File
pub fn to_json_schema_property( description: &str, field_path: &ValuePath, field_type: &FieldType, display_type: DisplayType, options: &mut ObjectSchemaOptions, ) -> ObjectSchema
Trait Implementations§
Source§impl<'de> Deserialize<'de> for File
impl<'de> Deserialize<'de> for File
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialOrd for File
impl PartialOrd for File
Source§impl Renderable for File
impl Renderable for File
type Output = RenderedFile
fn rendered(self, field_config: &FieldConfig) -> Self::Output
impl StructuralPartialEq for File
Auto Trait Implementations§
impl Freeze for File
impl RefUnwindSafe for File
impl Send for File
impl Sync for File
impl Unpin for File
impl UnsafeUnpin for File
impl UnwindSafe for File
Blanket Implementations§
impl<T> Any for Twhere
T: Any,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> CloneAny for T
impl<T> CloneAnySend for T
impl<T> CloneAnySendSync for T
impl<T> CloneAnySync for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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 more