1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-24 15:19:26 -05:00

chore: make fields public on PermissionDeniedError and deno_kv::KvConfig (#26798)

A few small changes to avoid needing unsafe mem transmutes to
instantiate the extensions

---------

Signed-off-by: Richard Carson <Rscarson@rogers.com>
This commit is contained in:
Richard Carson 2024-11-12 12:49:49 -05:00 committed by GitHub
parent c371b2a492
commit 01f3451869
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 13 additions and 12 deletions

View file

@ -1,16 +1,17 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
#[derive(Clone, Copy, Debug)]
pub struct KvConfig { pub struct KvConfig {
pub(crate) max_write_key_size_bytes: usize, pub max_write_key_size_bytes: usize,
pub(crate) max_read_key_size_bytes: usize, pub max_read_key_size_bytes: usize,
pub(crate) max_value_size_bytes: usize, pub max_value_size_bytes: usize,
pub(crate) max_read_ranges: usize, pub max_read_ranges: usize,
pub(crate) max_read_entries: usize, pub max_read_entries: usize,
pub(crate) max_checks: usize, pub max_checks: usize,
pub(crate) max_mutations: usize, pub max_mutations: usize,
pub(crate) max_watched_keys: usize, pub max_watched_keys: usize,
pub(crate) max_total_mutation_size_bytes: usize, pub max_total_mutation_size_bytes: usize,
pub(crate) max_total_key_size_bytes: usize, pub max_total_key_size_bytes: usize,
} }
impl KvConfig { impl KvConfig {

View file

@ -40,8 +40,8 @@ pub use prompter::PromptResponse;
#[derive(Debug, thiserror::Error)] #[derive(Debug, thiserror::Error)]
#[error("Requires {access}, {}", format_permission_error(.name))] #[error("Requires {access}, {}", format_permission_error(.name))]
pub struct PermissionDeniedError { pub struct PermissionDeniedError {
access: String, pub access: String,
name: &'static str, pub name: &'static str,
} }
fn format_permission_error(name: &'static str) -> String { fn format_permission_error(name: &'static str) -> String {