pub struct ArtifactLocation {
pub url: String,
pub file_path: Option<PathBuf>,
pub hash: String,
}Expand description
Represents the location and verification info for an artifact
§Examples
use atlas_cli::storage::traits::ArtifactLocation;
use std::path::PathBuf;
// Create from a file path
let path = PathBuf::from("model.onnx");
let location = ArtifactLocation::new(path).unwrap();
// Verify the file hasn't changed
assert!(location.verify().unwrap());use atlas_cli::storage::traits::ArtifactLocation;
use std::path::PathBuf;
// Create manually
let location = ArtifactLocation {
url: "file:///path/to/file".to_string(),
file_path: Some(PathBuf::from("/path/to/file")),
hash: "a".repeat(64),
};
assert!(location.file_path.is_some());Fields§
§url: String§file_path: Option<PathBuf>§hash: StringImplementations§
Trait Implementations§
Source§impl Clone for ArtifactLocation
impl Clone for ArtifactLocation
Source§fn clone(&self) -> ArtifactLocation
fn clone(&self) -> ArtifactLocation
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'de> Deserialize<'de> for ArtifactLocation
impl<'de> Deserialize<'de> for ArtifactLocation
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ArtifactLocation
impl RefUnwindSafe for ArtifactLocation
impl Send for ArtifactLocation
impl Sync for ArtifactLocation
impl Unpin for ArtifactLocation
impl UnwindSafe for ArtifactLocation
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