Struct libalpm::Alpm [] [src]

pub struct Alpm { /* fields omitted */ }

A handle on an alpm instance

Note that I have NOT checked whether the interface is threadsafe, so it's best to use only one instance of Alpm at present (doing your own synchronization if you want to share between threads). Also, callbacks must be stored in global state, so if they are changed for one they will be changed for all.

Methods

impl Alpm
[src]

Get a handle on the alpm instance defined by the given root/db_path

Creates an alpm instance with the given options.

TODO will only be implemented after the rest of the library is finished.

Gets the current (last) error status. Most functions use this internally to get the error type to return, so there isn't much need to use this externally.

Logs a message using alpm's built in logging functionality.

TODO test if all prefixes are allowed, or just DEBUG etc., & test generally

Fetch a remote pkg from the given URL and return its path.

Set the callback called when a log message is received.

Clears the log callback.

Set the callback called to report progress on downloading a file.

Clears the file download progress callback.

Set the callback called to report progress on total download

Clears the total download progress callback.

Set the callback called to download a file.

Providing this function is optional and it is recommended that you don't set it (and use the built-in fetch fn). This could be useful e.g. if you are behind a complicated proxy or want to use something other than http to fetch.

Safety

Note that if you supply this function, you promise that if you return DownloadResult::Ok, the requested file is correctly located in the given location.

A panic in the function will cause DownloadResult::Err to be sent to the underlying libalpm (i.e. not undefined behaviour).

TODO investigate whether safe to relax 'static bound

Clears the file download callback, falling back to built-in fetch functionality.

Sets the function called when an event occurs

Clears the file download callback, falling back to built-in fetch functionality.

Sets the function called when a question needs answering (todo i think)

Clears the function called when a question needs answering (todo i think)

Sets the function called to show operation progress

Clears the function called to show operation progress

Get the root path used in this instance of alpm

The api doesn't make clear the lifetime of the result, so I am conservative (same goes for db_path)

Get the database path used in this instance of alpm

Get the lockfile path used in this instance of alpm

Gets a list of the cache directories in use by this instance of alpm

Sets a list of the cache directories in use by this instance of alpm

Adds a cache directory for use by this instance of alpm

Removes a cache directory in use by this instance of alpm

Gets a list of the hook directories in use by this instance of alpm

Sets a list of the hook directories in use by this instance of alpm

Adds a hook directory for use by this instance of alpm

Removes a hook directory in use by this instance of alpm

Gets the log file location used by this instance of alpm.

Sets the log file location used by this instance of alpm.

Gets the path to alpm's GnuPG home directory

Sets the path to alpm's GnuPG home directory

Gets whether this instance of alpm should log events to syslog

Sets whether this instance of alpm should log events to syslog

Gets a list of the packages that should not be upgraded.

Sets a list of the packages that should not be upgraded.

Adds a package to the list that should not be upgraded.

Removes a package from the list that should not be upgraded.

Gets a list of the packages that should be ignored.

Sets a list of the packages that should be ignored.

Adds a package to the list that should be ignored.

Removes a package from the list that should be ignored.

Gets a list of the groups that should be ignored.

Sets a list of the groups that should be ignored.

Adds a group to the list that should be ignored.

Removes a group from the list that should be ignored.

Gets a list of the dependencies that should be ignored by a sys-upgrade.

Sets a list of the dependencies that should be ignored by a sys-upgrade.

Adds a package to the list of dependencies that should be ignored by a sys-upgrade.

Removes a package from the list of dependencies that should be ignored by a sys-upgrade.

Gets the targeted architecture.

Sets the targeted architecture.

Gets the delta ratio

Sets the targeted architecture

Gets whether alpm will check disk space before operations

Sets the targeted architecture

Gets the registered database extension used on the filesystem

Sets the targeted architecture

Gets the default signing level

Sets the default signing level

Gets the default signing level

Sets the default signing level

Gets the default signing level

Sets the default signing level

Get the local database instance.

Get a list of remote databases registered.

Register a sync db (remote db). You will need to attach servers to the db to be able to sync

Start a package modification transaction

Trait Implementations

impl Debug for Alpm
[src]

Formats the value using the given formatter.

impl Drop for Alpm
[src]

A method called when the value goes out of scope. Read more