pub struct HFRepositorySync<T: RepoType> { /* private fields */ }blocking only.Expand description
Synchronous/blocking counterpart to HFRepository, parameterized by the repo kind via T.
Wraps an HFRepository<T> and blocks on the corresponding async methods.
See HFRepository for method semantics.
Implementations§
Source§impl<T: RepoType> HFRepositorySync<T>
impl<T: RepoType> HFRepositorySync<T>
Sourcepub fn new(
client: HFClientSync,
repo_type: T,
owner: impl Into<String>,
name: impl Into<String>,
) -> Self
pub fn new( client: HFClientSync, repo_type: T, owner: impl Into<String>, name: impl Into<String>, ) -> Self
Creates a blocking repository handle.
See HFRepository::new.
Sourcepub fn repo_path(&self) -> String
pub fn repo_path(&self) -> String
The full "owner/name" identifier used in Hub API calls.
If no owner is set, returns just the name (for repos using short-form IDs like "gpt2").
Sourcepub fn repo_type(&self) -> &T
pub fn repo_type(&self) -> &T
The marker for this handle’s repo kind. Call
RepoType::singular / RepoType::plural / RepoType::url_prefix on it
to get the corresponding string.
Source§impl<T: RepoType> HFRepositorySync<T>
impl<T: RepoType> HFRepositorySync<T>
Sourcepub fn list_commits<'f1>(
&'f1 self,
) -> HFRepositorySyncListCommitsBuilder<'f1, T>
pub fn list_commits<'f1>( &'f1 self, ) -> HFRepositorySyncListCommitsBuilder<'f1, T>
Blocking counterpart of HFRepository::list_commits. Collects the stream into a
Vec<GitCommitInfo>. See the async method for parameters and behavior.
Sourcepub fn list_refs<'f1>(&'f1 self) -> HFRepositorySyncListRefsBuilder<'f1, T>
pub fn list_refs<'f1>(&'f1 self) -> HFRepositorySyncListRefsBuilder<'f1, T>
Blocking counterpart of HFRepository::list_refs. See the async method for parameters
and behavior.
Sourcepub fn get_commit_diff<'f1, 'f2>(
&'f1 self,
) -> HFRepositorySyncGetCommitDiffBuilder<'f1, 'f2, T>
pub fn get_commit_diff<'f1, 'f2>( &'f1 self, ) -> HFRepositorySyncGetCommitDiffBuilder<'f1, 'f2, T>
Blocking counterpart of HFRepository::get_commit_diff. See the async method for
parameters and behavior.
Sourcepub fn get_raw_diff<'f1, 'f2>(
&'f1 self,
) -> HFRepositorySyncGetRawDiffBuilder<'f1, 'f2, T>
pub fn get_raw_diff<'f1, 'f2>( &'f1 self, ) -> HFRepositorySyncGetRawDiffBuilder<'f1, 'f2, T>
Blocking counterpart of HFRepository::get_raw_diff. See the async method for
parameters and behavior.
Sourcepub fn get_raw_diff_stream<'f1>(
&'f1 self,
) -> HFRepositorySyncGetRawDiffStreamBuilder<'f1, T>
pub fn get_raw_diff_stream<'f1>( &'f1 self, ) -> HFRepositorySyncGetRawDiffStreamBuilder<'f1, T>
Blocking counterpart of HFRepository::get_raw_diff_stream. Collects the parsed stream
into a Vec<HFFileDiff>. See the async method for parameters and behavior.
Sourcepub fn create_branch<'f1, 'f2>(
&'f1 self,
) -> HFRepositorySyncCreateBranchBuilder<'f1, 'f2, T>
pub fn create_branch<'f1, 'f2>( &'f1 self, ) -> HFRepositorySyncCreateBranchBuilder<'f1, 'f2, T>
Blocking counterpart of HFRepository::create_branch. See the async method for
parameters and behavior.
Sourcepub fn delete_branch<'f1, 'f2>(
&'f1 self,
) -> HFRepositorySyncDeleteBranchBuilder<'f1, 'f2, T>
pub fn delete_branch<'f1, 'f2>( &'f1 self, ) -> HFRepositorySyncDeleteBranchBuilder<'f1, 'f2, T>
Blocking counterpart of HFRepository::delete_branch. See the async method for
parameters and behavior.
Sourcepub fn create_tag<'f1, 'f2, 'f3>(
&'f1 self,
) -> HFRepositorySyncCreateTagBuilder<'f1, 'f2, 'f3, T>
pub fn create_tag<'f1, 'f2, 'f3>( &'f1 self, ) -> HFRepositorySyncCreateTagBuilder<'f1, 'f2, 'f3, T>
Blocking counterpart of HFRepository::create_tag. See the async method for parameters
and behavior.
Sourcepub fn delete_tag<'f1, 'f2>(
&'f1 self,
) -> HFRepositorySyncDeleteTagBuilder<'f1, 'f2, T>
pub fn delete_tag<'f1, 'f2>( &'f1 self, ) -> HFRepositorySyncDeleteTagBuilder<'f1, 'f2, T>
Blocking counterpart of HFRepository::delete_tag. See the async method for parameters
and behavior.
Source§impl<T: RepoType> HFRepositorySync<T>
impl<T: RepoType> HFRepositorySync<T>
Sourcepub fn download_file<'f1>(
&'f1 self,
) -> HFRepositorySyncDownloadFileBuilder<'f1, T>
pub fn download_file<'f1>( &'f1 self, ) -> HFRepositorySyncDownloadFileBuilder<'f1, T>
Blocking counterpart of HFRepository::download_file. See the async method for
parameters and behavior.
Sourcepub fn download_file_to_bytes<'f1>(
&'f1 self,
) -> HFRepositorySyncDownloadFileToBytesBuilder<'f1, T>
pub fn download_file_to_bytes<'f1>( &'f1 self, ) -> HFRepositorySyncDownloadFileToBytesBuilder<'f1, T>
Blocking counterpart of HFRepository::download_file_to_bytes. See the async method for
parameters and behavior.
Sourcepub fn snapshot_download<'f1>(
&'f1 self,
) -> HFRepositorySyncSnapshotDownloadBuilder<'f1, T>
pub fn snapshot_download<'f1>( &'f1 self, ) -> HFRepositorySyncSnapshotDownloadBuilder<'f1, T>
Blocking counterpart of HFRepository::snapshot_download. See the async method for
parameters and behavior.
Source§impl<T: RepoType> HFRepositorySync<T>
impl<T: RepoType> HFRepositorySync<T>
Sourcepub fn list_tree<'f1>(&'f1 self) -> HFRepositorySyncListTreeBuilder<'f1, T>
pub fn list_tree<'f1>(&'f1 self) -> HFRepositorySyncListTreeBuilder<'f1, T>
Blocking counterpart of HFRepository::list_tree. Returns the collected stream as a
Vec<RepoTreeEntry>. See the async method for parameters and behavior.
Sourcepub fn get_paths_info<'f1>(
&'f1 self,
) -> HFRepositorySyncGetPathsInfoBuilder<'f1, T>
pub fn get_paths_info<'f1>( &'f1 self, ) -> HFRepositorySyncGetPathsInfoBuilder<'f1, T>
Blocking counterpart of HFRepository::get_paths_info. See the async method for
parameters and behavior.
Sourcepub fn get_file_metadata<'f1, 'f2>(
&'f1 self,
) -> HFRepositorySyncGetFileMetadataBuilder<'f1, 'f2, T>
pub fn get_file_metadata<'f1, 'f2>( &'f1 self, ) -> HFRepositorySyncGetFileMetadataBuilder<'f1, 'f2, T>
Blocking counterpart of HFRepository::get_file_metadata. See the async method for
parameters and behavior.
Source§impl<T: RepoType> HFRepositorySync<T>
impl<T: RepoType> HFRepositorySync<T>
Sourcepub fn create_commit<'f1>(
&'f1 self,
) -> HFRepositorySyncCreateCommitBuilder<'f1, T>
pub fn create_commit<'f1>( &'f1 self, ) -> HFRepositorySyncCreateCommitBuilder<'f1, T>
Blocking counterpart of HFRepository::create_commit. See the async method for
parameters and behavior.
Sourcepub fn upload_file<'f1>(&'f1 self) -> HFRepositorySyncUploadFileBuilder<'f1, T>
pub fn upload_file<'f1>(&'f1 self) -> HFRepositorySyncUploadFileBuilder<'f1, T>
Blocking counterpart of HFRepository::upload_file. See the async method for parameters
and behavior.
Sourcepub fn upload_folder<'f1>(
&'f1 self,
) -> HFRepositorySyncUploadFolderBuilder<'f1, T>
pub fn upload_folder<'f1>( &'f1 self, ) -> HFRepositorySyncUploadFolderBuilder<'f1, T>
Blocking counterpart of HFRepository::upload_folder. See the async method for
parameters and behavior.
Sourcepub fn delete_file<'f1>(&'f1 self) -> HFRepositorySyncDeleteFileBuilder<'f1, T>
pub fn delete_file<'f1>(&'f1 self) -> HFRepositorySyncDeleteFileBuilder<'f1, T>
Blocking counterpart of HFRepository::delete_file. See the async method for parameters
and behavior.
Sourcepub fn delete_folder<'f1>(
&'f1 self,
) -> HFRepositorySyncDeleteFolderBuilder<'f1, T>
pub fn delete_folder<'f1>( &'f1 self, ) -> HFRepositorySyncDeleteFolderBuilder<'f1, T>
Blocking counterpart of HFRepository::delete_folder. See the async method for
parameters and behavior.
Source§impl<T: RepoType> HFRepositorySync<T>
impl<T: RepoType> HFRepositorySync<T>
Sourcepub fn exists<'f1>(&'f1 self) -> HFRepositorySyncExistsBuilder<'f1, T>
pub fn exists<'f1>(&'f1 self) -> HFRepositorySyncExistsBuilder<'f1, T>
Blocking counterpart of HFRepository::exists.
Sourcepub fn revision_exists<'f1, 'f2>(
&'f1 self,
) -> HFRepositorySyncRevisionExistsBuilder<'f1, 'f2, T>
pub fn revision_exists<'f1, 'f2>( &'f1 self, ) -> HFRepositorySyncRevisionExistsBuilder<'f1, 'f2, T>
Blocking counterpart of HFRepository::revision_exists. See the async method for
parameters and behavior.
Sourcepub fn file_exists<'f1, 'f2, 'f3>(
&'f1 self,
) -> HFRepositorySyncFileExistsBuilder<'f1, 'f2, 'f3, T>
pub fn file_exists<'f1, 'f2, 'f3>( &'f1 self, ) -> HFRepositorySyncFileExistsBuilder<'f1, 'f2, 'f3, T>
Blocking counterpart of HFRepository::file_exists. See the async method for parameters
and behavior.
Sourcepub fn update_settings<'f1>(
&'f1 self,
) -> HFRepositorySyncUpdateSettingsBuilder<'f1, T>
pub fn update_settings<'f1>( &'f1 self, ) -> HFRepositorySyncUpdateSettingsBuilder<'f1, T>
Blocking counterpart of HFRepository::update_settings. See the async method for
parameters and behavior.
Source§impl HFRepositorySync<RepoTypeModel>
Sync info() builders for each repo kind.
impl HFRepositorySync<RepoTypeModel>
Sync info() builders for each repo kind.
Each block mirrors the async per-kind info() impl in shape and forwards through the
runtime. Builder type names are unique to keep the bon-generated state types from
colliding across the four impl blocks.
Sourcepub fn info<'f1>(&'f1 self) -> HFModelInfoSyncBuilder<'f1>
pub fn info<'f1>(&'f1 self) -> HFModelInfoSyncBuilder<'f1>
Blocking counterpart of HFRepository::<RepoTypeModel>::info.
Source§impl HFRepositorySync<RepoTypeDataset>
impl HFRepositorySync<RepoTypeDataset>
Sourcepub fn info<'f1>(&'f1 self) -> HFDatasetInfoSyncBuilder<'f1>
pub fn info<'f1>(&'f1 self) -> HFDatasetInfoSyncBuilder<'f1>
Blocking counterpart of HFRepository::<RepoTypeDataset>::info.
Source§impl HFRepositorySync<RepoTypeSpace>
impl HFRepositorySync<RepoTypeSpace>
Sourcepub fn info<'f1>(&'f1 self) -> HFSpaceInfoSyncBuilder<'f1>
pub fn info<'f1>(&'f1 self) -> HFSpaceInfoSyncBuilder<'f1>
Blocking counterpart of HFRepository::<RepoTypeSpace>::info.
Source§impl HFRepositorySync<RepoTypeKernel>
impl HFRepositorySync<RepoTypeKernel>
Sourcepub fn info<'f1>(&'f1 self) -> HFKernelInfoSyncBuilder<'f1>
pub fn info<'f1>(&'f1 self) -> HFKernelInfoSyncBuilder<'f1>
Blocking counterpart of HFRepository::<RepoTypeKernel>::info.
Source§impl HFRepositorySync<RepoTypeSpace>
impl HFRepositorySync<RepoTypeSpace>
Sourcepub fn runtime<'f1>(&'f1 self) -> HFRepositorySyncRuntimeBuilder<'f1>
pub fn runtime<'f1>(&'f1 self) -> HFRepositorySyncRuntimeBuilder<'f1>
Blocking counterpart of HFRepository::runtime. See the async method for parameters and
behavior.
Sourcepub fn request_hardware<'f1, 'f2>(
&'f1 self,
) -> HFRepositorySyncRequestHardwareBuilder<'f1, 'f2>
pub fn request_hardware<'f1, 'f2>( &'f1 self, ) -> HFRepositorySyncRequestHardwareBuilder<'f1, 'f2>
Blocking counterpart of HFRepository::request_hardware. See the async method for parameters
and behavior.
Sourcepub fn set_sleep_time<'f1>(
&'f1 self,
) -> HFRepositorySyncSetSleepTimeBuilder<'f1>
pub fn set_sleep_time<'f1>( &'f1 self, ) -> HFRepositorySyncSetSleepTimeBuilder<'f1>
Blocking counterpart of HFRepository::set_sleep_time. See the async method for parameters
and behavior.
Sourcepub fn pause<'f1>(&'f1 self) -> HFRepositorySyncPauseBuilder<'f1>
pub fn pause<'f1>(&'f1 self) -> HFRepositorySyncPauseBuilder<'f1>
Blocking counterpart of HFRepository::pause. See the async method for parameters and
behavior.
Sourcepub fn restart<'f1>(&'f1 self) -> HFRepositorySyncRestartBuilder<'f1>
pub fn restart<'f1>(&'f1 self) -> HFRepositorySyncRestartBuilder<'f1>
Blocking counterpart of HFRepository::restart. See the async method for parameters and
behavior.
Sourcepub fn add_secret<'f1, 'f2, 'f3, 'f4>(
&'f1 self,
) -> HFRepositorySyncAddSecretBuilder<'f1, 'f2, 'f3, 'f4>
pub fn add_secret<'f1, 'f2, 'f3, 'f4>( &'f1 self, ) -> HFRepositorySyncAddSecretBuilder<'f1, 'f2, 'f3, 'f4>
Blocking counterpart of HFRepository::add_secret. See the async method for parameters and
behavior.
Sourcepub fn delete_secret<'f1, 'f2>(
&'f1 self,
) -> HFRepositorySyncDeleteSecretBuilder<'f1, 'f2>
pub fn delete_secret<'f1, 'f2>( &'f1 self, ) -> HFRepositorySyncDeleteSecretBuilder<'f1, 'f2>
Blocking counterpart of HFRepository::delete_secret. See the async method for parameters and
behavior.
Sourcepub fn add_variable<'f1, 'f2, 'f3, 'f4>(
&'f1 self,
) -> HFRepositorySyncAddVariableBuilder<'f1, 'f2, 'f3, 'f4>
pub fn add_variable<'f1, 'f2, 'f3, 'f4>( &'f1 self, ) -> HFRepositorySyncAddVariableBuilder<'f1, 'f2, 'f3, 'f4>
Blocking counterpart of HFRepository::add_variable. See the async method for parameters and
behavior.
Sourcepub fn delete_variable<'f1, 'f2>(
&'f1 self,
) -> HFRepositorySyncDeleteVariableBuilder<'f1, 'f2>
pub fn delete_variable<'f1, 'f2>( &'f1 self, ) -> HFRepositorySyncDeleteVariableBuilder<'f1, 'f2>
Blocking counterpart of HFRepository::delete_variable. See the async method for parameters
and behavior.
Sourcepub fn duplicate<'f1, 'f2, 'f3, 'f4>(
&'f1 self,
) -> HFRepositorySyncDuplicateBuilder<'f1, 'f2, 'f3, 'f4>
pub fn duplicate<'f1, 'f2, 'f3, 'f4>( &'f1 self, ) -> HFRepositorySyncDuplicateBuilder<'f1, 'f2, 'f3, 'f4>
Blocking counterpart of HFRepository::duplicate. See the async method for parameters and
behavior.
Trait Implementations§
Source§impl<T: RepoType> Clone for HFRepositorySync<T>
impl<T: RepoType> Clone for HFRepositorySync<T>
Auto Trait Implementations§
impl<T> !RefUnwindSafe for HFRepositorySync<T>
impl<T> !UnwindSafe for HFRepositorySync<T>
impl<T> Freeze for HFRepositorySync<T>
impl<T> Send for HFRepositorySync<T>
impl<T> Sync for HFRepositorySync<T>
impl<T> Unpin for HFRepositorySync<T>
impl<T> UnsafeUnpin for HFRepositorySync<T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DropFlavorWrapper<T> for T
impl<T> DropFlavorWrapper<T> for T
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more