Trait sourceview5::prelude::FileExt[][src]

pub trait FileExt: 'static {
    fn check_file_on_disk(&self);
fn get_compression_type(&self) -> CompressionType;
fn get_encoding(&self) -> Option<Encoding>;
fn get_location(&self) -> Option<File>;
fn get_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<P: IsA<File>>(&self, location: Option<&P>);
fn get_property_read_only(&self) -> bool;
fn connect_property_compression_type_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_encoding_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_location_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_newline_type_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_read_only_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; }

Trait containing all File methods.

Implementors

File

Required methods

fn check_file_on_disk(&self)[src]

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 gio::FileMonitor to track those properties, so this function needs to be called instead. Creating lots of gio::FileMonitor’s would take lots of resources.

Since this function is synchronous, it is advised to call it only on local files. See FileExt::is_local.

fn get_compression_type(&self) -> CompressionType[src]

Returns

the compression type.

fn get_encoding(&self) -> Option<Encoding>[src]

The encoding is initially None. After a successful file loading or saving operation, the encoding is non-None.

Returns

the character encoding.

fn get_location(&self) -> Option<File>[src]

Returns

the gio::File.

fn get_newline_type(&self) -> NewlineType[src]

Returns

the newline type.

fn is_deleted(&self) -> bool[src]

Returns whether the file has been deleted. If the File:location is None, returns false.

To have an up-to-date value, you must first call FileExt::check_file_on_disk.

Returns

whether the file has been deleted.

fn is_externally_modified(&self) -> bool[src]

Returns whether the file is externally modified. If the File:location is None, returns false.

To have an up-to-date value, you must first call FileExt::check_file_on_disk.

Returns

whether the file is externally modified.

fn is_local(&self) -> bool[src]

Returns whether the file is local. If the File:location is None, returns false.

Returns

whether the file is local.

fn is_readonly(&self) -> bool[src]

Returns whether the file is read-only. If the File:location is None, returns false.

To have an up-to-date value, you must first call FileExt::check_file_on_disk.

Returns

whether the file is read-only.

fn set_location<P: IsA<File>>(&self, location: Option<&P>)[src]

Sets the location.

location

the new gio::File, or None.

fn get_property_read_only(&self) -> bool[src]

Whether the file is read-only or not. The value of this property is not updated automatically (there is no file monitors).

fn connect_property_compression_type_notify<F: Fn(&Self) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

fn connect_property_encoding_notify<F: Fn(&Self) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

fn connect_property_location_notify<F: Fn(&Self) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

fn connect_property_newline_type_notify<F: Fn(&Self) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

fn connect_property_read_only_notify<F: Fn(&Self) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

Loading content...

Implementors

impl<O: IsA<File>> FileExt for O[src]

Loading content...