Skip to main content

HFRepositorySync

Struct HFRepositorySync 

Source
pub struct HFRepositorySync<T: RepoType> { /* private fields */ }
Available on crate feature 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>

Source

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.

Source

pub fn owner(&self) -> &str

The repository owner (user or organization name).

Source

pub fn name(&self) -> &str

The repository name (without the owner prefix).

Source

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").

Source

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>

Source

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.

Source

pub fn list_refs<'f1>(&'f1 self) -> HFRepositorySyncListRefsBuilder<'f1, T>

Blocking counterpart of HFRepository::list_refs. See the async method for parameters and behavior.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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>

Source

pub fn download_file<'f1>( &'f1 self, ) -> HFRepositorySyncDownloadFileBuilder<'f1, T>

Blocking counterpart of HFRepository::download_file. See the async method for parameters and behavior.

Source

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.

Source

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>

Source

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.

Source

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.

Source

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>

Source

pub fn create_commit<'f1>( &'f1 self, ) -> HFRepositorySyncCreateCommitBuilder<'f1, T>

Blocking counterpart of HFRepository::create_commit. See the async method for parameters and behavior.

Source

pub fn upload_file<'f1>(&'f1 self) -> HFRepositorySyncUploadFileBuilder<'f1, T>

Blocking counterpart of HFRepository::upload_file. See the async method for parameters and behavior.

Source

pub fn upload_folder<'f1>( &'f1 self, ) -> HFRepositorySyncUploadFolderBuilder<'f1, T>

Blocking counterpart of HFRepository::upload_folder. See the async method for parameters and behavior.

Source

pub fn delete_file<'f1>(&'f1 self) -> HFRepositorySyncDeleteFileBuilder<'f1, T>

Blocking counterpart of HFRepository::delete_file. See the async method for parameters and behavior.

Source

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>

Source

pub fn exists<'f1>(&'f1 self) -> HFRepositorySyncExistsBuilder<'f1, T>

Blocking counterpart of HFRepository::exists.

Source

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.

Source

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.

Source

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.

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.

Source

pub fn info<'f1>(&'f1 self) -> HFModelInfoSyncBuilder<'f1>

Blocking counterpart of HFRepository::<RepoTypeModel>::info.

Source§

impl HFRepositorySync<RepoTypeDataset>

Source

pub fn info<'f1>(&'f1 self) -> HFDatasetInfoSyncBuilder<'f1>

Blocking counterpart of HFRepository::<RepoTypeDataset>::info.

Source§

impl HFRepositorySync<RepoTypeSpace>

Source

pub fn info<'f1>(&'f1 self) -> HFSpaceInfoSyncBuilder<'f1>

Blocking counterpart of HFRepository::<RepoTypeSpace>::info.

Source§

impl HFRepositorySync<RepoTypeKernel>

Source

pub fn info<'f1>(&'f1 self) -> HFKernelInfoSyncBuilder<'f1>

Blocking counterpart of HFRepository::<RepoTypeKernel>::info.

Source§

impl HFRepositorySync<RepoTypeSpace>

Source

pub fn runtime<'f1>(&'f1 self) -> HFRepositorySyncRuntimeBuilder<'f1>

Blocking counterpart of HFRepository::runtime. See the async method for parameters and behavior.

Source

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.

Source

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.

Source

pub fn pause<'f1>(&'f1 self) -> HFRepositorySyncPauseBuilder<'f1>

Blocking counterpart of HFRepository::pause. See the async method for parameters and behavior.

Source

pub fn restart<'f1>(&'f1 self) -> HFRepositorySyncRestartBuilder<'f1>

Blocking counterpart of HFRepository::restart. See the async method for parameters and behavior.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<T: RepoType> Debug for HFRepositorySync<T>

Source§

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

Formats the value using the given formatter. Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

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

impl<T> DropFlavorWrapper<T> for T

Source§

type Flavor = MayDrop

The DropFlavor that wraps T into Self
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, W> HasTypeWitness<W> for T
where W: MakeTypeWitness<Arg = T>, T: ?Sized,

Source§

const WITNESS: W = W::MAKE

A constant of the type witness
Source§

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

Source§

const TYPE_EQ: TypeEq<T, <T as Identity>::Type> = TypeEq::NEW

Proof that Self is the same type as Self::Type, provides methods for casting between Self and Self::Type.
Source§

type Type = T

The same type as Self, used to emulate type equality bounds (T == U) with associated type equality constraints (T: Identity<Type = U>).
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<E> ResultError for E
where E: Send + Debug + Sync,

Source§

impl<T> ResultType for T
where T: Send + Clone + Sync + Debug,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more