Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docs for #[rpc] #949

Merged
merged 4 commits into from
Nov 10, 2024
Merged

Add docs for #[rpc] #949

merged 4 commits into from
Nov 10, 2024

Conversation

Bromeon
Copy link
Member

@Bromeon Bromeon commented Nov 10, 2024

Adds #[godot_api] level documentation for the #[rpc] attribute added in #807.
Moves RpcConfig from godot::meta to godot::register.

Also mentions that you can use functions instead of constants, which allow the use of the Default trait:

fn provide_cfg() -> RpcConfig {
    RpcConfig {
        transfer_mode: TransferMode::RELIABLE,
        channel: 1,
        ..Default::default()
    }
}

#[godot_api]
impl RpcTest {
    #[rpc(config = provide_cfg())]
    pub fn my_rpc_method(&mut self) {}
}

@Bromeon Bromeon added documentation Improvements or additions to documentation c: register Register classes, functions and other symbols to GDScript labels Nov 10, 2024
@Bromeon Bromeon added this to the 0.2 milestone Nov 10, 2024
@GodotRust
Copy link

API docs are being generated and will be shortly available at: https://godot-rust.github.io/docs/gdext/pr-949

@Bromeon Bromeon added this pull request to the merge queue Nov 10, 2024
Merged via the queue into master with commit f40fa27 Nov 10, 2024
45 checks passed
@Bromeon Bromeon deleted the qol/rpc-docs branch November 10, 2024 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: register Register classes, functions and other symbols to GDScript documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants