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

Faq code subsections #50

Merged
merged 1 commit into from
Nov 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ An online version of the book is available at [godot-rust.github.io/book/](https
The book is built with [mdBook](https://github.com/rust-lang-nursery/mdBook). To build the book locally, you can run:

```
$ cargo install mdbook
$ cargo install mdbook mdbook-toc
$ mdbook build
```

Expand Down
5 changes: 5 additions & 0 deletions book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,8 @@ authors = ["The godot-rust developers"]
multilingual = false
src = "src"
title = "The godot-rust Book"

[preprocessor.toc]
max-level = 2
command = "mdbook-toc"
renderer = ["html"]
3 changes: 3 additions & 0 deletions src/faq/code.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# FAQ: Common code questions

## Table of contents
<!-- toc -->

## What is the `BorrowFailed` error and why do I keep getting it?
astrale-sharp marked this conversation as resolved.
Show resolved Hide resolved

In Rust, [there can only be *one* `&mut` reference to the same memory location at the same time](https://docs.rs/dtolnay/0.0.9/dtolnay/macro._02__reference_types.html). To enforce this while making simple use cases easier, the bindings make use of [interior mutability](https://doc.rust-lang.org/book/ch15-05-interior-mutability.html). This works like a lock: whenever a method with `&mut self` is called, it will try to obtain a lock on the `self` value, and hold it *until it returns*. As a result, if another method that takes `&mut self` is called in the meantime for whatever reason (e.g. signals), the lock will fail and an error (`BorrowFailed`) will be produced.
Expand Down
3 changes: 3 additions & 0 deletions src/faq/community.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# FAQ: Community

## Table of contents
<!-- toc -->

## I need help, where can I ask?

The godot-rust project uses several different sources for different kinds of information.
Expand Down
3 changes: 3 additions & 0 deletions src/faq/configuration.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# FAQ: Configuration

## Table of contents
<!-- toc -->

## How do I create the library file for my GDNative binary?

You can create .gdnlib files with either of the following methods.
Expand Down
3 changes: 3 additions & 0 deletions src/faq/godot4.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# FAQ: Godot 4.0 Status

## Table of contents
<!-- toc -->

## What is the status of Godot 4 Support?

Currently we are still in the planning phase of determining how to support Godot 4.0 and where we will focus our efforts in the future.
Expand Down
3 changes: 3 additions & 0 deletions src/faq/multithreading.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# FAQ: Multithreading

## Table of contents
<!-- toc -->

## How do I use multithreading?

Follow [Godot's thread safety guidelines](https://docs.godotengine.org/en/stable/tutorials/threads/index.html) and change your settings to "Multi-threaded" in "Project Settings > Rendering > Threading".
Expand Down
3 changes: 3 additions & 0 deletions src/faq/support.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# FAQ: Versioning and supported platforms

## Table of contents
<!-- toc -->

## What does godot-rust's version mean?

godot-rust follows [Cargo's semantic versioning](https://doc.rust-lang.org/cargo/reference/semver.html) for the API breaking changes.
Expand Down