Trait sourceview4::prelude::FileExt
source · pub trait FileExt: IsA<File> + Sealed + 'static {
Show 17 methods
// Provided methods
fn check_file_on_disk(&self) { ... }
fn compression_type(&self) -> CompressionType { ... }
fn encoding(&self) -> Option<Encoding> { ... }
fn location(&self) -> Option<File> { ... }
fn newline_type(&self) -> NewlineType { ... }
fn is_deleted(&self) -> bool { ... }
fn is_externally_modified(&self) -> bool { ... }
fn is_local(&self) -> bool { ... }
fn is_readonly(&self) -> bool { ... }
fn set_location(&self, location: Option<&impl IsA<File>>) { ... }
fn set_mount_operation_factory<P: Fn(&File) -> MountOperation + 'static>(
&self,
callback: P
) { ... }
fn is_read_only(&self) -> bool { ... }
fn connect_compression_type_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId { ... }
fn connect_encoding_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId { ... }
fn connect_location_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId { ... }
fn connect_newline_type_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId { ... }
fn connect_read_only_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId { ... }
}
Expand description
Provided Methods§
sourcefn check_file_on_disk(&self)
fn check_file_on_disk(&self)
Checks synchronously the file on disk, to know whether the file is externally modified, or has been deleted, and whether the file is read-only.
File
doesn’t create a GFileMonitor
to track those properties, so
this function needs to be called instead. Creating lots of GFileMonitor
’s
would take lots of resources.
Since this function is synchronous, it is advised to call it only on local
files. See is_local()
.
sourcefn compression_type(&self) -> CompressionType
fn compression_type(&self) -> CompressionType
Returns
the compression type.
sourcefn newline_type(&self) -> NewlineType
fn newline_type(&self) -> NewlineType
Returns
the newline type.
sourcefn is_deleted(&self) -> bool
fn is_deleted(&self) -> bool
Returns whether the file has been deleted. If the
location
is None
, returns false
.
To have an up-to-date value, you must first call
check_file_on_disk()
.
Returns
whether the file has been deleted.
sourcefn is_externally_modified(&self) -> bool
fn is_externally_modified(&self) -> bool
Returns whether the file is externally modified. If the
location
is None
, returns false
.
To have an up-to-date value, you must first call
check_file_on_disk()
.
Returns
whether the file is externally modified.
sourcefn is_readonly(&self) -> bool
fn is_readonly(&self) -> bool
Returns whether the file is read-only. If the
location
is None
, returns false
.
To have an up-to-date value, you must first call
check_file_on_disk()
.
Returns
whether the file is read-only.
sourcefn set_location(&self, location: Option<&impl IsA<File>>)
fn set_location(&self, location: Option<&impl IsA<File>>)
sourcefn set_mount_operation_factory<P: Fn(&File) -> MountOperation + 'static>(
&self,
callback: P
)
fn set_mount_operation_factory<P: Fn(&File) -> MountOperation + 'static>( &self, callback: P )
Sets a GtkSourceMountOperationFactory
function that will be called when a
gio::MountOperation
must be created. This is useful for creating a
GtkMountOperation
with the parent gtk::Window
.
If a mount operation factory isn’t set, gio::MountOperation::new()
will be
called.
callback
a GtkSourceMountOperationFactory
to call when a
gio::MountOperation
is needed.
notify
function to call on user_data
when the callback
is no
longer needed, or None
.
sourcefn is_read_only(&self) -> bool
fn is_read_only(&self) -> bool
Whether the file is read-only or not. The value of this property is not updated automatically (there is no file monitors).