pub struct File(/* private fields */);Implementations§
Source§impl File
impl File
pub fn new_for_commandline_arg<P: AsRef<OsStr>>(arg: P) -> File
pub fn new_for_commandline_arg_and_cwd<P: AsRef<OsStr>, Q: AsRef<Path>>( arg: P, cwd: Q, ) -> File
pub fn new_for_path<P: AsRef<Path>>(path: P) -> File
pub fn new_for_uri(uri: &str) -> File
pub fn new_tmp<P: AsRef<Path>>(tmpl: P) -> Result<(File, FileIOStream), Error>
pub fn parse_name(parse_name: &str) -> Option<File>
Trait Implementations§
Source§impl Ord for File
impl Ord for File
Source§impl<T: ObjectType> PartialEq<T> for File
impl<T: ObjectType> PartialEq<T> for File
Source§impl<T: ObjectType> PartialOrd<T> for File
impl<T: ObjectType> PartialOrd<T> for File
Source§impl StaticType for File
impl StaticType for File
Source§fn static_type() -> Type
fn static_type() -> Type
Returns the type identifier of
Self.impl Eq for File
impl Send for File
impl Sync for File
Auto Trait Implementations§
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> Cast for Twhere
T: ObjectType,
impl<T> Cast for Twhere
T: ObjectType,
Source§fn upcast<T>(self) -> Twhere
T: ObjectType,
Self: IsA<T>,
fn upcast<T>(self) -> Twhere
T: ObjectType,
Self: IsA<T>,
Upcasts an object to a superclass or interface
T. Read moreSource§fn upcast_ref<T>(&self) -> &Twhere
T: ObjectType,
Self: IsA<T>,
fn upcast_ref<T>(&self) -> &Twhere
T: ObjectType,
Self: IsA<T>,
Upcasts an object to a reference of its superclass or interface
T. Read moreSource§fn downcast<T>(self) -> Result<T, Self>where
T: ObjectType,
Self: CanDowncast<T>,
fn downcast<T>(self) -> Result<T, Self>where
T: ObjectType,
Self: CanDowncast<T>,
Tries to downcast to a subclass or interface implementor
T. Read moreSource§fn downcast_ref<T>(&self) -> Option<&T>where
T: ObjectType,
Self: CanDowncast<T>,
fn downcast_ref<T>(&self) -> Option<&T>where
T: ObjectType,
Self: CanDowncast<T>,
Tries to downcast to a reference of its subclass or interface implementor
T. Read moreSource§fn dynamic_cast<T>(self) -> Result<T, Self>where
T: ObjectType,
fn dynamic_cast<T>(self) -> Result<T, Self>where
T: ObjectType,
Tries to cast to an object of type
T. This handles upcasting, downcasting
and casting between interface and interface implementors. All checks are performed at
runtime, while downcast and upcast will do many checks at compile-time already. Read moreSource§fn dynamic_cast_ref<T>(&self) -> Option<&T>where
T: ObjectType,
fn dynamic_cast_ref<T>(&self) -> Option<&T>where
T: ObjectType,
Tries to cast to reference to an object of type
T. This handles upcasting, downcasting
and casting between interface and interface implementors. All checks are performed at
runtime, while downcast and upcast will do many checks at compile-time already. Read moreSource§unsafe fn unsafe_cast<T>(self) -> Twhere
T: ObjectType,
unsafe fn unsafe_cast<T>(self) -> Twhere
T: ObjectType,
Casts to
T unconditionally. Read moreSource§unsafe fn unsafe_cast_ref<T>(&self) -> &Twhere
T: ObjectType,
unsafe fn unsafe_cast_ref<T>(&self) -> &Twhere
T: ObjectType,
Casts to
&T unconditionally. Read moreSource§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<O> FileExt for O
impl<O> FileExt for O
fn append_to<P>(
&self,
flags: FileCreateFlags,
cancellable: Option<&P>,
) -> Result<FileOutputStream, Error>where
P: IsA<Cancellable>,
fn append_to_async<P, Q>( &self, flags: FileCreateFlags, io_priority: Priority, cancellable: Option<&P>, callback: Q, )
fn copy<P, Q>( &self, destination: &P, flags: FileCopyFlags, cancellable: Option<&Q>, progress_callback: Option<&mut dyn FnMut(i64, i64)>, ) -> Result<(), Error>
fn copy_attributes<P, Q>( &self, destination: &P, flags: FileCopyFlags, cancellable: Option<&Q>, ) -> Result<(), Error>
fn create<P>(
&self,
flags: FileCreateFlags,
cancellable: Option<&P>,
) -> Result<FileOutputStream, Error>where
P: IsA<Cancellable>,
fn create_async<P, Q>( &self, flags: FileCreateFlags, io_priority: Priority, cancellable: Option<&P>, callback: Q, )
fn create_readwrite<P>(
&self,
flags: FileCreateFlags,
cancellable: Option<&P>,
) -> Result<FileIOStream, Error>where
P: IsA<Cancellable>,
fn create_readwrite_async<P, Q>( &self, flags: FileCreateFlags, io_priority: Priority, cancellable: Option<&P>, callback: Q, )
fn delete<P>(&self, cancellable: Option<&P>) -> Result<(), Error>where
P: IsA<Cancellable>,
fn delete_async<P, Q>( &self, io_priority: Priority, cancellable: Option<&P>, callback: Q, )
fn dup(&self) -> Option<File>
fn eject_mountable_with_operation<P, Q, R>( &self, flags: MountUnmountFlags, mount_operation: Option<&P>, cancellable: Option<&Q>, callback: R, )
fn equal<P>(&self, file2: &P) -> bool
fn find_enclosing_mount<P>(
&self,
cancellable: Option<&P>,
) -> Result<Mount, Error>where
P: IsA<Cancellable>,
fn get_basename(&self) -> Option<PathBuf>
fn get_child<P>(&self, name: P) -> Option<File>
fn get_child_for_display_name(&self, display_name: &str) -> Result<File, Error>
fn get_parent(&self) -> Option<File>
fn get_parse_name(&self) -> Option<GString>
fn get_path(&self) -> Option<PathBuf>
fn get_relative_path<P>(&self, descendant: &P) -> Option<PathBuf>
fn get_uri(&self) -> GString
fn get_uri_scheme(&self) -> GString
fn has_parent<P>(&self, parent: Option<&P>) -> bool
fn has_prefix<P>(&self, prefix: &P) -> bool
fn has_uri_scheme(&self, uri_scheme: &str) -> bool
fn is_native(&self) -> bool
fn load_contents<P>(
&self,
cancellable: Option<&P>,
) -> Result<(Vec<u8>, GString), Error>where
P: IsA<Cancellable>,
fn load_contents_async<P, Q>(&self, cancellable: Option<&P>, callback: Q)
fn make_directory<P>(&self, cancellable: Option<&P>) -> Result<(), Error>where
P: IsA<Cancellable>,
fn make_directory_async<P, Q>( &self, io_priority: Priority, cancellable: Option<&P>, callback: Q, )
fn make_directory_with_parents<P>(
&self,
cancellable: Option<&P>,
) -> Result<(), Error>where
P: IsA<Cancellable>,
fn make_symbolic_link<P, Q>( &self, symlink_value: P, cancellable: Option<&Q>, ) -> Result<(), Error>
fn measure_disk_usage<P>(
&self,
flags: FileMeasureFlags,
cancellable: Option<&P>,
progress_callback: Option<Box<dyn Fn(bool, u64, u64, u64)>>,
) -> Result<(u64, u64, u64), Error>where
P: IsA<Cancellable>,
fn monitor<P>(
&self,
flags: FileMonitorFlags,
cancellable: Option<&P>,
) -> Result<FileMonitor, Error>where
P: IsA<Cancellable>,
fn monitor_directory<P>(
&self,
flags: FileMonitorFlags,
cancellable: Option<&P>,
) -> Result<FileMonitor, Error>where
P: IsA<Cancellable>,
fn monitor_file<P>(
&self,
flags: FileMonitorFlags,
cancellable: Option<&P>,
) -> Result<FileMonitor, Error>where
P: IsA<Cancellable>,
fn mount_enclosing_volume<P, Q, R>( &self, flags: MountMountFlags, mount_operation: Option<&P>, cancellable: Option<&Q>, callback: R, )
fn mount_mountable<P, Q, R>( &self, flags: MountMountFlags, mount_operation: Option<&P>, cancellable: Option<&Q>, callback: R, )
fn move_<P, Q>( &self, destination: &P, flags: FileCopyFlags, cancellable: Option<&Q>, progress_callback: Option<&mut dyn FnMut(i64, i64)>, ) -> Result<(), Error>
fn open_readwrite<P>(
&self,
cancellable: Option<&P>,
) -> Result<FileIOStream, Error>where
P: IsA<Cancellable>,
fn open_readwrite_async<P, Q>( &self, io_priority: Priority, cancellable: Option<&P>, callback: Q, )
fn poll_mountable<P, Q>(&self, cancellable: Option<&P>, callback: Q)
fn query_default_handler<P>(
&self,
cancellable: Option<&P>,
) -> Result<AppInfo, Error>where
P: IsA<Cancellable>,
fn query_exists<P>(&self, cancellable: Option<&P>) -> boolwhere
P: IsA<Cancellable>,
fn query_file_type<P>(
&self,
flags: FileQueryInfoFlags,
cancellable: Option<&P>,
) -> FileTypewhere
P: IsA<Cancellable>,
fn query_filesystem_info<P>(
&self,
attributes: &str,
cancellable: Option<&P>,
) -> Result<FileInfo, Error>where
P: IsA<Cancellable>,
fn query_filesystem_info_async<P, Q>( &self, attributes: &str, io_priority: Priority, cancellable: Option<&P>, callback: Q, )
fn query_info<P>(
&self,
attributes: &str,
flags: FileQueryInfoFlags,
cancellable: Option<&P>,
) -> Result<FileInfo, Error>where
P: IsA<Cancellable>,
fn query_info_async<P, Q>( &self, attributes: &str, flags: FileQueryInfoFlags, io_priority: Priority, cancellable: Option<&P>, callback: Q, )
fn read<P>(&self, cancellable: Option<&P>) -> Result<FileInputStream, Error>where
P: IsA<Cancellable>,
fn read_async<P, Q>( &self, io_priority: Priority, cancellable: Option<&P>, callback: Q, )
fn replace<P>(
&self,
etag: Option<&str>,
make_backup: bool,
flags: FileCreateFlags,
cancellable: Option<&P>,
) -> Result<FileOutputStream, Error>where
P: IsA<Cancellable>,
fn replace_async<P, Q>( &self, etag: Option<&str>, make_backup: bool, flags: FileCreateFlags, io_priority: Priority, cancellable: Option<&P>, callback: Q, )
fn replace_contents<P>(
&self,
contents: &[u8],
etag: Option<&str>,
make_backup: bool,
flags: FileCreateFlags,
cancellable: Option<&P>,
) -> Result<GString, Error>where
P: IsA<Cancellable>,
fn replace_readwrite<P>(
&self,
etag: Option<&str>,
make_backup: bool,
flags: FileCreateFlags,
cancellable: Option<&P>,
) -> Result<FileIOStream, Error>where
P: IsA<Cancellable>,
fn replace_readwrite_async<P, Q>( &self, etag: Option<&str>, make_backup: bool, flags: FileCreateFlags, io_priority: Priority, cancellable: Option<&P>, callback: Q, )
fn resolve_relative_path<P>(&self, relative_path: P) -> Option<File>
fn set_attribute_byte_string<P>(
&self,
attribute: &str,
value: &str,
flags: FileQueryInfoFlags,
cancellable: Option<&P>,
) -> Result<(), Error>where
P: IsA<Cancellable>,
fn set_attribute_int32<P>(
&self,
attribute: &str,
value: i32,
flags: FileQueryInfoFlags,
cancellable: Option<&P>,
) -> Result<(), Error>where
P: IsA<Cancellable>,
fn set_attribute_int64<P>(
&self,
attribute: &str,
value: i64,
flags: FileQueryInfoFlags,
cancellable: Option<&P>,
) -> Result<(), Error>where
P: IsA<Cancellable>,
fn set_attribute_string<P>(
&self,
attribute: &str,
value: &str,
flags: FileQueryInfoFlags,
cancellable: Option<&P>,
) -> Result<(), Error>where
P: IsA<Cancellable>,
fn set_attribute_uint32<P>(
&self,
attribute: &str,
value: u32,
flags: FileQueryInfoFlags,
cancellable: Option<&P>,
) -> Result<(), Error>where
P: IsA<Cancellable>,
fn set_attribute_uint64<P>(
&self,
attribute: &str,
value: u64,
flags: FileQueryInfoFlags,
cancellable: Option<&P>,
) -> Result<(), Error>where
P: IsA<Cancellable>,
fn set_attributes_async<P, Q>( &self, info: &FileInfo, flags: FileQueryInfoFlags, io_priority: Priority, cancellable: Option<&P>, callback: Q, )
fn set_attributes_from_info<P>(
&self,
info: &FileInfo,
flags: FileQueryInfoFlags,
cancellable: Option<&P>,
) -> Result<(), Error>where
P: IsA<Cancellable>,
fn set_display_name<P>(
&self,
display_name: &str,
cancellable: Option<&P>,
) -> Result<File, Error>where
P: IsA<Cancellable>,
fn set_display_name_async<P, Q>( &self, display_name: &str, io_priority: Priority, cancellable: Option<&P>, callback: Q, )
fn start_mountable<P, Q, R>( &self, flags: DriveStartFlags, start_operation: Option<&P>, cancellable: Option<&Q>, callback: R, )
fn stop_mountable<P, Q, R>( &self, flags: MountUnmountFlags, mount_operation: Option<&P>, cancellable: Option<&Q>, callback: R, )
fn supports_thread_contexts(&self) -> bool
fn trash<P>(&self, cancellable: Option<&P>) -> Result<(), Error>where
P: IsA<Cancellable>,
fn trash_async<P, Q>( &self, io_priority: Priority, cancellable: Option<&P>, callback: Q, )
fn unmount_mountable_with_operation<P, Q, R>( &self, flags: MountUnmountFlags, mount_operation: Option<&P>, cancellable: Option<&Q>, callback: R, )
Source§impl<O> FileExtManual for O
impl<O> FileExtManual for O
Source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> ObjectExt for Twhere
T: ObjectType,
impl<T> ObjectExt for Twhere
T: ObjectType,
Source§fn is<U>(&self) -> boolwhere
U: StaticType,
fn is<U>(&self) -> boolwhere
U: StaticType,
Returns
true if the object is an instance of (can be cast to) T.fn get_type(&self) -> Type
fn get_object_class(&self) -> &ObjectClass
fn set_property<'a, N>( &self, property_name: N, value: &dyn ToValue, ) -> Result<(), BoolError>
fn get_property<'a, N>(&self, property_name: N) -> Result<Value, BoolError>
fn block_signal(&self, handler_id: &SignalHandlerId)
fn unblock_signal(&self, handler_id: &SignalHandlerId)
fn stop_signal_emission(&self, signal_name: &str)
fn disconnect(&self, handler_id: SignalHandlerId)
fn connect_notify<F>(&self, name: Option<&str>, f: F) -> SignalHandlerId
unsafe fn connect_notify_unsafe<F>( &self, name: Option<&str>, f: F, ) -> SignalHandlerId
fn notify<'a, N>(&self, property_name: N)
fn notify_by_pspec(&self, pspec: &ParamSpec)
fn has_property<'a, N>( &self, property_name: N, type_: Option<Type>, ) -> Result<(), BoolError>
fn get_property_type<'a, N>(&self, property_name: N) -> Option<Type>
fn find_property<'a, N>(&self, property_name: N) -> Option<ParamSpec>
fn list_properties(&self) -> Vec<ParamSpec>
fn connect<'a, N, F>( &self, signal_name: N, after: bool, callback: F, ) -> Result<SignalHandlerId, BoolError>
unsafe fn connect_unsafe<'a, N, F>( &self, signal_name: N, after: bool, callback: F, ) -> Result<SignalHandlerId, BoolError>
fn emit<'a, N>( &self, signal_name: N, args: &[&dyn ToValue], ) -> Result<Option<Value>, BoolError>
fn downgrade(&self) -> WeakRef<T>
fn bind_property<'a, O, N, M>( &'a self, source_property: N, target: &'a O, target_property: M, ) -> BindingBuilder<'a>
fn ref_count(&self) -> u32
Source§impl<T> ToSendValue for T
impl<T> ToSendValue for T
Source§fn to_send_value(&self) -> SendValue
fn to_send_value(&self) -> SendValue
Returns a
SendValue clone of self.