Struct poppler::Document

source ·
pub struct Document { /* private fields */ }
Expand description

§Properties

§author

The author of the document

Readable | Writeable

§creation-date

The date the document was created as seconds since the Epoch, or -1

Readable | Writeable

§creation-datetime

The [glib::DateTime][crate::glib::DateTime] the document was created.

Readable | Writeable

§creator

The creator of the document. See also Document::creator()

Readable | Writeable

§format

The PDF version as string. See also Document::pdf_version_string()

Readable

§format-major

The PDF major version number. See also Document::pdf_version()

Readable

§format-minor

The PDF minor version number. See also Document::pdf_version()

Readable

§keywords

The keywords associated to the document

Readable | Writeable

§linearized

Whether document is linearized. See also Document::is_linearized()

Readable

§metadata

Document metadata in XML format, or None

Readable

§mod-date

The date the document was most recently modified as seconds since the Epoch, or -1

Readable | Writeable

§mod-datetime

The [glib::DateTime][crate::glib::DateTime] the document was most recently modified.

Readable | Writeable

§page-layout

The page layout that should be used when the document is opened

Readable

§page-mode

The mode that should be used when the document is opened

Readable

§permissions

Flags specifying which operations are permitted when the document is opened

Readable

Readable

Suggested number of copies to be printed for this document

Readable

Readable

§producer

The producer of the document. See also Document::producer()

Readable | Writeable

§subject

The subject of the document

Readable | Writeable

§subtype

Document PDF subtype type

Readable

§subtype-conformance

Document PDF subtype conformance

Readable

§subtype-part

Document PDF subtype part

Readable

§subtype-string

Document PDF subtype. See also Document::pdf_subtype_string()

Readable

§title

The document’s title or None

Readable | Writeable

§viewer-preferences

Readable

GLib type: GObject with reference counted clone semantics.

Implementations§

source§

impl Document

source

pub fn from_bytes( bytes: &Bytes, password: Option<&str>, ) -> Result<Document, Error>

Available on crate feature v0_82 only.

Creates a new Document from bytes. The returned document will hold a reference to bytes.

On error, None is returned, with error set. Possible errors include those in the POPPLER_ERROR and G_FILE_ERROR domains.

§bytes

a [glib::Bytes][crate::glib::Bytes]

§password

password to unlock the file with, or None

§Returns

a newly created Document, or None

source

pub fn from_data(data: &[u8], password: Option<&str>) -> Result<Document, Error>

👎Deprecated: Since 0.82

Creates a new Document. If None is returned, then error will be set. Possible errors include those in the POPPLER_ERROR and G_FILE_ERROR domains.

Note that data is not copied nor is a new reference to it created. It must remain valid and cannot be destroyed as long as the returned document exists.

§Deprecated since 0.82

This requires directly managing length and data. Use from_bytes() instead.

§data

the pdf data

§password

password to unlock the file with, or None

§Returns

A newly created Document, or None

source

pub fn from_fd(fd: i32, password: Option<&str>) -> Result<Document, Error>

Available on crate feature v21_12 only.

Creates a new Document reading the PDF contents from the file descriptor fd. fd must refer to a regular file, or STDIN, and be open for reading. Possible errors include those in the POPPLER_ERROR and G_FILE_ERROR domains. Note that this function takes ownership of fd; you must not operate on it again, nor close it.

§fd

a valid file descriptor

§password

password to unlock the file with, or None

§Returns

a new Document, or None

source

pub fn from_file(uri: &str, password: Option<&str>) -> Result<Document, Error>

Creates a new Document. If None is returned, then error will be set. Possible errors include those in the POPPLER_ERROR and G_FILE_ERROR domains.

§uri

uri of the file to load

§password

password to unlock the file with, or None

§Returns

A newly created Document, or None

source

pub fn from_gfile( file: &impl IsA<File>, password: Option<&str>, cancellable: Option<&impl IsA<Cancellable>>, ) -> Result<Document, Error>

Creates a new Document reading the PDF contents from file. Possible errors include those in the POPPLER_ERROR and G_FILE_ERROR domains.

§file

a [gio::File][crate::gio::File] to load

§password

password to unlock the file with, or None

§cancellable

a [gio::Cancellable][crate::gio::Cancellable], or None

§Returns

a new Document, or None

source

pub fn from_stream( stream: &impl IsA<InputStream>, length: i64, password: Option<&str>, cancellable: Option<&impl IsA<Cancellable>>, ) -> Result<Document, Error>

