pub struct LdpServer { /* private fields */ }Expand description
A minimal LDP server for testing and research.
Implementations§
Source§impl LdpServer
impl LdpServer
Sourcepub fn new(identity: LdpIdentityCard, handler: TaskHandler) -> Self
pub fn new(identity: LdpIdentityCard, handler: TaskHandler) -> Self
Create a new LDP server with the given identity and task handler.
Sourcepub fn with_signing_secret(self, secret: impl Into<String>) -> Self
pub fn with_signing_secret(self, secret: impl Into<String>) -> Self
Set a signing secret for HMAC message signing (builder pattern).
Sourcepub fn echo_server(delegate_id: &str, name: &str) -> Self
pub fn echo_server(delegate_id: &str, name: &str) -> Self
Create a test server with an echo handler (returns input as output).
Sourcepub fn identity(&self) -> &LdpIdentityCard
pub fn identity(&self) -> &LdpIdentityCard
Get the identity card.
Sourcepub fn handle_identity_request(&self) -> Value
pub fn handle_identity_request(&self) -> Value
Handle a GET /ldp/identity request.
Sourcepub fn handle_capabilities_request(&self) -> Value
pub fn handle_capabilities_request(&self) -> Value
Handle a GET /ldp/capabilities request.
Sourcepub async fn handle_message(
&self,
envelope: LdpEnvelope,
) -> Result<LdpEnvelope, String>
pub async fn handle_message( &self, envelope: LdpEnvelope, ) -> Result<LdpEnvelope, String>
Handle a POST /ldp/messages request.
Processes the incoming LDP envelope and returns a response envelope.
Sourcepub async fn active_sessions(&self) -> usize
pub async fn active_sessions(&self) -> usize
Get active session count.
Sourcepub async fn completed_tasks(&self) -> usize
pub async fn completed_tasks(&self) -> usize
Get completed task count.
Auto Trait Implementations§
impl Freeze for LdpServer
impl !RefUnwindSafe for LdpServer
impl Send for LdpServer
impl Sync for LdpServer
impl Unpin for LdpServer
impl UnsafeUnpin for LdpServer
impl !UnwindSafe for LdpServer
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