Skip to main content

PwrClient

Struct PwrClient 

Source
pub struct PwrClient { /* private fields */ }
Expand description

A connected and authenticated client session with the pwr server.

Implementations§

Source§

impl PwrClient

Source

pub fn connect(config: &PwrConfig, tls: bool) -> ClientResult<Self>

Connect to the server with retry logic for transient failures.

Retries up to 3 times with exponential backoff (1s, 2s, 4s). TLS handshake failures and authentication errors are not retried since they indicate configuration problems rather than transient network issues.

Source

pub fn archive_project( &mut self, project_uuid: &Uuid, project_name: &str, archive_data: &[u8], archive_hash: &str, ) -> ClientResult<()>

Archive a project: send the encrypted archive blob to the server.

archive_data is the fully encrypted tar.gz.age blob. archive_hash is its SHA-256 hex hash for server-side verification. An optional progress callback receives bytes sent so far and total.

Source

pub fn archive_project_with_progress( &mut self, project_uuid: &Uuid, project_name: &str, archive_data: &[u8], archive_hash: &str, progress: Option<&dyn Fn(u64, u64)>, ) -> ClientResult<()>

Archive with progress callback: fn(bytes_sent, total_bytes).

Source

pub fn restore_project(&mut self, project_uuid: &Uuid) -> ClientResult<Vec<u8>>

Restore a project: request the server send back the archive blob.

Returns the encrypted archive data that can then be decrypted and extracted locally.

Source

pub fn restore_project_with_progress( &mut self, project_uuid: &Uuid, progress: Option<&dyn Fn(u64, u64)>, ) -> ClientResult<Vec<u8>>

Restore with progress callback: fn(bytes_received, total_bytes).

Source

pub fn get_status( &mut self, project_uuid: Option<&Uuid>, ) -> ClientResult<Vec<ProjectInfo>>

Query the server for project status.

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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