core-adapters 0.1.2
Third-party adapters for snicholls-core: nanobind helpers, nlohmann/json hooks, the snicholls_core Python package
Loading...
Searching...
No Matches
snicholls::python::mutable_byte_view Class Reference

A writable view of a Python object's contiguous buffer. More...

#include <snicholls/core_adapters/nanobind/bytes.hpp>

Public Member Functions

std::span< std::byte > bytes () const noexcept
 The bytes.
 
std::size_t size () const noexcept
 The length in bytes.
 
bool acquire (PyObject *src) noexcept
 Takes src's writable buffer (the type caster's step).
 

Detailed Description

A writable view of a Python object's contiguous buffer.

Definition at line 186 of file bytes.hpp.

Member Function Documentation

◆ acquire()

bool snicholls::python::mutable_byte_view::acquire ( PyObject *  src)
inlinenoexcept

Takes src's writable buffer (the type caster's step).

Parameters
srcthe object.
Returns
whether it has one.

Definition at line 195 of file bytes.hpp.

◆ bytes()

std::span< std::byte > snicholls::python::mutable_byte_view::bytes ( ) const
inlinenoexcept

The bytes.

Returns
a span valid while this view lives.

Definition at line 190 of file bytes.hpp.

◆ size()

std::size_t snicholls::python::mutable_byte_view::size ( ) const
inlinenoexcept

The length in bytes.

Returns
the size.

Definition at line 192 of file bytes.hpp.


The documentation for this class was generated from the following file: