Add tags to Rust std lib functions (#6701)

Signed-off-by: Nick Cameron <nrc@ncameron.org>
This commit is contained in:
Nick Cameron
2025-05-06 14:14:11 +12:00
committed by GitHub
parent 0464de33b1
commit 9c52f5b19a
127 changed files with 892 additions and 447 deletions

View File

@ -53,7 +53,8 @@ pub async fn segment_end(exec_state: &mut ExecState, args: Args) -> Result<KclVa
unlabeled_first = true,
args = {
tag = { docs = "The line segment being queried by its tag"},
}
},
tags = ["sketch"]
}]
fn inner_segment_end(tag: &TagIdentifier, exec_state: &mut ExecState, args: Args) -> Result<[TyF64; 2], KclError> {
let line = args.get_tag_engine_info(exec_state, tag)?;
@ -94,7 +95,8 @@ pub async fn segment_end_x(exec_state: &mut ExecState, args: Args) -> Result<Kcl
unlabeled_first = true,
args = {
tag = { docs = "The line segment being queried by its tag"},
}
},
tags = ["sketch"]
}]
fn inner_segment_end_x(tag: &TagIdentifier, exec_state: &mut ExecState, args: Args) -> Result<TyF64, KclError> {
let line = args.get_tag_engine_info(exec_state, tag)?;
@ -136,7 +138,8 @@ pub async fn segment_end_y(exec_state: &mut ExecState, args: Args) -> Result<Kcl
unlabeled_first = true,
args = {
tag = { docs = "The line segment being queried by its tag"},
}
},
tags = ["sketch"]
}]
fn inner_segment_end_y(tag: &TagIdentifier, exec_state: &mut ExecState, args: Args) -> Result<TyF64, KclError> {
let line = args.get_tag_engine_info(exec_state, tag)?;
@ -189,7 +192,8 @@ pub async fn segment_start(exec_state: &mut ExecState, args: Args) -> Result<Kcl
unlabeled_first = true,
args = {
tag = { docs = "The line segment being queried by its tag"},
}
},
tags = ["sketch"]
}]
fn inner_segment_start(tag: &TagIdentifier, exec_state: &mut ExecState, args: Args) -> Result<[TyF64; 2], KclError> {
let line = args.get_tag_engine_info(exec_state, tag)?;
@ -230,7 +234,8 @@ pub async fn segment_start_x(exec_state: &mut ExecState, args: Args) -> Result<K
unlabeled_first = true,
args = {
tag = { docs = "The line segment being queried by its tag"},
}
},
tags = ["sketch"]
}]
fn inner_segment_start_x(tag: &TagIdentifier, exec_state: &mut ExecState, args: Args) -> Result<TyF64, KclError> {
let line = args.get_tag_engine_info(exec_state, tag)?;
@ -272,7 +277,8 @@ pub async fn segment_start_y(exec_state: &mut ExecState, args: Args) -> Result<K
unlabeled_first = true,
args = {
tag = { docs = "The line segment being queried by its tag"},
}
},
tags = ["sketch"]
}]
fn inner_segment_start_y(tag: &TagIdentifier, exec_state: &mut ExecState, args: Args) -> Result<TyF64, KclError> {
let line = args.get_tag_engine_info(exec_state, tag)?;
@ -314,7 +320,8 @@ pub async fn last_segment_x(exec_state: &mut ExecState, args: Args) -> Result<Kc
unlabeled_first = true,
args = {
sketch = { docs = "The sketch whose line segment is being queried"},
}
},
tags = ["sketch"]
}]
fn inner_last_segment_x(sketch: Sketch, args: Args) -> Result<TyF64, KclError> {
let last_line = sketch
@ -360,7 +367,8 @@ pub async fn last_segment_y(exec_state: &mut ExecState, args: Args) -> Result<Kc
unlabeled_first = true,
args = {
sketch = { docs = "The sketch whose line segment is being queried"},
}
},
tags = ["sketch"]
}]
fn inner_last_segment_y(sketch: Sketch, args: Args) -> Result<TyF64, KclError> {
let last_line = sketch
@ -409,7 +417,8 @@ pub async fn segment_length(exec_state: &mut ExecState, args: Args) -> Result<Kc
unlabeled_first = true,
args = {
tag = { docs = "The line segment being queried by its tag"},
}
},
tags = ["sketch"]
}]
fn inner_segment_length(tag: &TagIdentifier, exec_state: &mut ExecState, args: Args) -> Result<TyF64, KclError> {
let line = args.get_tag_engine_info(exec_state, tag)?;
@ -452,7 +461,8 @@ pub async fn segment_angle(exec_state: &mut ExecState, args: Args) -> Result<Kcl
unlabeled_first = true,
args = {
tag = { docs = "The line segment being queried by its tag"},
}
},
tags = ["sketch"]
}]
fn inner_segment_angle(tag: &TagIdentifier, exec_state: &mut ExecState, args: Args) -> Result<f64, KclError> {
let line = args.get_tag_engine_info(exec_state, tag)?;
@ -553,7 +563,8 @@ pub async fn tangent_to_end(exec_state: &mut ExecState, args: Args) -> Result<Kc
unlabeled_first = true,
args = {
tag = { docs = "The line segment being queried by its tag"},
}
},
tags = ["sketch"]
}]
async fn inner_tangent_to_end(tag: &TagIdentifier, exec_state: &mut ExecState, args: Args) -> Result<f64, KclError> {
let line = args.get_tag_engine_info(exec_state, tag)?;