Skip to main content

Crate sdl3_net_sys

Crate sdl3_net_sys 

Source
Expand description

§sdl3-net-sys: Low level Rust bindings for SDL3_net

These are low level Rust bindings for SDL3_net, an add-on library for SDL 3 for networking. This version of sdl3-net-sys has bindings for SDL_net version 3.1.0-prerelease.

Most of the docs are generated directly from the C headers and document how SDL works in C. Using it from Rust might work differently in some cases. For example, macros in C are usually translated to constants or constant functions in Rust. Documentation specific to these Rust bindings are tagged with sdl3-sys.

Browse the API at docs.rs!

§Usage

sdl3-net-sys is compatible with SDL_net version 3.2.0 or later. Some APIs may require later versions; you can check availability in the documentation. The latest available stable release is recommended.

By default, sdl3-net-sys will attempt to link to a dynamic/shared library named SDL3_net in the default library search path, using the usual platform specific naming convention for libraries. You can change this behaviour with the following feature flags.

FeatureDescription
use-pkg-configUse pkg-config to find and link the SDL_net library.
use-vcpkgUse vcpkg to find and link the SDL_net library.
build-from-sourceBuild and link SDL_net from source. You have to install any dependencies SDL needs to build for your target first. See below for build related features.
build-from-source-staticShortcut for enabling both the build-from-source and link-static features. This should no longer be necessary.
build-static-vendoredBuild and link SDL_net from source, use vendored libraries (see below), and link it all statically.
link-frameworkLink to a framework on Apple targets. This currently requires SDL3_net.xcframework to be located at ~/Library/Frameworks or /Library/Frameworks. The built executable has to be put in a signed app bundle to be able to run.
link-staticLink SDL_net statically.
no-linkDon’t link anything, and provide linking flags via Cargo metadata so you can do manual linking if desired.

§Building from source

§Other features

FeatureDescription
debug-implsImplement the Debug trait for most SDL_net types.
metadataEnable metadata. Also see only-metadata.
only-metadataShortcut for enabling both the metadata and no-link features. Recommended when you need metadata but don’t need to call into SDL_net, e.g. for build scripts.

§Recent changes

  • 0.6.0-pre-0:
    • Prerelease

See ChangeLog.md for older changes

Modules§

net
SDL_net is a simple library to help with networking.