Skip to content

Conversation

@sevenc-nanashi
Copy link
Owner

No description provided.

Copy link

@White-Green White-Green left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Webフロントっぽいところは見てません

/// # Panics
///
/// プラグインが初期化されていない場合や、二重に呼び出された場合にパニックします。
fn with_instance<R>(f: impl FnOnce(&Self) -> R) -> R

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#[inline]つけないとインライン展開されないかも
詳しく知らないので嘘かも

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

実はいつinlineするべきかがわかっていない

/// - `key`にヌル文字が含まれている場合、失敗します。
/// - `data` の長さが保存されているデータの長さと一致しない場合、失敗します。
/// - 指定されたキーに対応するデータが存在しない場合、失敗します。
pub fn get_param_binary(&self, key: &str, data: &mut [u8]) -> AnyResult<()> {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

長さ一致は厳しい制約だなぁとおもったがSDK側がそういう仕様なのか(バッファのほうが長い分にはOKで、読み込まれたバイト数を返すAPIのほうがよく見る)
悩ましい...

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

なんと、そういう仕様(どうして...)

}

/// オブジェクトを削除します。
pub fn delete_object(&self, object: &ObjectHandle) -> AnyResult<()> {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

引数&ObjectHandleじゃなくてObjectHandleにしたくないですか
同様に更新系は&mut ObjectHandleをとるとか

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

実はオブジェクトを削除してもObjectHandleは有効(具体的にはundo)なので、やめた
mutのほうが良さそうというのはそう、というかSync切ってはいるけどmut selfにしたほうが良いかも

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

&mut selfにしたらsections.layers()とlayer.objects()で回すパターンができなくなってちょっと頭を抱えている(!SyncではあるのでUBは起きないはずだがそれはそれとして普通にMutableが複数存在しているのは良くない...)

@github-actions

This comment was marked as duplicate.

@github-actions
Copy link

github-actions bot commented Nov 17, 2025

プレビューがデプロイされました:
https://pr-20-aviutl2-rs-doc.sevenc7c.workers.dev

更新時点でのコミット: 6450ce5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants