pub struct SdkImplBuilder { /* private fields */ }Expand description
SdkImplのビルダー。
Location(拠点)を location() で登録し、ルートを connect() で宣言する。
Location からスキャナーが自動導出され、ルートコストは LocationKind の
組み合わせから自動推定される。
§使用例
ⓘ
let sdk = SdkImplBuilder::new(topology_files, location_files, transfer_store)
.location(Arc::new(LocalLocation::new(root, hasher)))
.location(Arc::new(SshLocation::new(pod_id, pod_root, shell)))
.location(Arc::new(CloudLocation::new(cloud_id, cloud_root, backend)))
.connect(&local_id, &cloud_id, rclone_backend)
.connect_with_shell(&pod_id, &cloud_id, pod_rclone, pod_shell)
.connect_pull(&cloud_id, &local_id, rclone_pull)
.exclude(".git")
.build()?;Implementations§
Source§impl SdkImplBuilder
impl SdkImplBuilder
Sourcepub fn new(
topology_files: Arc<dyn TopologyFileStore>,
location_files: Arc<dyn LocationFileStore>,
transfer_store: Arc<dyn TransferStore>,
) -> Self
pub fn new( topology_files: Arc<dyn TopologyFileStore>, location_files: Arc<dyn LocationFileStore>, transfer_store: Arc<dyn TransferStore>, ) -> Self
必須3ストアでビルダーを作成。
Sourcepub fn location(self, loc: Arc<dyn Location>) -> Self
pub fn location(self, loc: Arc<dyn Location>) -> Self
Location(拠点)追加。
Location trait 実装からスキャナーが自動導出される。 同じLocationIdの二重登録は無視される。
Sourcepub fn connect(
self,
src: &LocationId,
dest: &LocationId,
backend: Box<dyn StorageBackend>,
) -> Self
pub fn connect( self, src: &LocationId, dest: &LocationId, backend: Box<dyn StorageBackend>, ) -> Self
Push方向のルート接続を宣言。
src → dest への転送ルートを登録する。
file_root は build() 時に Location から自動解決される。
コストは LocationKind の組み合わせから自動推定される。
Sourcepub fn connect_with_shell(
self,
src: &LocationId,
dest: &LocationId,
backend: Box<dyn StorageBackend>,
src_shell: Box<dyn RemoteShell>,
) -> Self
pub fn connect_with_shell( self, src: &LocationId, dest: &LocationId, backend: Box<dyn StorageBackend>, src_shell: Box<dyn RemoteShell>, ) -> Self
Push方向 + ソース側Shell付きのルート接続。
リモートホスト(Pod等)がソースの場合、ソース側でのファイル操作
(存在確認、ハッシュ計算)に src_shell を使用する。
Sourcepub fn connect_pull(
self,
src: &LocationId,
dest: &LocationId,
backend: Box<dyn StorageBackend>,
) -> Self
pub fn connect_pull( self, src: &LocationId, dest: &LocationId, backend: Box<dyn StorageBackend>, ) -> Self
Pull方向のルート接続。
Cloud → Local, Cloud → Pod のように、リモートからローカル方向への
転送ルートを登録する。backend.pull() が使用される。
Auto Trait Implementations§
impl Freeze for SdkImplBuilder
impl !RefUnwindSafe for SdkImplBuilder
impl Send for SdkImplBuilder
impl Sync for SdkImplBuilder
impl Unpin for SdkImplBuilder
impl UnsafeUnpin for SdkImplBuilder
impl !UnwindSafe for SdkImplBuilder
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
Mutably borrows from an owned value. Read more