pub struct DistributionTable { /* private fields */ }Expand description
Everything wsl --list --verbose reported, and everything it reported that
could not be read.
Implementations§
Source§impl DistributionTable
impl DistributionTable
Sourcepub fn from_console_output(bytes: &[u8]) -> Self
pub fn from_console_output(bytes: &[u8]) -> Self
Parses raw console bytes, choosing the encoding.
Sourcepub fn entries(&self) -> &[InstalledDistribution]
pub fn entries(&self) -> &[InstalledDistribution]
Every row that parsed.
Sourcepub fn unreadable(&self) -> &[String]
pub fn unreadable(&self) -> &[String]
Rows that looked like rows and whose name did not survive decoding.
Reported rather than dropped: an operator whose distribution is missing
from wsl list deserves to be told that a row was unreadable, not that
nothing is installed.
Sourcepub fn default_distribution(&self) -> Option<&InstalledDistribution>
pub fn default_distribution(&self) -> Option<&InstalledDistribution>
The row WSL marked with *, if any.
Sourcepub fn names(&self) -> Vec<String>
pub fn names(&self) -> Vec<String>
The names that parsed, in order, for an error that has to list them.
Sourcepub fn exactly(&self, name: &str) -> Result<&InstalledDistribution, WslError>
pub fn exactly(&self, name: &str) -> Result<&InstalledDistribution, WslError>
The one row whose name is exactly name.
Exact and case-sensitive. WSL’s own --distribution is case-sensitive,
so accepting ubuntu for Ubuntu here would produce a provider record
and a task naming a distribution that wsl.exe then cannot select.
§Errors
WslError::InvalidName when the name is not usable at all;
WslError::NotInstalled when nothing matches, listing what is there;
WslError::AmbiguousName when two rows carry it, which means the
table is not something to act on.
Trait Implementations§
Source§impl Clone for DistributionTable
impl Clone for DistributionTable
Source§fn clone(&self) -> DistributionTable
fn clone(&self) -> DistributionTable
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more