Creates a new Document reading the PDF contents from stream. Note that the given [gio::InputStream][crate::gio::InputStream] must be seekable or G_IO_ERROR_NOT_SUPPORTED will be returned. Possible errors include those in the POPPLER_ERROR, G_FILE_ERROR and G_IO_ERROR domains.

§stream

a [gio::InputStream][crate::gio::InputStream] to read from

§length

the stream length, or -1 if not known

§password

password to unlock the file with, or None

§cancellable

a [gio::Cancellable][crate::gio::Cancellable], or None

§Returns

a new Document, or None

source

pub fn builder() -> DocumentBuilder

Creates a new builder-pattern struct instance to construct Document objects.

This method returns an instance of DocumentBuilder which can be used to create Document objects.

source

pub fn find_dest(&self, link_name: &str) -> Option<Dest>

Creates a Dest for the named destination link_name in self.

Note that named destinations are bytestrings, not string. That means that unless link_name was returned by a poppler function (e.g. is PopplerDest.named_dest), it needs to be converted to string using named_dest_from_bytestring() before being passed to this function.

The returned value must be freed with poppler_dest_free().

a named destination

§Returns

a new Dest destination, or None if link_name is not a destination.

source

pub fn attachments(&self) -> Vec<Attachment>

Returns a GList containing Attachments. These attachments are unowned, and must be unreffed, and the list must be freed with g_list_free().

§Returns

a list of available attachments.

source

pub fn author(&self) -> Option<GString>

Returns the author of the document

§Returns

a new allocated string containing the author of self, or None

source

pub fn creation_date(&self) -> c_long

Returns the date the document was created as seconds since the Epoch

§Returns

the date the document was created, or -1

source

pub fn creation_date_time(&self) -> Option<DateTime>

Available on crate feature v20_9 only.

Returns the date the document was created as a [glib::DateTime][crate::glib::DateTime]

§Returns

the date the document was created, or None

source

pub fn creator(&self) -> Option<GString>

Returns the creator of the document. If the document was converted from another format, the creator is the name of the product that created the original document from which it was converted.

§Returns

a new allocated string containing the creator of self, or None

source

pub fn form_field(&self, id: i32) -> Option<FormField>

Returns the FormField for the given id. It must be freed with g_object_unref()

§id

an id of a FormField

§Returns

a new FormField or None if not found

source

pub fn id(&self) -> Option<(GString, GString)>

Returns the PDF file identifier represented as two byte string arrays of size 32. permanent_id is the permanent identifier that is built based on the file contents at the time it was originally created, so that this identifer never changes. update_id is the update identifier that is built based on the file contents at the time it was last updated.

Note that returned strings are not null-terminated, they have a fixed size of 32 bytes.

§Returns

true if the self contains an id, false otherwise

§permanent_id

location to store an allocated string, use g_free() to free the returned string

§update_id

location to store an allocated string, use g_free() to free the returned string

source

pub fn keywords(&self) -> Option<GString>

Returns the keywords associated to the document

§Returns

a new allocated string containing keywords associated to self, or None

source

pub fn metadata(&self) -> Option<GString>

Returns the XML metadata string of the document

§Returns

a new allocated string containing the XML metadata, or None

source

pub fn modification_date(&self) -> c_long

Returns the date the document was most recently modified as seconds since the Epoch

§Returns

the date the document was most recently modified, or -1

source

pub fn modification_date_time(&self) -> Option<DateTime>

Available on crate feature v20_9 only.

Returns the date the document was most recently modified as a [glib::DateTime][crate::glib::DateTime]

§Returns

the date the document was modified, or None

source

pub fn n_attachments(&self) -> u32

Returns the number of attachments in a loaded document. See also attachments()

§Returns

Number of attachments

source

pub fn n_pages(&self) -> i32

Returns the number of pages in a loaded document.

§Returns

Number of pages

source

pub fn n_signatures(&self) -> i32

Available on crate feature v21_12 only.

Returns how many digital signatures self contains. PDF digital signatures ensure that the content hash not been altered since last edit and that it was produced by someone the user can trust

§Returns

The number of signatures found in the document

source

pub fn page(&self, index: i32) -> Option<Page>

Returns the Page indexed at index. This object is owned by the caller.

§index

a page index

§Returns

The Page at index

source

pub fn page_by_label(&self, label: &str) -> Option<Page>

Returns the Page reference by label. This object is owned by the caller. label is a human-readable string representation of the page number, and can be document specific. Typically, it is a value such as “iii” or “3”.

By default, “1” refers to the first page.

§label

a page label

§Returns

The Page referenced by label

source

pub fn page_layout(&self) -> PageLayout

Returns the page layout that should be used when the document is opened

§Returns

a PageLayout that should be used when the document is opened

source

