pub struct SimpleExtensions {
uris: BTreeMap<u32, String>,
extensions: BTreeMap<(u32, ExtensionKind), (u32, String)>,
}
Expand description
ExtensionLookup contains mappings from anchors to extension URIs, functions, types, and type variations.
Fields§
§uris: BTreeMap<u32, String>
§extensions: BTreeMap<(u32, ExtensionKind), (u32, String)>
Implementations§
Source§impl SimpleExtensions
impl SimpleExtensions
pub fn new() -> Self
pub fn from_extensions<'a>( uris: impl IntoIterator<Item = &'a SimpleExtensionUri>, extensions: impl IntoIterator<Item = &'a SimpleExtensionDeclaration>, ) -> (Self, Vec<InsertError>)
pub fn add_extension_uri( &mut self, uri: String, anchor: u32, ) -> Result<(), InsertError>
pub fn add_extension( &mut self, kind: ExtensionKind, uri: u32, anchor: u32, name: String, ) -> Result<(), InsertError>
pub fn is_empty(&self) -> bool
Sourcepub fn to_extension_uris(&self) -> Vec<SimpleExtensionUri>
pub fn to_extension_uris(&self) -> Vec<SimpleExtensionUri>
Convert the extension URIs to protobuf format for Plan construction.
Sourcepub fn to_extension_declarations(&self) -> Vec<SimpleExtensionDeclaration>
pub fn to_extension_declarations(&self) -> Vec<SimpleExtensionDeclaration>
Convert the extensions to protobuf format for Plan construction.
Sourcepub fn write<W: Write>(&self, w: &mut W, indent: &str) -> Result
pub fn write<W: Write>(&self, w: &mut W, indent: &str) -> Result
Write the extensions to the given writer, with the given indent.
The header will be included if there are any extensions.
pub fn to_string(&self, indent: &str) -> String
Source§impl SimpleExtensions
impl SimpleExtensions
pub fn find_uri(&self, anchor: u32) -> Result<&str, MissingReference>
pub fn find_by_anchor( &self, kind: ExtensionKind, anchor: u32, ) -> Result<(u32, &str), MissingReference>
pub fn find_by_name<'a>( &'a self, kind: ExtensionKind, name: &'a str, ) -> Result<u32, MissingReference>
pub fn is_name_unique( &self, kind: ExtensionKind, anchor: u32, name: &str, ) -> Result<bool, MissingReference>
Trait Implementations§
Source§impl Clone for SimpleExtensions
impl Clone for SimpleExtensions
Source§fn clone(&self) -> SimpleExtensions
fn clone(&self) -> SimpleExtensions
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for SimpleExtensions
impl Debug for SimpleExtensions
Source§impl Default for SimpleExtensions
impl Default for SimpleExtensions
Source§fn default() -> SimpleExtensions
fn default() -> SimpleExtensions
Returns the “default value” for a type. Read more
Source§impl PartialEq for SimpleExtensions
impl PartialEq for SimpleExtensions
impl StructuralPartialEq for SimpleExtensions
Auto Trait Implementations§
impl Freeze for SimpleExtensions
impl RefUnwindSafe for SimpleExtensions
impl Send for SimpleExtensions
impl Sync for SimpleExtensions
impl Unpin for SimpleExtensions
impl UnwindSafe for SimpleExtensions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more