pub struct CoreX { /* private fields */ }
Expand description
The Core system manages the router and extensions. It allows registering extensions and running the server.
Implementations§
Source§impl CoreX
impl CoreX
Sourcepub fn new(host: String, port: u16) -> Self
pub fn new(host: String, port: u16) -> Self
Creates a new Core system with the specified host and port.
§Arguments
host
- The host address to bind the server to (e.g., “127.0.0.1”).port
- The port number to bind the server to (e.g., 3000).
Sourcepub fn register_extension(&mut self, extension: Arc<dyn ExtensionTrait>)
pub fn register_extension(&mut self, extension: Arc<dyn ExtensionTrait>)
Registers an extension with the Core system.
§Arguments
extension
- AnArc<dyn ExtensionTrait>
representing the extension to register.
Auto Trait Implementations§
impl Freeze for CoreX
impl !RefUnwindSafe for CoreX
impl Send for CoreX
impl Sync for CoreX
impl Unpin for CoreX
impl !UnwindSafe for CoreX
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