pub fn page_mode(&self) -> PageMode

Returns a PageMode representing how the document should be initially displayed when opened.

§Returns

a PageMode that should be used when document is opened

source

pub fn pdf_conformance(&self) -> PDFConformance

Returns the conformance level of the self as PDFConformance.

§Returns

the document’s subtype conformance level

source

pub fn pdf_part(&self) -> PDFPart

Returns the part of the conforming standard that the self adheres to as a PDFSubtype.

§Returns

the document’s subtype part

source

pub fn pdf_subtype(&self) -> PDFSubtype

Returns the subtype of self as a PDFSubtype.

§Returns

the document’s subtype

source

pub fn pdf_subtype_string(&self) -> Option<GString>

Returns the PDF subtype version of self as a string.

§Returns

a newly allocated string containing the PDF subtype version of self, or None

source

pub fn pdf_version(&self) -> (u32, u32)

Updates values referenced by major_version & minor_version with the major and minor PDF versions of self.

§Returns
§major_version

return location for the PDF major version number

§minor_version

return location for the PDF minor version number

source

pub fn pdf_version_string(&self) -> Option<GString>

Returns the PDF version of self as a string (e.g. PDF-1.6)

§Returns

a new allocated string containing the PDF version of self, or None

source

pub fn permissions(&self) -> Permissions

Returns the flags specifying which operations are permitted when the document is opened.

§Returns

a set of flags from Permissions enumeration

source

pub fn print_duplex(&self) -> PrintDuplex

Available on crate feature v0_80 only.

Returns the duplex mode value suggested for printing by author of the document. Value POPPLER_PRINT_DUPLEX_NONE means that the document does not specify this preference.

§Returns

a PrintDuplex that should be used when document is printed

source

pub fn print_n_copies(&self) -> i32

Available on crate feature v0_80 only.

Returns the suggested number of copies to be printed. This preference should be applied only if returned value is greater than 1 since value 1 usually means that the document does not specify it.

§Returns

Number of copies

source

pub fn print_scaling(&self) -> PrintScaling

Available on crate feature v0_73 only.

Returns the print scaling value suggested by author of the document.

§Returns

a PrintScaling that should be used when document is printed

source

pub fn producer(&self) -> Option<GString>

Returns the producer of the document. If the document was converted from another format, the producer is the name of the product that converted it to PDF

§Returns

a new allocated string containing the producer of self, or None

source

pub fn signature_fields(&self) -> Vec<FormField>

Available on crate feature v22_2 only.

Returns a GList containing all signature FormFields in the document.

§Returns

a list of all signature form fields.

source

pub fn subject(&self) -> Option<GString>

Returns the subject of the document

§Returns

a new allocated string containing the subject of self, or None

source

pub fn title(&self) -> Option<GString>

Returns the document’s title

§Returns

a new allocated string containing the title of self, or None

source

pub fn has_attachments(&self) -> bool

Returns true of self has any attachments.

§Returns

true, if self has attachments.

source

pub fn has_javascript(&self) -> bool

Available on crate feature v0_90 only.

Returns whether self has any javascript in it.

source

pub fn is_linearized(&self) -> bool

Returns whether self is linearized or not. Linearization of PDF enables efficient incremental access of the PDF file in a network environment.

§Returns

true if self is linearized, false otherwise

source

pub fn reset_form(&self, fields: &[&str], exclude_fields: bool)

Available on crate feature v0_90 only.

Resets the form fields specified by fields if exclude_fields is FALSE. Resets all others if exclude_fields is TRUE. All form fields are reset regardless of the exclude_fields flag if fields is empty.

§fields

list of fields to reset

§exclude_fields

whether to reset all fields except those in fields

source

pub fn save(&self, uri: &str) -> Result<(), Error>

Saves self. Any change made in the document such as form fields filled, annotations added or modified will be saved. If error is set, false will be returned. Possible errors include those in the G_FILE_ERROR domain.

§uri

uri of file to save

§Returns

true, if the document was successfully saved

source

pub fn save_a_copy(&self, uri: &str) -> Result<(), Error>

source

pub fn save_to_fd(&self, fd: i32, include_changes: bool) -> Result<(), Error>

Available on crate feature v21_12 only.

Saves self. Any change made in the document such as form fields filled, annotations added or modified will be saved if include_changes is true, or discarded i include_changes is false.

Note that this function takes ownership of fd; you must not operate on it again, nor close it.

If error is set, false will be returned. Possible errors include those in the G_FILE_ERROR domain.

§fd

a valid file descriptor open for writing

§include_changes

whether to include user changes (e.g. form fills)

§Returns

true, if the document was successfully saved

