pub struct ToolInfo {
pub sections: BTreeMap<EcoString, Table>,
}
Expand description
The [tool]
key in the manifest. This field can be used to retrieve
3rd-party tool configuration.
§Examples
#[derive(Debug, PartialEq, Serialize, Deserialize)]
struct MyTool {
key: EcoString,
}
let mut manifest: PackageManifest = toml::from_str(r#"
[package]
name = "package"
version = "0.1.0"
entrypoint = "src/lib.typ"
[tool.my-tool]
key = "value"
"#)?;
let my_tool = manifest
.tool
.sections
.remove("my-tool")
.ok_or("tool.my-tool section missing")?;
let my_tool = MyTool::deserialize(my_tool)?;
assert_eq!(my_tool, MyTool { key: "value".into() });
Fields§
§sections: BTreeMap<EcoString, Table>
Any fields parsed in the tool section.
Trait Implementations§
source§impl<'de> Deserialize<'de> for ToolInfo
impl<'de> Deserialize<'de> for ToolInfo
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
impl StructuralPartialEq for ToolInfo
Auto Trait Implementations§
impl Freeze for ToolInfo
impl RefUnwindSafe for ToolInfo
impl Send for ToolInfo
impl Sync for ToolInfo
impl Unpin for ToolInfo
impl UnwindSafe for ToolInfo
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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 more