pub struct Repo(_);
Implementations
pub fn abort_transaction<P: IsA<Cancellable>>(
&self,
cancellable: Option<&P>
) -> Result<(), Error>
pub fn add_gpg_signature_summary<P: IsA<Cancellable>>(
&self,
key_id: &[&str],
homedir: Option<&str>,
cancellable: Option<&P>
) -> Result<(), Error>
pub fn append_gpg_signature<P: IsA<Cancellable>>(
&self,
commit_checksum: &str,
signature_bytes: &Bytes,
cancellable: Option<&P>
) -> Result<(), Error>
pub fn checkout_at<P: AsRef<Path>, Q: IsA<Cancellable>>(
&self,
options: Option<&RepoCheckoutAtOptions>,
destination_dfd: i32,
destination_path: P,
commit: &str,
cancellable: Option<&Q>
) -> Result<(), Error>
v2016_8
only.pub fn checkout_tree<P: IsA<File>, Q: IsA<Cancellable>>(
&self,
mode: RepoCheckoutMode,
overwrite_mode: RepoCheckoutOverwriteMode,
destination: &P,
source: &RepoFile,
source_info: &FileInfo,
cancellable: Option<&Q>
) -> Result<(), Error>
pub fn commit_transaction<P: IsA<Cancellable>>(
&self,
cancellable: Option<&P>
) -> Result<RepoTransactionStats, Error>
pub fn create<P: IsA<Cancellable>>(
&self,
mode: RepoMode,
cancellable: Option<&P>
) -> Result<(), Error>
pub fn delete_object<P: IsA<Cancellable>>(
&self,
objtype: ObjectType,
sha256: &str,
cancellable: Option<&P>
) -> Result<(), Error>
v2017_12
only.pub fn fsck_object<P: IsA<Cancellable>>(
&self,
objtype: ObjectType,
sha256: &str,
cancellable: Option<&P>
) -> Result<(), Error>
v2017_15
only.v2019_2
only.v2018_6
only.v2018_9
only.v2016_4
only.v2018_9
only.pub fn remote_boolean_option(
&self,
remote_name: &str,
option_name: &str,
default_value: bool
) -> Result<bool, Error>
v2016_5
only.pub fn remote_list_option(
&self,
remote_name: &str,
option_name: &str
) -> Result<Vec<GString>, Error>
v2016_5
only.pub fn remote_option(
&self,
remote_name: &str,
option_name: &str,
default_value: Option<&str>
) -> Result<GString, Error>
v2016_5
only.pub fn gpg_sign_data<P: IsA<Cancellable>>(
&self,
data: &Bytes,
old_signatures: &Bytes,
key_id: &[&str],
homedir: Option<&str>,
cancellable: Option<&P>
) -> Result<Bytes, Error>
v2020_8
only.pub fn gpg_verify_data<P: IsA<File>, Q: IsA<File>, R: IsA<Cancellable>>(
&self,
remote_name: Option<&str>,
data: &Bytes,
signatures: &Bytes,
keyringdir: Option<&P>,
extra_keyring: Option<&Q>,
cancellable: Option<&R>
) -> Result<GpgVerifyResult, Error>
v2016_6
only.pub fn has_object<P: IsA<Cancellable>>(
&self,
objtype: ObjectType,
checksum: &str,
cancellable: Option<&P>
) -> Result<bool, Error>
v2017_12
only.pub fn import_object_from<P: IsA<Cancellable>>(
&self,
source: &Repo,
objtype: ObjectType,
checksum: &str,
cancellable: Option<&P>
) -> Result<(), Error>
pub fn import_object_from_with_trust<P: IsA<Cancellable>>(
&self,
source: &Repo,
objtype: ObjectType,
checksum: &str,
trusted: bool,
cancellable: Option<&P>
) -> Result<(), Error>
v2016_5
only.pub fn list_static_delta_indexes<P: IsA<Cancellable>>(
&self,
cancellable: Option<&P>
) -> Result<Vec<GString>, Error>
v2020_8
only.pub fn list_static_delta_names<P: IsA<Cancellable>>(
&self,
cancellable: Option<&P>
) -> Result<Vec<GString>, Error>
v2015_7
only.pub fn load_file<P: IsA<Cancellable>>(
&self,
checksum: &str,
cancellable: Option<&P>
) -> Result<(Option<InputStream>, Option<FileInfo>, Option<Variant>), Error>
pub fn load_object_stream<P: IsA<Cancellable>>(
&self,
objtype: ObjectType,
checksum: &str,
cancellable: Option<&P>
) -> Result<(InputStream, u64), Error>
pub fn load_variant_if_exists(
&self,
objtype: ObjectType,
sha256: &str
) -> Result<Option<Variant>, Error>
v2017_15
only.pub fn mark_commit_partial_reason(
&self,
checksum: &str,
is_partial: bool,
in_state: RepoCommitState
) -> Result<(), Error>
v2019_4
only.pub fn prepare_transaction<P: IsA<Cancellable>>(
&self,
cancellable: Option<&P>
) -> Result<bool, Error>
pub fn prune<P: IsA<Cancellable>>(
&self,
flags: RepoPruneFlags,
depth: i32,
cancellable: Option<&P>
) -> Result<(i32, i32, u64), Error>
pub fn prune_static_deltas<P: IsA<Cancellable>>(
&self,
commit: Option<&str>,
cancellable: Option<&P>
) -> Result<(), Error>
pub fn pull<P: IsA<Cancellable>>(
&self,
remote_name: &str,
refs_to_fetch: &[&str],
flags: RepoPullFlags,
progress: Option<&AsyncProgress>,
cancellable: Option<&P>
) -> Result<(), Error>
pub fn pull_one_dir<P: IsA<Cancellable>>(
&self,
remote_name: &str,
dir_to_pull: &str,
refs_to_fetch: &[&str],
flags: RepoPullFlags,
progress: Option<&AsyncProgress>,
cancellable: Option<&P>
) -> Result<(), Error>
pub fn pull_with_options<P: IsA<Cancellable>>(
&self,
remote_name_or_baseurl: &str,
options: &Variant,
progress: Option<&AsyncProgress>,
cancellable: Option<&P>
) -> Result<(), Error>
pub fn query_object_storage_size<P: IsA<Cancellable>>(
&self,
objtype: ObjectType,
sha256: &str,
cancellable: Option<&P>
) -> Result<u64, Error>
pub fn read_commit<P: IsA<Cancellable>>(
&self,
ref_: &str,
cancellable: Option<&P>
) -> Result<(File, GString), Error>
pub fn read_commit_detached_metadata<P: IsA<Cancellable>>(
&self,
checksum: &str,
cancellable: Option<&P>
) -> Result<Option<Variant>, Error>
pub fn regenerate_summary<P: IsA<Cancellable>>(
&self,
additional_metadata: Option<&Variant>,
cancellable: Option<&P>
) -> Result<(), Error>
pub fn reload_config<P: IsA<Cancellable>>(
&self,
cancellable: Option<&P>
) -> Result<(), Error>
v2017_2
only.pub fn remote_add<P: IsA<Cancellable>>(
&self,
name: &str,
url: Option<&str>,
options: Option<&Variant>,
cancellable: Option<&P>
) -> Result<(), Error>
pub fn remote_change<P: IsA<File>, Q: IsA<Cancellable>>(
&self,
sysroot: Option<&P>,
changeop: RepoRemoteChange,
name: &str,
url: Option<&str>,
options: Option<&Variant>,
cancellable: Option<&Q>
) -> Result<(), Error>
pub fn remote_delete<P: IsA<Cancellable>>(
&self,
name: &str,
cancellable: Option<&P>
) -> Result<(), Error>
pub fn remote_fetch_summary<P: IsA<Cancellable>>(
&self,
name: &str,
cancellable: Option<&P>
) -> Result<(Bytes, Bytes), Error>
pub fn remote_fetch_summary_with_options<P: IsA<Cancellable>>(
&self,
name: &str,
options: Option<&Variant>,
cancellable: Option<&P>
) -> Result<(Bytes, Bytes), Error>
v2016_6
only.pub fn remote_get_gpg_keys<P: IsA<Cancellable>>(
&self,
name: Option<&str>,
key_ids: &[&str],
cancellable: Option<&P>
) -> Result<Vec<Variant>, Error>
v2021_4
only.pub fn remote_gpg_import<P: IsA<InputStream>, Q: IsA<Cancellable>>(
&self,
name: &str,
source_stream: Option<&P>,
key_ids: &[&str],
cancellable: Option<&Q>
) -> Result<u32, Error>
pub fn resolve_collection_ref<P: IsA<Cancellable>>(
&self,
ref_: &CollectionRef,
allow_noent: bool,
flags: RepoResolveRevExtFlags,
cancellable: Option<&P>
) -> Result<Option<GString>, Error>
v2018_6
only.pub fn resolve_keyring_for_collection<P: IsA<Cancellable>>(
&self,
collection_id: &str,
cancellable: Option<&P>
) -> Result<Remote, Error>
v2018_6
only.pub fn resolve_rev_ext(
&self,
refspec: &str,
allow_noent: bool,
flags: RepoResolveRevExtFlags
) -> Result<Option<GString>, Error>
v2016_7
only.pub fn scan_hardlinks<P: IsA<Cancellable>>(
&self,
cancellable: Option<&P>
) -> Result<(), Error>
pub fn set_alias_ref_immediate<P: IsA<Cancellable>>(
&self,
remote: Option<&str>,
ref_: &str,
target: Option<&str>,
cancellable: Option<&P>
) -> Result<(), Error>
v2017_10
only.pub fn set_cache_dir<P: IsA<Cancellable>>(
&self,
dfd: i32,
path: &str,
cancellable: Option<&P>
) -> Result<(), Error>
v2016_5
only.v2018_6
only.pub fn set_collection_ref_immediate<P: IsA<Cancellable>>(
&self,
ref_: &CollectionRef,
checksum: Option<&str>,
cancellable: Option<&P>
) -> Result<(), Error>
v2018_6
only.pub fn set_ref_immediate<P: IsA<Cancellable>>(
&self,
remote: Option<&str>,
ref_: &str,
checksum: Option<&str>,
cancellable: Option<&P>
) -> Result<(), Error>
pub fn sign_commit<P: IsA<Cancellable>>(
&self,
commit_checksum: &str,
key_id: &str,
homedir: Option<&str>,
cancellable: Option<&P>
) -> Result<(), Error>
pub fn sign_delta<P: IsA<Cancellable>>(
&self,
from_commit: &str,
to_commit: &str,
key_id: &str,
homedir: &str,
cancellable: Option<&P>
) -> Result<(), Error>
pub fn signature_verify_commit_data(
&self,
remote_name: &str,
commit_data: &Bytes,
commit_metadata: &Bytes,
flags: RepoVerifyFlags
) -> Result<Option<GString>, Error>
v2021_4
only.pub fn static_delta_execute_offline<P: IsA<File>, Q: IsA<Cancellable>>(
&self,
dir_or_file: &P,
skip_validation: bool,
cancellable: Option<&Q>
) -> Result<(), Error>
pub fn static_delta_execute_offline_with_signature<P: IsA<File>, Q: IsA<Sign>, R: IsA<Cancellable>>(
&self,
dir_or_file: &P,
sign: &Q,
skip_validation: bool,
cancellable: Option<&R>
) -> Result<(), Error>
v2020_7
only.pub fn static_delta_generate<P: IsA<Cancellable>>(
&self,
opt: StaticDeltaGenerateOpt,
from: Option<&str>,
to: &str,
metadata: Option<&Variant>,
params: Option<&Variant>,
cancellable: Option<&P>
) -> Result<(), Error>
pub fn static_delta_verify_signature<P: IsA<Sign>>(
&self,
delta_id: &str,
sign: &P
) -> Result<Option<GString>, Error>
v2020_7
only.v2018_6
only.pub fn verify_commit<P: IsA<File>, Q: IsA<File>, R: IsA<Cancellable>>(
&self,
commit_checksum: &str,
keyringdir: Option<&P>,
extra_keyring: Option<&Q>,
cancellable: Option<&R>
) -> Result<(), Error>
pub fn verify_commit_ext<P: IsA<File>, Q: IsA<File>, R: IsA<Cancellable>>(
&self,
commit_checksum: &str,
keyringdir: Option<&P>,
extra_keyring: Option<&Q>,
cancellable: Option<&R>
) -> Result<GpgVerifyResult, Error>
pub fn verify_commit_for_remote<P: IsA<Cancellable>>(
&self,
commit_checksum: &str,
remote_name: &str,
cancellable: Option<&P>
) -> Result<GpgVerifyResult, Error>
v2016_14
only.pub fn verify_summary<P: IsA<Cancellable>>(
&self,
remote_name: &str,
summary: &Bytes,
signatures: &Bytes,
cancellable: Option<&P>
) -> Result<GpgVerifyResult, Error>
pub fn write_archive_to_mtree<P: IsA<File>, Q: IsA<Cancellable>>(
&self,
archive: &P,
mtree: &MutableTree,
modifier: Option<&RepoCommitModifier>,
autocreate_parents: bool,
cancellable: Option<&Q>
) -> Result<(), Error>
pub fn write_archive_to_mtree_from_fd<P: IsA<Cancellable>>(
&self,
fd: i32,
mtree: &MutableTree,
modifier: Option<&RepoCommitModifier>,
autocreate_parents: bool,
cancellable: Option<&P>
) -> Result<(), Error>
pub fn write_commit<P: IsA<Cancellable>>(
&self,
parent: Option<&str>,
subject: Option<&str>,
body: Option<&str>,
metadata: Option<&Variant>,
root: &RepoFile,
cancellable: Option<&P>
) -> Result<GString, Error>
pub fn write_commit_detached_metadata<P: IsA<Cancellable>>(
&self,
checksum: &str,
metadata: Option<&Variant>,
cancellable: Option<&P>
) -> Result<(), Error>
pub fn write_commit_with_time<P: IsA<Cancellable>>(
&self,
parent: Option<&str>,
subject: Option<&str>,
body: Option<&str>,
metadata: Option<&Variant>,
root: &RepoFile,
time: u64,
cancellable: Option<&P>
) -> Result<GString, Error>
pub fn write_content_trusted<P: IsA<InputStream>, Q: IsA<Cancellable>>(
&self,
checksum: &str,
object_input: &P,
length: u64,
cancellable: Option<&Q>
) -> Result<(), Error>
pub fn write_dfd_to_mtree<P: IsA<Cancellable>>(
&self,
dfd: i32,
path: &str,
mtree: &MutableTree,
modifier: Option<&RepoCommitModifier>,
cancellable: Option<&P>
) -> Result<(), Error>
pub fn write_directory_to_mtree<P: IsA<File>, Q: IsA<Cancellable>>(
&self,
dir: &P,
mtree: &MutableTree,
modifier: Option<&RepoCommitModifier>,
cancellable: Option<&Q>
) -> Result<(), Error>
pub fn write_metadata_stream_trusted<P: IsA<InputStream>, Q: IsA<Cancellable>>(
&self,
objtype: ObjectType,
checksum: &str,
object_input: &P,
length: u64,
cancellable: Option<&Q>
) -> Result<(), Error>
pub fn write_metadata_trusted<P: IsA<Cancellable>>(
&self,
objtype: ObjectType,
checksum: &str,
variant: &Variant,
cancellable: Option<&P>
) -> Result<(), Error>
pub fn write_mtree<P: IsA<Cancellable>>(
&self,
mtree: &MutableTree,
cancellable: Option<&P>
) -> Result<File, Error>
pub fn write_regfile(
&self,
expected_checksum: Option<&str>,
uid: u32,
gid: u32,
mode: u32,
content_len: u64,
xattrs: Option<&Variant>
) -> Result<ContentWriter, Error>
v2021_2
only.pub fn write_regfile_inline<P: IsA<Cancellable>>(
&self,
expected_checksum: Option<&str>,
uid: u32,
gid: u32,
mode: u32,
xattrs: Option<&Variant>,
buf: &[u8],
cancellable: Option<&P>
) -> Result<GString, Error>
v2021_2
only.pub fn write_symlink<P: IsA<Cancellable>>(
&self,
expected_checksum: Option<&str>,
uid: u32,
gid: u32,
xattrs: Option<&Variant>,
symlink_target: &str,
cancellable: Option<&P>
) -> Result<GString, Error>
v2021_2
only.pub fn create_at<P: IsA<Cancellable>>(
dfd: i32,
path: &str,
mode: RepoMode,
options: Option<&Variant>,
cancellable: Option<&P>
) -> Result<Repo, Error>
v2017_10
only.pub fn open_at<P: IsA<Cancellable>>(
dfd: i32,
path: &str,
cancellable: Option<&P>
) -> Result<Repo, Error>
v2017_10
only.pub fn connect_gpg_verify_result<F: Fn(&Self, &str, &GpgVerifyResult) + Send + 'static>(
&self,
f: F
) -> SignalHandlerId
Create a new Repo
object for working with an OSTree repo at the given path.
pub fn auto_transaction<P: IsA<Cancellable>>(
&self,
cancellable: Option<&P>
) -> Result<TransactionGuard<'_>, Error>
pub fn auto_transaction<P: IsA<Cancellable>>(
&self,
cancellable: Option<&P>
) -> Result<TransactionGuard<'_>, Error>
A wrapper for [prepare_transaction
] which ensures the transaction will be aborted when the guard goes out of scope.
This is supported on crate feature v2016_4
only.
v2016_4
only.Return a copy of the directory file descriptor for this repository.
pub fn traverse_commit<P: IsA<Cancellable>>(
&self,
commit_checksum: &str,
maxdepth: i32,
cancellable: Option<&P>
) -> Result<HashSet<ObjectName>, Error>
pub fn traverse_commit<P: IsA<Cancellable>>(
&self,
commit_checksum: &str,
maxdepth: i32,
cancellable: Option<&P>
) -> Result<HashSet<ObjectName>, Error>
Find all objects reachable from a commit.
List all branch names (refs).
pub fn list_objects<P: IsA<Cancellable>>(
&self,
flags: OstreeRepoListObjectsFlags,
cancellable: Option<&P>
) -> Result<HashMap<ObjectName, ObjectDetails>, Error>
pub fn list_objects<P: IsA<Cancellable>>(
&self,
flags: OstreeRepoListObjectsFlags,
cancellable: Option<&P>
) -> Result<HashMap<ObjectName, ObjectDetails>, Error>
List all repo objects
pub fn list_refs_ext<P: IsA<Cancellable>>(
&self,
refspec_prefix: Option<&str>,
flags: RepoListRefsExtFlags,
cancellable: Option<&P>
) -> Result<HashMap<String, String>, Error>
pub fn list_refs_ext<P: IsA<Cancellable>>(
&self,
refspec_prefix: Option<&str>,
flags: RepoListRefsExtFlags,
cancellable: Option<&P>
) -> Result<HashMap<String, String>, Error>
List refs with extended options.
Resolve a refspec to a commit SHA256. Returns an error if the refspec does not exist.
pub fn write_content<P: IsA<InputStream>, Q: IsA<Cancellable>>(
&self,
expected_checksum: Option<&str>,
object_input: &P,
length: u64,
cancellable: Option<&Q>
) -> Result<Checksum, Error>
pub fn write_content<P: IsA<InputStream>, Q: IsA<Cancellable>>(
&self,
expected_checksum: Option<&str>,
object_input: &P,
length: u64,
cancellable: Option<&Q>
) -> Result<Checksum, Error>
Write a content object from provided input.
pub fn write_metadata<P: IsA<Cancellable>>(
&self,
objtype: ObjectType,
expected_checksum: Option<&str>,
object: &Variant,
cancellable: Option<&P>
) -> Result<Checksum, Error>
pub fn write_metadata<P: IsA<Cancellable>>(
&self,
objtype: ObjectType,
expected_checksum: Option<&str>,
object: &Variant,
cancellable: Option<&P>
) -> Result<Checksum, Error>
Write a metadata object.
Asynchronously write a content object.
Asynchronously write a content object.
pub fn write_metadata_async<P: IsA<Cancellable>, Q: FnOnce(Result<Checksum, Error>) + Send + 'static>(
&self,
objtype: ObjectType,
expected_checksum: Option<&str>,
object: &Variant,
cancellable: Option<&P>,
callback: Q
)
pub fn write_metadata_async<P: IsA<Cancellable>, Q: FnOnce(Result<Checksum, Error>) + Send + 'static>(
&self,
objtype: ObjectType,
expected_checksum: Option<&str>,
object: &Variant,
cancellable: Option<&P>,
callback: Q
)
Asynchronously write a metadata object.
Asynchronously write a metadata object.
Load and parse directory metadata. In particular, uid/gid/mode are stored in big-endian format; this function converts them to host native endianness.
Trait Implementations
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Returns the type identifier of Self
.
Auto Trait Implementations
Blanket Implementations
Mutably borrows from an owned value. Read more
Upcasts an object to a superclass or interface T
. Read more
Upcasts an object to a reference of its superclass or interface T
. Read more
Tries to downcast to a subclass or interface implementor T
. Read more
Tries to downcast to a reference of its subclass or interface implementor T
. Read more
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 more
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
Casts to T
unconditionally. Read more
Casts to &T
unconditionally. Read more
Returns true
if the object is an instance of (can be cast to) T
.
pub fn set_property<'a, N, V>(
&self,
property_name: N,
value: V
) -> Result<(), BoolError> where
N: Into<&'a str>,
V: ToValue,
pub fn set_property_from_value<'a, N>(
&self,
property_name: N,
value: &Value
) -> Result<(), BoolError> where
N: Into<&'a str>,
pub fn set_properties_from_value(
&self,
property_values: &[(&str, Value)]
) -> Result<(), BoolError>
pub fn has_property<'a, N>(&self, property_name: N, type_: Option<Type>) -> bool where
N: Into<&'a str>,
pub fn find_property<'a, N>(&self, property_name: N) -> Option<ParamSpec> where
N: Into<&'a str>,
Safety Read more
Safety Read more
Safety Read more
Safety Read more
pub fn connect<'a, N, F>(
&self,
signal_name: N,
after: bool,
callback: F
) -> Result<SignalHandlerId, BoolError> where
N: Into<&'a str>,
F: 'static + Fn(&[Value]) -> Option<Value> + Send + Sync,
Same as connect
but takes a SignalId
instead of a signal name.
pub fn connect_local<'a, N, F>(
&self,
signal_name: N,
after: bool,
callback: F
) -> Result<SignalHandlerId, BoolError> where
N: Into<&'a str>,
F: 'static + Fn(&[Value]) -> Option<Value>,
Same as connect_local
but takes a SignalId
instead of a signal name.
pub unsafe fn connect_unsafe<'a, N, F>(
&self,
signal_name: N,
after: bool,
callback: F
) -> Result<SignalHandlerId, BoolError> where
N: Into<&'a str>,
F: Fn(&[Value]) -> Option<Value>,
Same as connect_unsafe
but takes a SignalId
instead of a signal name.
Emit signal by signal id.
Same as emit
but takes Value
for the arguments.
Emit signal by its name.
Same as emit_by_name
but takes Value
for the arguments.
Emit signal with details by signal id.
Same as emit_with_details
but takes Value
for the arguments.
pub fn connect_notify<F>(&self, name: Option<&str>, f: F) -> SignalHandlerId where
F: 'static + Fn(&T, &ParamSpec) + Send + Sync,
pub fn connect_notify_local<F>(
&self,
name: Option<&str>,
f: F
) -> SignalHandlerId where
F: 'static + Fn(&T, &ParamSpec),
pub unsafe fn connect_notify_unsafe<F>(
&self,
name: Option<&str>,
f: F
) -> SignalHandlerId where
F: Fn(&T, &ParamSpec),
pub fn bind_property<'a, O, N, M>(
&'a self,
source_property: N,
target: &'a O,
target_property: M
) -> BindingBuilder<'a> where
O: ObjectType,
N: Into<&'a str>,
M: Into<&'a str>,
Returns a SendValue
clone of self
.