source

pub fn set_author(&self, author: &str)

Sets the document’s author. If author is None, Author entry is removed from the document’s Info dictionary.

§author

A new author

source

pub fn set_creation_date(&self, creation_date: c_long)

Sets the document’s creation date. If creation_date is -1, CreationDate entry is removed from the document’s Info dictionary.

§creation_date

A new creation date

source

pub fn set_creation_date_time(&self, creation_datetime: Option<&DateTime>)

Available on crate feature v20_9 only.

Sets the document’s creation date. If creation_datetime is None, CreationDate entry is removed from the document’s Info dictionary.

§creation_datetime

A new creation [glib::DateTime][crate::glib::DateTime]

source

pub fn set_creator(&self, creator: &str)

Sets the document’s creator. If creator is None, Creator entry is removed from the document’s Info dictionary.

§creator

A new creator

source

pub fn set_keywords(&self, keywords: &str)

Sets the document’s keywords. If keywords is None, Keywords entry is removed from the document’s Info dictionary.

§keywords

New keywords

source

pub fn set_modification_date(&self, modification_date: c_long)

Sets the document’s modification date. If modification_date is -1, ModDate entry is removed from the document’s Info dictionary.

§modification_date

A new modification date

source

pub fn set_modification_date_time( &self, modification_datetime: Option<&DateTime>, )

Available on crate feature v20_9 only.

Sets the document’s modification date. If modification_datetime is None, ModDate entry is removed from the document’s Info dictionary.

§modification_datetime

A new modification [glib::DateTime][crate::glib::DateTime]

source

pub fn set_producer(&self, producer: &str)

Sets the document’s producer. If producer is None, Producer entry is removed from the document’s Info dictionary.

§producer

A new producer

source

pub fn set_subject(&self, subject: &str)

Sets the document’s subject. If subject is None, Subject entry is removed from the document’s Info dictionary.

§subject

A new subject

source

pub fn set_title(&self, title: &str)

Sets the document’s title. If title is None, Title entry is removed from the document’s Info dictionary.

§title

A new title

source

pub fn sign<P: FnOnce(Result<(), Error>) + 'static>( &self, signing_data: &SigningData, cancellable: Option<&impl IsA<Cancellable>>, callback: P, )

Available on crate feature v23_7 only.

Sign document using signing_data.

§signing_data

a SigningData

§cancellable

a [gio::Cancellable][crate::gio::Cancellable]

§callback

a GAsyncReadyCallback

source

pub fn sign_future( &self, signing_data: &SigningData, ) -> Pin<Box_<dyn Future<Output = Result<(), Error>> + 'static>>

Available on crate feature v23_7 only.
source

pub fn creation_datetime(&self) -> Option<DateTime>

Available on crate feature v20_9 only.

The [glib::DateTime][crate::glib::DateTime] the document was created.

source

pub fn set_creation_datetime(&self, creation_datetime: Option<&DateTime>)

Available on crate feature v20_9 only.

The [glib::DateTime][crate::glib::DateTime] the document was created.

source

pub fn format(&self) -> Option<GString>

The PDF version as string. See also pdf_version_string()

source

pub fn format_major(&self) -> u32

The PDF major version number. See also pdf_version()

source

pub fn format_minor(&self) -> u32

The PDF minor version number. See also pdf_version()

source

pub fn mod_date(&self) -> i32

👎Deprecated: Since 20.9

The date the document was most recently modified as seconds since the Epoch, or -1

§Deprecated since 20.9

This will overflow in 2038. Use mod-datetime instead.

source

pub fn set_mod_date(&self, mod_date: i32)

👎Deprecated: Since 20.9

The date the document was most recently modified as seconds since the Epoch, or -1

§Deprecated since 20.9

This will overflow in 2038. Use mod-datetime instead.

source

pub fn mod_datetime(&self) -> Option<DateTime>

Available on crate feature v20_9 only.

The [glib::DateTime][crate::glib::DateTime] the document was most recently modified.

source

pub fn set_mod_datetime(&self, mod_datetime: Option<&DateTime>)

Available on crate feature v20_9 only.

The [glib::DateTime][crate::glib::DateTime] the document was most recently modified.

source

pub fn subtype(&self) -> PDFSubtype

Document PDF subtype type

source

pub fn subtype_conformance(&self) -> PDFConformance

Document PDF subtype conformance

source

pub fn subtype_part(&self) -> PDFPart

Document PDF subtype part

source

pub fn subtype_string(&self) -> Option<GString>

Document PDF subtype. See also pdf_subtype_string()

source

pub fn viewer_preferences(&self) -> ViewerPreferences

