pub struct OperationFile {
pub filename: String,
pub file_path: String,
pub file_type: FileTypes,
pub checksum_override: Option<Sha256Hash>,
pub role: AssetRole,
pub upstream_asset_ref_id: Option<HashId>,
}Fields§
§filename: String§file_path: String§file_type: FileTypes§checksum_override: Option<Sha256Hash>§role: AssetRole§upstream_asset_ref_id: Option<HashId>Implementations§
Source§impl OperationFile
impl OperationFile
pub fn new(file_path: impl Into<String>) -> Self
pub fn set_file_type(self, file_type: FileTypes) -> Self
pub fn set_checksum_override(self, checksum: Sha256Hash) -> Self
pub fn set_role(self, role: AssetRole) -> Self
pub fn set_upstream_asset_ref_id(self, upstream_asset_ref_id: &HashId) -> Self
Sourcepub fn prepare_asset_ref(
&self,
workspace: &Workspace,
created_on: i64,
) -> Result<AssetRef, FileAdditionError>
pub fn prepare_asset_ref( &self, workspace: &Workspace, created_on: i64, ) -> Result<AssetRef, FileAdditionError>
Construct the AssetRef from an OperationFile
Sourcepub fn storage_file_path(
workspace: &Workspace,
path_or_uri: &str,
checksum: Option<&Sha256Hash>,
) -> Result<String, FileAdditionError>
pub fn storage_file_path( workspace: &Workspace, path_or_uri: &str, checksum: Option<&Sha256Hash>, ) -> Result<String, FileAdditionError>
Resolves the path stored in operation metadata without materializing remote assets.
Local inputs use their content-addressed repository path and therefore require a checksum; remote inputs keep their URI so they can be accessed lazily.
Trait Implementations§
Source§impl Clone for OperationFile
impl Clone for OperationFile
Source§impl Debug for OperationFile
impl Debug for OperationFile
impl Eq for OperationFile
Source§impl PartialEq for OperationFile
impl PartialEq for OperationFile
impl StructuralPartialEq for OperationFile
Auto Trait Implementations§
impl Freeze for OperationFile
impl RefUnwindSafe for OperationFile
impl Send for OperationFile
impl Sync for OperationFile
impl Unpin for OperationFile
impl UnsafeUnpin for OperationFile
impl UnwindSafe for OperationFile
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> ⓘ
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 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> ⓘ
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