Expand description
CosNaming (Naming Service): NamingContext, NamingContextExt and BindingIterator, with persistence behind a storage trait.
The client side: NamingContext, NamingContextExt and
BindingIterator are stubs for the interfaces of the CosNaming IDL
(Naming Service 1.3), over the ones rustorb-idl -brust generates in
idl::cos_naming, with the names of rustorb_core::name. The user
exceptions of the operations are the variants of NamingError.
Code generated from IDL that uses CosNaming refers to idl::cos_naming
(-Wbextern=CosNaming=rustorb_naming::idl::cos_naming).
The server side: NamingService serves the naming contexts on an
ORB, with the root context at corbaloc::host:port/NameService like
omniNames, and keeps the bindings in a Store: LogStore (an
append-only log and checkpoints) by default, or MemoryStore. The
rustorb-names binary is the daemon.
use rustorb_core::Orb;
use rustorb_naming::{NamingContextExt, to_name};
let mut args = vec![
"-ORBInitRef".to_owned(),
"NameService=corbaloc::localhost:2809/NameService".to_owned(),
];
let orb = Orb::init(&mut args)?;
let obj = orb.resolve_initial_references("NameService")?;
let root = NamingContextExt::narrow(obj)?.ok_or("not a NamingContextExt")?;
root.bind_new_context(&to_name("app")?)?;
let echo = root.resolve_str("app/Echo")?;Names and their string form (Name, to_name, to_string) come
from rustorb_core::name, which corbaname: URLs use too:
Orb::string_to_object("corbaname::host:2809#app/Echo") resolves the
name without this crate.
Re-exports§
pub use store::LogStore;pub use store::MemoryStore;pub use store::Store;
Modules§
- idl
- The code
rustorb-idl -brustgenerates from the CosNaming IDL (crates/rustorb-codegen/generate-rust.shwritessrc/idl/). - repository_
id - Repository ids of the CosNaming interfaces and exceptions.
- store
- Where the naming service keeps its bindings: the
Storetrait, the in-memoryMemoryStoreand the defaultLogStore(an append-only log and checkpoints).
Structs§
- Binding
CosNaming::Binding: one entry of a context, fromlistor aBindingIterator.- Binding
Iterator - A stub for
CosNaming::BindingIterator, fromNamingContext::list. - Invalid
Name - A stringified name is malformed, or a name has no components
(
CosNaming::NamingContext::InvalidNamewhen the conversion is local). - Name
Component CosNaming::NameComponent: one step of aName.- Naming
Context - A stub for
CosNaming::NamingContext, over the onerustorb-idl -brustgenerates (crate::idl::cos_naming::NamingContext) with the names ofrustorb_core::nameand the errors ofNamingError. - Naming
Context Ext - A stub for
CosNaming::NamingContextExt: aNamingContext(which it dereferences to) that also works with stringified names andcorbaname:URLs. - Naming
Service - A CosNaming naming service served by an ORB: the root context and the
contexts created from it, with their bindings in a
Store.
Enums§
- Binding
Type CosNaming::BindingType: what a name is bound to.- Naming
Error - How a naming operation failed: one of the CosNaming user exceptions, or a system exception.
- NotFound
Reason CosNaming::NamingContext::NotFoundReason: why a name was not found.- Start
Error - Why a
NamingServicecould not start.
Constants§
- ROOT_
KEY - The object key of the root context, as in
corbaloc::host:2809/NameService, and its id in the store.
Functions§
- to_name
- Parses a stringified name, as
NamingContextExt::to_namedoes: components are separated by/, the id and kind of a component by., and\escapes the next character.a.b/c\/d/.eis the name[("a", "b"), ("c/d", ""), ("", "e")];.alone is a component with an empty id and kind. - to_
string - Writes a name in the string form
to_namereads, asNamingContextExt::to_stringdoes. An empty name is invalid. - to_url
- Makes a
corbaname:URL from acorbalocaddress list (such as:host:2809oriiop:1.2@host) and a stringified name, escaping the name as a URL, likeNamingContextExt::to_url:to_url(":host:2809", "a/b c")iscorbaname::host:2809#a/b%20c.
Type Aliases§
- Name
CosNaming::Name: a sequence of components, from the outermost context.