source

pub fn connect_author_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

pub fn connect_creation_date_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

👎Deprecated: Since 20.9
source

pub fn connect_creation_datetime_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Available on crate feature v20_9 only.
source

pub fn connect_creator_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

pub fn connect_format_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

pub fn connect_format_major_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

pub fn connect_format_minor_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

pub fn connect_keywords_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

pub fn connect_linearized_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

pub fn connect_metadata_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

pub fn connect_mod_date_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

👎Deprecated: Since 20.9
source

pub fn connect_mod_datetime_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Available on crate feature v20_9 only.
source

pub fn connect_page_layout_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

pub fn connect_page_mode_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

pub fn connect_permissions_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

pub fn connect_print_duplex_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Available on crate feature v0_80 only.
source

pub fn connect_print_n_copies_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Available on crate feature v0_80 only.
source

pub fn connect_print_scaling_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Available on crate feature v0_73 only.
source

pub fn connect_producer_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

pub fn connect_subject_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

pub fn connect_subtype_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

pub fn connect_subtype_conformance_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

pub fn connect_subtype_part_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

pub fn connect_subtype_string_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

pub fn connect_title_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

pub fn connect_viewer_preferences_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source§

impl Document

source

pub fn print_page_ranges(&self) -> &[PageRange]

Available on crate feature v0_80 only.

Returns the suggested page ranges to print in the form of array of PageRanges and number of ranges. None pointer means that the document does not specify page ranges for printing.

§Returns

an array of PageRanges or None. Free the array when it is no longer needed.

Trait Implementations§

source§

impl Clone for Document

source§

fn clone(&self) -> Self

Makes a clone of this shared reference.

This increments the strong reference count of the object. Dropping the object will decrement it again.

1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Document

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl HasParamSpec for Document

§

type ParamSpec = ParamSpecObject

§

type SetValue = Document

Preferred value to be used as setter for the associated ParamSpec.
§

type BuilderFn = fn(_: &str) -> ParamSpecObjectBuilder<'_, Document>

source§

fn param_spec_builder() -> Self::BuilderFn

source§

impl Hash for Document

source§

fn hash<H>(&self, state: &mut H)
where H: Hasher,

Hashes the memory address of this object.

1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for Document

source§

fn cmp(&self, other: &Self) -> Ordering

Comparison for two GObjects.

Compares the memory addresses of the provided objects.

1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl ParentClassIs for Document

source§

impl<OT: ObjectType> PartialEq<OT> for Document

source§

fn eq(&self, other: &OT) -> bool

Equality for two GObjects.

Two GObjects are equal if their memory addresses are equal.

1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<OT: ObjectType> PartialOrd<OT> for Document

source§

fn partial_cmp(&self, other: &OT) -> Option<Ordering>

Partial comparison for two GObjects.

Compares the memory addresses of the provided objects.

1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl StaticType for Document

source§

fn static_type() -> Type

Returns the type identifier of Self.
source§

impl Eq for Document

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> Cast for T
where T: ObjectType,

source§

fn upcast<T>(self) -> T
where T: ObjectType, Self: IsA<T>,

Upcasts an object to a superclass or interface T. Read more
source§

fn upcast_ref<T>(&self) -> &T
where T: ObjectType, Self: IsA<T>,

Upcasts an object to a reference of its superclass or interface T. Read more
source§

fn downcast<T>(self) -> Result<T, Self>
where T: ObjectType, Self: MayDowncastTo<T>,

Tries to downcast to a subclass or interface implementor T. Read more
source§

fn downcast_ref<T>(&self) -> Option<&T>
where T: ObjectType, Self: MayDowncastTo<T>,

Tries to downcast to a reference of its subclass or interface implementor T. Read more
source§

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 upcast will do many checks at compile-time already. downcast will perform the same checks at runtime as dynamic_cast, but will also ensure some amount of compile-time safety. Read more
source§

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 more
source§

unsafe fn unsafe_cast<T>(self) -> T
where T: ObjectType,

Casts to T unconditionally. Read more
source§

unsafe fn unsafe_cast_ref<T>(&self) -> &T
where T: ObjectType,

Casts to &T unconditionally. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for T

source§

unsafe fn from_glib_none_num_as_vec(ptr: *const GList, num: usize) -> Vec<T>

source§

unsafe fn from_glib_container_num_as_vec(_: *const GList, _: usize) -> Vec<T>

source§

unsafe fn from_glib_full_num_as_vec(_: *const GList, _: usize) -> Vec<T>

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for T

source§

unsafe fn from_glib_none_num_as_vec(ptr: *const GPtrArray, num: usize) -> Vec<T>

