pub struct Upload { /* private fields */ }Implementations§
Source§impl Upload
impl Upload
pub fn new() -> Self
pub fn id(self, id: impl Into<SharedString>) -> Self
pub fn files(self, files: impl IntoIterator<Item = UploadFile>) -> Self
pub fn add_file(self, file: UploadFile) -> Self
pub fn list_type(self, list_type: UploadListType) -> Self
pub fn picture_card(self) -> Self
pub fn drag(self, drag: bool) -> Self
pub fn disabled(self, disabled: bool) -> Self
pub fn multiple(self, multiple: bool) -> Self
pub fn limit(self, limit: usize) -> Self
pub fn accept(self, accept: impl Into<SharedString>) -> Self
pub fn max_size(self, bytes: u64) -> Self
pub fn tip(self, tip: impl Into<SharedString>) -> Self
pub fn width(self, width: impl Into<Pixels>) -> Self
pub fn width_lg(self) -> Self
pub fn on_select( self, f: impl Fn(&mut Upload, &mut Context<'_, Upload>) + 'static, ) -> Self
pub fn on_remove( self, f: impl Fn(&mut Upload, UploadFile, &mut Window, &mut Context<'_, Upload>) + 'static, ) -> Self
pub fn set_files(&mut self, files: Vec<UploadFile>, cx: &mut Context<'_, Self>)
pub fn push_file(&mut self, file: UploadFile, cx: &mut Context<'_, Self>)
pub fn file_count(&self) -> usize
pub fn files_ref(&self) -> &[UploadFile]
pub fn selected_paths(&self) -> Vec<PathBuf>
pub fn can_accept_more_len( current_len: usize, limit: Option<usize>, disabled: bool, ) -> bool
pub fn matches_accept_name(name: &str, accept: Option<&str>) -> bool
pub fn validate_file_name_size( name: &str, size: Option<u64>, accept: Option<&str>, max_size: Option<u64>, ) -> Result<(), UploadRejectReason>
pub fn validate_path( path: &Path, accept: Option<&str>, max_size: Option<u64>, ) -> Result<UploadFile, UploadRejectReason>
pub fn remove_file_by_id( &mut self, id: &str, window: &mut Window, cx: &mut Context<'_, Self>, )
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Upload
impl !Send for Upload
impl !Sync for Upload
impl !UnwindSafe for Upload
impl Freeze for Upload
impl Unpin for Upload
impl UnsafeUnpin for Upload
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> 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