Crate cpp_utils [] [src]

Various C++-related types and functions needed for the cpp_to_rust project.

Modules

new_uninitialized

This module contains NewUninitialized trait. It's an implementation detail of cpp_to_rust and should not be used directly.

Structs

CppBox

A C++ pointer wrapper to manage deletion of objects.

Traits

CppDeletable

Indicates that the type can be put into a CppBox.

DynamicCast

Provides access to C++ dynamic_cast conversion.

StaticCast

Provides access to C++ static_cast conversion from derived class to base class.

UnsafeStaticCast

Provides access to C++ static_cast conversion from base class to derived class.

Functions

dynamic_cast

Converts type of a const pointer using DynamicCast implementation of the type. ptr must be either a null pointer or a valid pointer to an instance of T class or a class derived from T. Returns null pointer if ptr does not point to an instance of R or an instance of a class derived from R. If ptr is null, this function does nothing and returns null pointer.

dynamic_cast_mut

Converts type of a mutable pointer using DynamicCast implementation of the type. ptr must be either a null pointer or a valid pointer to an instance of T class or a class derived from T. Returns null pointer if ptr does not point to an instance of R. If ptr is null, this function does nothing and returns null pointer.

static_cast

Converts type of a const pointer using StaticCast implementation of the type. If ptr is null, this function does nothing and returns null pointer.

static_cast_mut

Converts type of a mutable pointer using StaticCast implementation of the type. If ptr is null, this function does nothing and returns null pointer.

unsafe_static_cast

Converts type of a const pointer using UnsafeStaticCast implementation of the type. ptr must be either a null pointer or a valid pointer to an instance of R class or a class derived from R. If ptr is null, this function does nothing and returns null pointer.

unsafe_static_cast_mut

Converts type of a mutable pointer using UnsafeStaticCast implementation of the type. ptr must be either a null pointer or a valid pointer to an instance of R class or a class derived from R. If ptr is null, this function does nothing and returns null pointer.

Type Definitions

Deleter

Deleter function type.