source§

unsafe fn from_glib_container_num_as_vec( _: *const GPtrArray, _: usize, ) -> Vec<T>

source§

unsafe fn from_glib_full_num_as_vec(_: *const GPtrArray, _: usize) -> Vec<T>

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for T

source§

unsafe fn from_glib_none_num_as_vec(ptr: *const GSList, num: usize) -> Vec<T>

source§

unsafe fn from_glib_container_num_as_vec(_: *const GSList, _: usize) -> Vec<T>

source§

unsafe fn from_glib_full_num_as_vec(_: *const GSList, _: usize) -> Vec<T>

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for T

source§

unsafe fn from_glib_none_num_as_vec(ptr: *mut GList, num: usize) -> Vec<T>

source§

unsafe fn from_glib_container_num_as_vec(ptr: *mut GList, num: usize) -> Vec<T>

source§

unsafe fn from_glib_full_num_as_vec(ptr: *mut GList, num: usize) -> Vec<T>

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for T

source§

unsafe fn from_glib_none_num_as_vec(ptr: *mut GPtrArray, num: usize) -> Vec<T>

source§

unsafe fn from_glib_container_num_as_vec( ptr: *mut GPtrArray, num: usize, ) -> Vec<T>

source§

unsafe fn from_glib_full_num_as_vec(ptr: *mut GPtrArray, num: usize) -> Vec<T>

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for T

source§

unsafe fn from_glib_none_num_as_vec(ptr: *mut GSList, num: usize) -> Vec<T>

source§

unsafe fn from_glib_container_num_as_vec(ptr: *mut GSList, num: usize) -> Vec<T>

source§

unsafe fn from_glib_full_num_as_vec(ptr: *mut GSList, num: usize) -> Vec<T>

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for T

source§

unsafe fn from_glib_none_as_vec(ptr: *const GList) -> Vec<T>

source§

unsafe fn from_glib_container_as_vec(_: *const GList) -> Vec<T>

source§

unsafe fn from_glib_full_as_vec(_: *const GList) -> Vec<T>

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for T

source§

unsafe fn from_glib_none_as_vec(ptr: *const GPtrArray) -> Vec<T>

source§

unsafe fn from_glib_container_as_vec(_: *const GPtrArray) -> Vec<T>

source§

unsafe fn from_glib_full_as_vec(_: *const GPtrArray) -> Vec<T>

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for T

source§

unsafe fn from_glib_none_as_vec(ptr: *const GSList) -> Vec<T>

source§

unsafe fn from_glib_container_as_vec(_: *const GSList) -> Vec<T>

source§

unsafe fn from_glib_full_as_vec(_: *const GSList) -> Vec<T>

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for T

source§

unsafe fn from_glib_none_as_vec(ptr: *mut GList) -> Vec<T>

source§

unsafe fn from_glib_container_as_vec(ptr: *mut GList) -> Vec<T>

source§

unsafe fn from_glib_full_as_vec(ptr: *mut GList) -> Vec<T>

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for T

source§

unsafe fn from_glib_none_as_vec(ptr: *mut GPtrArray) -> Vec<T>

source§

unsafe fn from_glib_container_as_vec(ptr: *mut GPtrArray) -> Vec<T>

source§

unsafe fn from_glib_full_as_vec(ptr: *mut GPtrArray) -> Vec<T>

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for T

source§

unsafe fn from_glib_none_as_vec(ptr: *mut GSList) -> Vec<T>

source§

unsafe fn from_glib_container_as_vec(ptr: *mut GSList) -> Vec<T>

source§

unsafe fn from_glib_full_as_vec(ptr: *mut GSList) -> Vec<T>

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoClosureReturnValue for T
where T: Into<Value>,

source§

impl<U> IsSubclassableExt for U

source§

impl<T> ObjectExt for T
where T: ObjectType,

source§

fn is<U>(&self) -> bool
where U: StaticType,

Returns true if the object is an instance of (can be cast to) T.
source§

fn type_(&self) -> Type

Returns the type of the object.
source§

fn object_class(&self) -> &Class<Object>

Returns the ObjectClass of the object. Read more
source§

fn class(&self) -> &Class<T>
where T: IsClass,

Returns the class of the object.
source§

fn class_of<U>(&self) -> Option<&Class<U>>
where U: IsClass,

Returns the class of the object in the given type T. Read more
source§

fn interface<U>(&self) -> Option<InterfaceRef<'_, U>>
where U: IsInterface,

Returns the interface T of the object. Read more
source§

fn set_property(&self, property_name: &str, value: impl Into<Value>)

Sets the property property_name of the object to value value. Read more
source§

