pub struct PlRefPath { /* private fields */ }Expand description
Implementations§
Source§impl PlRefPath
impl PlRefPath
pub fn empty() -> PlRefPath
pub fn try_from_path(path: &Path) -> Result<PlRefPath, PolarsError>
pub fn try_from_pathbuf(path: PathBuf) -> Result<PlRefPath, PolarsError>
pub fn as_str(&self) -> &str
pub fn as_ref_str(&self) -> &PlRefStr
pub fn into_ref_str(self) -> PlRefStr
Sourcepub fn to_absolute_path(&self) -> Result<Cow<'_, PlRefPath>, PolarsError>
pub fn to_absolute_path(&self) -> Result<Cow<'_, PlRefPath>, PolarsError>
§Returns
Returns an absolute local path if this path ref is a relative local path, otherwise returns None.
Methods from Deref<Target = PlPath>§
pub fn as_str(&self) -> &str
pub fn as_bytes(&self) -> &[u8] ⓘ
pub fn as_os_str(&self) -> &OsStr
pub fn as_std_path(&self) -> &Path
pub fn to_ref_path(&self) -> PlRefPath
pub fn scheme(&self) -> Option<CloudScheme>
Sourcepub fn has_scheme(&self) -> bool
pub fn has_scheme(&self) -> bool
Shorthand for self.scheme().is_some().
Sourcepub fn strip_scheme(&self) -> &str
pub fn strip_scheme(&self) -> &str
Return a string with the scheme prefix removed (if any).
pub fn file_name(&self) -> Option<&OsStr>
pub fn extension(&self) -> Option<&str>
pub fn parent(&self) -> Option<&str>
Strips the scheme, then returns the authority component, and the remaining string after the authority component. This can be understood as extracting the bucket/prefix for cloud URIs.
E.g. https://user@host:port/dir/file?param=value
- Authority:
user@host:port - Remaining:
/dir/file?param=value
Note, for local / file: URIs, the returned authority will be empty, and
the remainder will be the full URI.
§Returns
(authority, remaining).
Returns 0 if self.scheme() is None. Otherwise, returns i such that
&self.to_str()[..i] trims to the authority.
- If there is no ‘/’, separator found,
iwill simply be the length of the string.- This is except if the scheme is
FileNoHostname, where insteadiwill be “file:”.len()
- This is except if the scheme is
- If
selfhas noCloudScheme, returns 0
pub fn to_absolute_path(&self) -> Result<PlRefPath, PolarsError>
pub fn join(&self, other: impl AsRef<str>) -> PlRefPath
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PlRefPath
impl<'de> Deserialize<'de> for PlRefPath
Source§fn deserialize<D>(
deserializer: D,
) -> Result<PlRefPath, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<PlRefPath, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Ord for PlRefPath
impl Ord for PlRefPath
Source§impl PartialOrd for PlRefPath
impl PartialOrd for PlRefPath
Source§impl Serialize for PlRefPath
impl Serialize for PlRefPath
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Eq for PlRefPath
impl StructuralPartialEq for PlRefPath
Auto Trait Implementations§
impl Freeze for PlRefPath
impl RefUnwindSafe for PlRefPath
impl Send for PlRefPath
impl Sync for PlRefPath
impl Unpin for PlRefPath
impl UnwindSafe for PlRefPath
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,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 moreSource§impl<T> Key for Twhere
T: Clone,
impl<T> Key for Twhere
T: Clone,
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of [
ToCompactString::to_compact_string()] Read more§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a [
CompactString]. Read more§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.