Skip to main content

rustorb_core/
lib.rs

1//! ORB core: connection management, request dispatch and the POA.
2//!
3//! Network I/O runs on an internal multi-threaded tokio runtime, and
4//! servants are invoked on a separate pool of long-lived ORB threads.
5//! The public API is synchronous.
6//!
7//! The client side:
8//!
9//! - [`Orb`] owns the runtime and a pool of GIOP connections, one per
10//!   server endpoint. [`Orb::string_to_object`] accepts stringified IORs,
11//!   `corbaloc:` and `corbaname:` URLs, and
12//!   [`Orb::resolve_initial_references`] the
13//!   `-ORBInitRef` / `-ORBDefaultInitRef` options.
14//! - [`ObjectRef::request`] builds a request whose arguments are written to
15//!   an [`OutStream`]; [`Request::invoke`] returns a [`Reply`] to read with
16//!   an [`InStream`], or an [`Exception`]. Requests use GIOP 1.0 to 1.2 as
17//!   the target's profile allows, follow `LOCATION_FORWARD`, answer
18//!   `NEEDS_ADDRESSING_MODE`, try alternate addresses, and are sent again
19//!   after a `CloseConnection` from the server.
20//! - [`name`] has the CosNaming name type and its string form, used for
21//!   `corbaname:` and by the naming service client in `rustorb-naming`.
22//! - [`TypeCode`] describes IDL types, and [`Any`] holds a [`Value`] of
23//!   any type; [`OutStream::write_any`] and [`InStream::read_any`] marshal
24//!   them, and [`OutStream::write_value`] / [`InStream::read_value`]
25//!   marshal any value as its TypeCode says.
26//! - [`CodeSets`] negotiates the transmission code sets from the IOR and
27//!   converts `string` data; rustorb's native code sets are UTF-8 and
28//!   UTF-16.
29//!
30//! The server side, started by [`Orb::root_poa`]:
31//!
32//! - The ORB listens on [`OrbOptions::endpoints`] and answers GIOP 1.0 to
33//!   1.2 requests in the version they came in.
34//! - [`Poa`] is the RootPOA and the POAs created under it, with their
35//!   [`Policy`] values, active object maps and [`PoaManager`]s. Object keys
36//!   of PERSISTENT POAs have omniORB's format, so references survive a
37//!   switch between the two.
38//! - A [`Servant`] reads its arguments from an [`InStream`] and writes the
39//!   result or a user exception to a [`ServerReply`]. Servants run on a
40//!   pool of long-lived upcall threads, never on the I/O threads, and
41//!   requests of one connection run in parallel. SINGLE_THREAD_MODEL POAs
42//!   run their requests one at a time, and MAIN_THREAD_MODEL ones on the
43//!   thread in [`Orb::run`] or [`Orb::perform_work`].
44//! - Objects not in the active object map can be served by a default
45//!   servant, a [`ServantActivator`] or a [`ServantLocator`], and child
46//!   POAs created on demand by an [`AdapterActivator`]. [`PoaCurrent`]
47//!   tells a servant which object a request is for.
48//! - Calls to objects of the same ORB do not use the network: the request
49//!   is marshalled and dispatched on the calling thread.
50//! - [`Orb::run`] waits for [`Orb::shutdown`], which finishes the running
51//!   requests and closes every connection with `CloseConnection`.
52
53mod codeset;
54mod connection;
55pub mod dii;
56pub mod dynany;
57mod exception;
58mod fixed;
59pub mod idl;
60pub mod name;
61mod object;
62mod orb;
63mod poa;
64pub mod policy;
65mod pool;
66mod servant;
67mod server;
68mod stream;
69mod timeout;
70mod tls;
71pub mod typecode;
72mod value;
73mod wire;
74
75pub use codeset::CodeSets;
76pub use dynany::{DynAny, DynAnyError, DynAnyFactory};
77pub use exception::{
78    Exception, OMG_VMCID, SystemException, SystemExceptionKind, UserException, minor,
79};
80pub use fixed::{Fixed, ParseFixedError};
81pub use object::{AsyncRequest, ObjectRef, Reply, Request};
82pub use orb::{ClientAuth, EndpointAddr, Orb, OrbOptions, ResolveError, TlsOptions};
83pub use poa::{
84    IdAssignment, IdUniqueness, ImplicitActivation, Lifespan, ObjectId, Poa, PoaCurrent, PoaError,
85    PoaManager, PoaManagerState, Policies, Policy, RequestProcessing, ServantRetention,
86    ThreadPolicy,
87};
88pub use policy::{PolicyError, PolicyType, PolicyValue, SetOverrideType};
89pub use rustorb_cdr as cdr;
90pub use rustorb_cdr::{LongDouble, Octets};
91pub use rustorb_giop as giop;
92pub use rustorb_giop::CompletionStatus;
93pub use servant::{
94    AdapterActivator, Cookie, Servant, ServantActivator, ServantLocator, ServantManager,
95    ServantManagerError, ServerReply,
96};
97pub use stream::{InStream, OutStream};
98pub use timeout::{set_thread_call_timeout, thread_call_timeout};
99pub use typecode::{TCKind, TypeCode, TypeCodeError};
100pub use value::{
101    Any, CustomReader, Native, Value, ValueRef, ValueTypeResolver, lookup_value_type,
102    register_custom_reader, register_value_type, set_value_type_resolver, unregister_custom_reader,
103    unregister_value_type,
104};