fn set_property_from_value(&self, property_name: &str, value: &Value)

Sets the property property_name of the object to value value. Read more
source§

fn set_properties(&self, property_values: &[(&str, &dyn ToValue)])

Sets multiple properties of the object at once. Read more
source§

fn set_properties_from_value(&self, property_values: &[(&str, Value)])

Sets multiple properties of the object at once. Read more
source§

fn property<V>(&self, property_name: &str) -> V
where V: for<'b> FromValue<'b> + 'static,

Gets the property property_name of the object and cast it to the type V. Read more
source§

fn property_value(&self, property_name: &str) -> Value

Gets the property property_name of the object. Read more
source§

fn has_property(&self, property_name: &str, type_: Option<Type>) -> bool

Check if the object has a property property_name of the given type_. Read more
source§

fn property_type(&self, property_name: &str) -> Option<Type>

Get the type of the property property_name of this object. Read more
source§

fn find_property(&self, property_name: &str) -> Option<ParamSpec>

Get the ParamSpec of the property property_name of this object.
source§

fn list_properties(&self) -> PtrSlice<ParamSpec>

Return all ParamSpec of the properties of this object.
source§

fn freeze_notify(&self) -> PropertyNotificationFreezeGuard

Freeze all property notifications until the return guard object is dropped. Read more
source§

unsafe fn set_qdata<QD>(&self, key: Quark, value: QD)
where QD: 'static,

Set arbitrary data on this object with the given key. Read more
source§

unsafe fn qdata<QD>(&self, key: Quark) -> Option<NonNull<QD>>
where QD: 'static,

Return previously set arbitrary data of this object with the given key. Read more
source§

unsafe fn steal_qdata<QD>(&self, key: Quark) -> Option<QD>
where QD: 'static,

Retrieve previously set arbitrary data of this object with the given key. Read more
source§

unsafe fn set_data<QD>(&self, key: &str, value: QD)
where QD: 'static,

Set arbitrary data on this object with the given key. Read more
source§

unsafe fn data<QD>(&self, key: &str) -> Option<NonNull<QD>>
where QD: 'static,

Return previously set arbitrary data of this object with the given key. Read more
source§

unsafe fn steal_data<QD>(&self, key: &str) -> Option<QD>
where QD: 'static,

Retrieve previously set arbitrary data of this object with the given key. Read more
source§

fn block_signal(&self, handler_id: &SignalHandlerId)

Block a given signal handler. Read more
source§

fn unblock_signal(&self, handler_id: &SignalHandlerId)

Unblock a given signal handler.
source§

fn stop_signal_emission(&self, signal_id: SignalId, detail: Option<Quark>)

Stop emission of the currently emitted signal.
source§

fn stop_signal_emission_by_name(&self, signal_name: &str)

Stop emission of the currently emitted signal by the (possibly detailed) signal name.
source§

fn connect<F>( &self, signal_name: &str, after: bool, callback: F, ) -> SignalHandlerId
where F: Fn(&[Value]) -> Option<Value> + Send + Sync + 'static,

Connect to the signal signal_name on this object. Read more
source§

fn connect_id<F>( &self, signal_id: SignalId, details: Option<Quark>, after: bool, callback: F, ) -> SignalHandlerId
where F: Fn(&[Value]) -> Option<Value> + Send + Sync + 'static,

Connect to the signal signal_id on this object. Read more
source§

fn connect_local<F>( &self, signal_name: &str, after: bool, callback: F, ) -> SignalHandlerId
where F: Fn(&[Value]) -> Option<Value> + 'static,

Connect to the signal signal_name on this object. Read more
source§

fn connect_local_id<F>( &self, signal_id: SignalId, details: Option<Quark>, after: bool, callback: F, ) -> SignalHandlerId
where F: Fn(&[Value]) -> Option<Value> + 'static,

Connect to the signal signal_id on this object. Read more
source§

unsafe fn connect_unsafe<F>( &self, signal_name: &str, after: bool, callback: F, ) -> SignalHandlerId
where F: Fn(&[Value]) -> Option<Value>,

Connect to the signal signal_name on this object. Read more
source§

unsafe fn connect_unsafe_id<F>( &self, signal_id: SignalId, details: Option<Quark>, after: bool, callback: F, ) -> SignalHandlerId
where F: Fn(&[Value]) -> Option<Value>,

Connect to the signal signal_id on this object. Read more
source§

fn connect_closure( &self, signal_name: &str, after: bool, closure: RustClosure, ) -> SignalHandlerId

Connect a closure to the signal signal_name on this object. Read more
source§

