pub enum FileLocation {
FileSystem {
path: PathBuf,
},
Url {
url: Url,
},
}Variants§
Implementations§
Source§impl FileLocation
impl FileLocation
pub fn try_parse( location_string: &str, workspace_root_location_hint: Option<&FileLocation>, ) -> Option<FileLocation>
pub fn from_path(path: PathBuf) -> FileLocation
pub fn from_url(url: Url) -> FileLocation
pub fn from_url_string(url_string: &str) -> Result<FileLocation, String>
pub fn working_dir() -> FileLocation
pub fn from_path_string(path_string: &str) -> Result<FileLocation, String>
pub fn append_path(&mut self, path_string: &str) -> Result<(), String>
pub fn expect_path_buf(&self) -> PathBuf
pub fn read_content_as_utf8(&self) -> Result<String, String>
pub fn get_workspace_root_location(&self) -> Result<FileLocation, String>
pub async fn get_workspace_manifest_location( &self, file_accessor: Option<&dyn FileAccessor>, ) -> Result<FileLocation, String>
pub fn get_absolute_path(&self) -> Result<PathBuf, String>
pub fn get_parent_location(&self) -> Result<FileLocation, String>
pub fn get_relative_path_from_base( &self, base_location: &FileLocation, ) -> Result<String, String>
pub fn get_relative_location(&self) -> Result<String, String>
pub fn get_file_name(&self) -> Option<String>
Source§impl FileLocation
impl FileLocation
pub fn read_content(&self) -> Result<Vec<u8>, String>
pub fn exists(&self) -> bool
pub fn write_content(&self, content: &[u8]) -> Result<(), String>
pub fn create_dir_all(&self) -> Result<(), String>
pub fn create_dir_and_file(&self) -> Result<(), String>
pub fn to_url_string(&self) -> Result<String, String>
Trait Implementations§
Source§impl Clone for FileLocation
impl Clone for FileLocation
Source§fn clone(&self) -> FileLocation
fn clone(&self) -> FileLocation
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 Debug for FileLocation
impl Debug for FileLocation
Source§impl<'de> Deserialize<'de> for FileLocation
impl<'de> Deserialize<'de> for FileLocation
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
Source§impl Display for FileLocation
impl Display for FileLocation
Source§impl Hash for FileLocation
impl Hash for FileLocation
Source§impl PartialEq for FileLocation
impl PartialEq for FileLocation
Source§impl Serialize for FileLocation
impl Serialize for FileLocation
impl Eq for FileLocation
impl StructuralPartialEq for FileLocation
Auto Trait Implementations§
impl Freeze for FileLocation
impl RefUnwindSafe for FileLocation
impl Send for FileLocation
impl Sync for FileLocation
impl Unpin for FileLocation
impl UnwindSafe for FileLocation
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.