froydnj opened PR #1389 from define-function-trap-sink to master:
Experience with the
define_functionAPI has shown that returning borrowed slices ofTrapSiteis not ideal: the returned slice represents a borrow on the entireModule, which makes calling back into methods taking&mut selfa bit tricky.To eliminate the problem, let's require the callers of
define_functionto provideTrapSinkinstances. This style of API enables them to control when and how traps are collected, and makes theobjectandfaeriebackends simpler/more efficient by not having to worry about trap collection.This has been discussed in #1184 and #1214. I opted not to go this route because I thought the
&[TrapSite]version was easier. Experience has shown that was a mistake.
froydnj requested pchickey for a review on PR #1389.
froydnj updated PR #1389 from define-function-trap-sink to master:
Experience with the
define_functionAPI has shown that returning borrowed slices ofTrapSiteis not ideal: the returned slice represents a borrow on the entireModule, which makes calling back into methods taking&mut selfa bit tricky.To eliminate the problem, let's require the callers of
define_functionto provideTrapSinkinstances. This style of API enables them to control when and how traps are collected, and makes theobjectandfaeriebackends simpler/more efficient by not having to worry about trap collection.This has been discussed in #1184 and #1214. I opted not to go this route because I thought the
&[TrapSite]version was easier. Experience has shown that was a mistake.
pchickey submitted PR Review.
froydnj closed without merge PR #1389.
froydnj reopened PR #1389 from define-function-trap-sink to master:
Experience with the
define_functionAPI has shown that returning borrowed slices ofTrapSiteis not ideal: the returned slice represents a borrow on the entireModule, which makes calling back into methods taking&mut selfa bit tricky.To eliminate the problem, let's require the callers of
define_functionto provideTrapSinkinstances. This style of API enables them to control when and how traps are collected, and makes theobjectandfaeriebackends simpler/more efficient by not having to worry about trap collection.This has been discussed in #1184 and #1214. I opted not to go this route because I thought the
&[TrapSite]version was easier. Experience has shown that was a mistake.
froydnj merged PR #1389.
Last updated: Dec 06 2025 at 06:05 UTC