fn connect_closure_id( &self, signal_id: SignalId, details: Option<Quark>, after: bool, closure: RustClosure, ) -> SignalHandlerId

Connect a closure to the signal signal_id on this object. Read more
source§

fn watch_closure(&self, closure: &impl AsRef<Closure>)

Limits the lifetime of closure to the lifetime of the object. When the object’s reference count drops to zero, the closure will be invalidated. An invalidated closure will ignore any calls to invoke_with_values, or invoke when using Rust closures.
source§

fn emit<R>(&self, signal_id: SignalId, args: &[&dyn ToValue]) -> R

Emit signal by signal id. Read more
source§

fn emit_with_values(&self, signal_id: SignalId, args: &[Value]) -> Option<Value>

Same as Self::emit but takes Value for the arguments.
source§

fn emit_by_name<R>(&self, signal_name: &str, args: &[&dyn ToValue]) -> R

Emit signal by its name. Read more
source§

fn emit_by_name_with_values( &self, signal_name: &str, args: &[Value], ) -> Option<Value>

Emit signal by its name. Read more
source§

fn emit_by_name_with_details<R>( &self, signal_name: &str, details: Quark, args: &[&dyn ToValue], ) -> R

Emit signal by its name with details. Read more
source§

fn emit_by_name_with_details_and_values( &self, signal_name: &str, details: Quark, args: &[Value], ) -> Option<Value>

Emit signal by its name with details. Read more
source§

fn emit_with_details<R>( &self, signal_id: SignalId, details: Quark, args: &[&dyn ToValue], ) -> R

Emit signal by signal id with details. Read more
source§

fn emit_with_details_and_values( &self, signal_id: SignalId, details: Quark, args: &[Value], ) -> Option<Value>

Emit signal by signal id with details. Read more
source§

fn disconnect(&self, handler_id: SignalHandlerId)

Disconnect a previously connected signal handler.
source§

fn connect_notify<F>(&self, name: Option<&str>, f: F) -> SignalHandlerId
where F: Fn(&T, &ParamSpec) + Send + Sync + 'static,

Connect to the notify signal of the object. Read more
source§

fn connect_notify_local<F>(&self, name: Option<&str>, f: F) -> SignalHandlerId
where F: Fn(&T, &ParamSpec) + 'static,

Connect to the notify signal of the object. Read more
source§

unsafe fn connect_notify_unsafe<F>( &self, name: Option<&str>, f: F, ) -> SignalHandlerId
where F: Fn(&T, &ParamSpec),

Connect to the notify signal of the object. Read more
source§

fn notify(&self, property_name: &str)

Notify that the given property has changed its value. Read more
source§

fn notify_by_pspec(&self, pspec: &ParamSpec)

Notify that the given property has changed its value. Read more
source§

fn downgrade(&self) -> WeakRef<T>

Downgrade this object to a weak reference.
source§

fn add_weak_ref_notify<F>(&self, f: F) -> WeakRefNotify<T>
where F: FnOnce() + Send + 'static,

Add a callback to be notified when the Object is disposed.
source§

fn add_weak_ref_notify_local<F>(&self, f: F) -> WeakRefNotify<T>
where F: FnOnce() + 'static,

Add a callback to be notified when the Object is disposed. Read more
source§

fn bind_property<'a, 'f, 't, O>( &'a self, source_property: &'a str, target: &'a O, target_property: &'a str, ) -> BindingBuilder<'a, 'f, 't>
where O: ObjectType,

Bind property source_property on this object to the target_property on the target object. Read more
source§

fn ref_count(&self) -> u32

Returns the strong reference count of this object.
source§

unsafe fn run_dispose(&self)

Runs the dispose mechanism of the object. Read more
source§

impl<T> Property for T
where T: HasParamSpec,

§

type Value = T

source§

impl<T> PropertyGet for T
where T: HasParamSpec,

§

type Value = T

source§

fn get<R, F>(&self, f: F) -> R
where F: Fn(&<T as PropertyGet>::Value) -> R,

source§

impl<T> StaticTypeExt for T
where T: StaticType,

source§

fn ensure_type()

Ensures that the type has been registered with the type system.
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> TransparentType for T

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T> TryFromClosureReturnValue for T
where T: for<'a> FromValue<'a> + StaticType + 'static,

source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<'a, T, C, E> FromValueOptional<'a> for T
where T: FromValue<'a, Checker = C>, C: ValueTypeChecker<Error = ValueTypeMismatchOrNoneError<E>>, E: Error + Send + 'static,

source§

impl<Super, Sub> MayDowncastTo<Sub> for Super
where Super: IsA<Super>, Sub: IsA<Super>,