Creates a new [`ListingTableUrl`] from a url and optional glob expression [`Self::parse`] supports glob expression only for file system paths. However, some applications may want to support glob expression for URLs with a scheme. The application can split the URL into a base URL and a glob expression and use this method to create a [`ListingTableUrl`].
(url: Url, glob: Option<Pattern>)
| 148 | /// The application can split the URL into a base URL and a glob expression and use this method |
| 149 | /// to create a [`ListingTableUrl`]. |
| 150 | pub fn try_new(url: Url, glob: Option<Pattern>) -> Result<Self> { |
| 151 | let prefix = Path::from_url_path(url.path())?; |
| 152 | Ok(Self { |
| 153 | url, |
| 154 | prefix, |
| 155 | glob, |
| 156 | table_ref: None, |
| 157 | }) |
| 158 | } |
| 159 | |
| 160 | /// Returns the URL scheme |
| 161 | pub fn scheme(&self) -> &str { |