1 <!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="This function is an override for the C function, this is the an edited version of the original description:"><title>rustsecp256k1_v0_10_0_default_illegal_callback_fn in bdk_chain::bitcoin::secp256k1::ffi - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../static.files/rustdoc-46132b98.css"><meta name="rustdoc-vars" data-root-path="../../../../" data-static-root-path="../../../../static.files/" data-current-crate="bdk_chain" data-themes="" data-resource-suffix="" data-rustdoc-version="1.85.0-nightly (6d9f6ae36 2024-12-16)" data-channel="nightly" data-search-js="search-036cda7a.js" data-settings-js="settings-0f613d39.js" ><script src="../../../../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button><a class="logo-container" href="../../../../bdk_chain/index.html"><img src="https://github.com/bitcoindevkit/bdk/raw/master/static/bdk.png" alt=""></a></nav><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../../../../bdk_chain/index.html"><img src="https://github.com/bitcoindevkit/bdk/raw/master/static/bdk.png" alt="logo"></a><h2><a href="../../../../bdk_chain/index.html">bdk_<wbr>chain</a><span class="version">0.21.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">rustsecp256k1_<wbr>v0_<wbr>10_<wbr>0_<wbr>default_<wbr>illegal_<wbr>callback_<wbr>fn</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#safety" title="Safety">Safety</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In bdk_<wbr>chain::<wbr>bitcoin::<wbr>secp256k1::<wbr>ffi</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../../../index.html">bdk_chain</a>::<wbr><a href="../../index.html">bitcoin</a>::<wbr><a href="../index.html">secp256k1</a>::<wbr><a href="index.html">ffi</a></span><h1>Function <span class="fn">rustsecp256k1_v0_10_0_default_illegal_callback_fn</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"></span></div><pre class="rust item-decl"><code>pub unsafe extern "C" fn rustsecp256k1_v0_10_0_default_illegal_callback_fn(
2 message: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.pointer.html">*const </a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i8.html">i8</a>,
3 _data: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.pointer.html">*mut </a><a class="enum" href="types/enum.c_void.html" title="enum bdk_chain::bitcoin::secp256k1::ffi::types::c_void">c_void</a>,
4 )</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p><strong>This function is an override for the C function, this is the an edited version of the original description:</strong></p>
5 <p>A callback function to be called when an illegal argument is passed to
6 an API call. It will only trigger for violations that are mentioned
7 explicitly in the header. <strong>This will cause a panic</strong>.</p>
8 <p>The philosophy is that these shouldn’t be dealt with through a
9 specific return value, as calling code should not have branches to deal with
10 the case that this code itself is broken.</p>
11 <p>On the other hand, during debug stage, one would want to be informed about
12 such mistakes, and the default (crashing) may be inadvisable.
13 When this callback is triggered, the API function called is guaranteed not
14 to cause a crash, though its return value and output arguments are
16 <p>See also secp256k1_default_error_callback_fn.</p>
17 <h2 id="safety"><a class="doc-anchor" href="#safety">§</a>Safety</h2>
18 <p><code>message</code> string should be a null terminated C string and, up to the first null byte, must be valid UTF8.</p>
19 <p>For exact safety constraints see <a href="https://doc.rust-lang.org/nightly/core/slice/raw/fn.from_raw_parts.html" title="fn core::slice::raw::from_raw_parts"><code>std::slice::from_raw_parts</code></a> and <a href="https://doc.rust-lang.org/nightly/core/str/converts/fn.from_utf8_unchecked.html" title="fn core::str::converts::from_utf8_unchecked"><code>std::str::from_utf8_unchecked</code></a>.</p>
20 </div></details></section></div></main></body></html>