MCPcopy Create free account

hub / github.com/BersisSe/feather / functions

Functions143 in github.com/BersisSe/feather

↓ 29 callersMethodset_state
Insert or replace a state value keyed by its concrete type. State values are stored as `Arc<T>` and can be accessed from any middleware. # Example
crates/feather/src/internals/context.rs:268
↓ 23 callersMethodsend_text
Sends given String as given text
crates/feather-runtime/src/http/response.rs:121
↓ 21 callersMethodset_status
Sets the StatusCode of the response and Returns a Muteable Reference to the Response ```rust,ignore res.status(200).send_text("hello"); ```
crates/feather-runtime/src/http/response.rs:39
↓ 11 callersMethodlisten
Start the application and listen for incoming requests. This method blocks the current thread and starts accepting connections on the specified addre
crates/feather/src/internals/app.rs:363
↓ 9 callersMethodadd_header
Adds a header to the response. The header is a key-value pair that provides additional information about the response.
crates/feather-runtime/src/http/response.rs:47
↓ 9 callersMethodto_raw
Converts the `Response` into a raw HTTP response as Bytes.
crates/feather-runtime/src/http/response.rs:54
↓ 8 callersMethoduse_middleware
(&mut self, middleware: impl Middleware + 'static)
crates/feather/src/internals/app.rs:331
↓ 5 callersMethodsend_json
(&mut self, data: &T)
crates/feather-runtime/src/http/response.rs:145
↓ 4 callersMethodpath
Returns the path of the Request
crates/feather-runtime/src/http/request.rs:101
↓ 3 callersMethodcontext
Returns a mutable reference to the [AppContext]. The context is used for application-wide state management. Use it to store and retrieve data that ne
crates/feather/src/internals/app.rs:181
↓ 3 callersMethodhandle
(&self, req: Request, _stream: Option<TcpStream>)
crates/feather-runtime/tests/common/mod.rs:16
↓ 3 callersMethodhandle_io_error
(&self, e: io::Error, path: &Path, response: &mut Response)
crates/feather/src/middlewares/builtins.rs:144
↓ 3 callersMethodlock
Get a mutable lock guard to access the inner state directly. This is useful when you need to hold the lock for multiple operations or need direct acc
crates/feather/src/internals/context.rs:131
↓ 2 callersFunctioncreate_test_request
Helper to create a test HTTP request
crates/feather-runtime/tests/common/mod.rs:26
↓ 2 callersMethodhandle
(&self, mut req: feather_runtime::http::Request, _stream: Option<MayStream>)
crates/feather/src/internals/service.rs:98
↓ 2 callersMethodhandle
(&self, request: &mut Request, response: &mut Response, ctx: &AppContext)
crates/feather/src/middlewares/common.rs:52
↓ 2 callersMethodjwt
(&self)
crates/feather/src/internals/context.rs:248
↓ 2 callersMethodsend_bytes
Sends Given Bytes as plain text
crates/feather-runtime/src/http/response.rs:128
↓ 2 callersMethodsend_html
Takes a String(Should be valid HTML) and sends it's as Html
crates/feather-runtime/src/http/response.rs:135
↓ 2 callersMethodset_common_headers
Internal helper to set common headers
crates/feather-runtime/src/http/response.rs:28
↓ 2 callersFunctionsplit_request
(buf: &[u8])
crates/feather-runtime/tests/common/mod.rs:39
↓ 1 callersFunctionapi_router
()
examples/router/src/api.rs:4
↓ 1 callersMethoddecode
Decode and validate a token into claims of type `T`. # Arguments `token` - The JWT token string # Returns The decoded claims if valid, or an error
crates/feather/src/jwt.rs:136
↓ 1 callersMethodencode
Encode claims into a JWT token. # Arguments `claims` - The claims to encode (must implement Serialize) # Returns The JWT token string if successfu
crates/feather/src/jwt.rs:170
↓ 1 callersMethodfinish_json
(&mut self, data: &T)
crates/feather/src/internals/runtime_extensions.rs:34
↓ 1 callersMethodgenerate_simple
Generate a simple token with subject and time-to-live. This is a convenience method for quick token generation without defining a custom claims struc
crates/feather/src/jwt.rs:190
↓ 1 callersMethodmount
Mount a [Router] to a specific path prefix. All routes within the router will be prepended with this prefix. # Example ```rust,ignore let mut app = Ap
crates/feather/src/internals/app.rs:293
↓ 1 callersMethodquery
Returns a Hashmap of the query parameters of the Request. Returns a Error if parsing fails
crates/feather-runtime/src/http/request.rs:84
↓ 1 callersMethodrun
Runs the server until shutdown is called
crates/feather-runtime/src/runtime/server.rs:76
↓ 1 callersMethodset_error_handler
(&mut self, handler: ErrorHandler)
crates/feather/src/internals/app.rs:200
↓ 1 callersMethodset_jwt
(&mut self, jwt: JwtManager)
crates/feather/src/internals/context.rs:227
↓ 1 callersMethodset_params
(&mut self, params: HashMap<String, String>)
crates/feather-runtime/src/http/request.rs:92
↓ 1 callersMethodvalidate
(&self)
crates/feather/src/jwt.rs:58
Function_chainer
Can be used to chain two middlewares together. The first middleware will be executed first. If it returns `MiddlewareResult::Next`, the second middlew
crates/feather/src/middlewares/common.rs:101
Methodconn_handler
The main coroutine function: reads, dispatches, and manages stream lifecycle.
crates/feather-runtime/src/runtime/server.rs:143
Methoddecrement
Decrement the counter
examples/counter/src/main.rs:16
Methoddefault
()
crates/feather/src/internals/context.rs:332
Methoddefault
()
crates/feather-runtime/src/runtime/server.rs:29
Functionderive_claim
(input: TokenStream)
crates/feather-macros/src/lib.rs:72
Methodfinish_bytes
(&mut self, data: impl Into<Vec<u8>>)
crates/feather/src/internals/runtime_extensions.rs:28
Methodfinish_html
(&mut self, data: impl Into<String>)
crates/feather/src/internals/runtime_extensions.rs:23
Methodfinish_text
(&mut self, text: impl Into<String>)
crates/feather/src/internals/runtime_extensions.rs:18
Functionfirst
()
examples/middleware/src/main.rs:32
Methodfmt
(&self, f: &mut fmt::Formatter<'_>)
crates/feather-runtime/src/http/request.rs:111
Methodget_clone
Get a clone of the inner state. This is a convenience method for cloneable state types. It automatically acquires the lock, clones the value, and rel
crates/feather/src/internals/context.rs:154
Functionget_data
()
examples/router/src/api.rs:19
Functionget_handler
()
examples/api/src/main.rs:53
Methodget_state
Get state by type, panicking if not found. # Panics Panics if state of the requested type has not been set. Use [`try_get_state`] if you want to ha
crates/feather/src/internals/context.rs:310
Functionget_user
()
examples/context/src/main.rs:68
Functionglobal_logger
()
examples/router/src/main.rs:5
Methodguess_content_type
(path: &Path)
crates/feather/src/middlewares/builtins.rs:164
Methodhandle
(&self, _request: &mut feather::Request, _response: &mut feather::Response, _ctx: &feather::AppContext)
examples/middleware/src/middleware.rs:8
Methodhandle
(&self, req: &mut Request, res: &mut Response, ctx: &AppContext)
crates/feather/src/internals/router.rs:67
Methodhandle
(&self, _request: &mut Request, _: &mut Response, _: &AppContext)
crates/feather/src/middlewares/builtins.rs:36
Methodincrement
Increment the counter
examples/counter/src/main.rs:12
Methodjson
(&self)
crates/feather-runtime/src/http/request.rs:79
Functionjwt_required
(_attr: TokenStream, item: TokenStream)
crates/feather-macros/src/lib.rs:356
Methodlen_to_header_value
A Utily Function for wrapping HeaderValue for Content-Lenght
crates/feather-runtime/src/http/response.rs:211
Functionlogin
()
examples/context/src/main.rs:37
Functionmain
Example: Error pipeline in Feather Demonstrates propagating errors from handlers and customizing error responses.
examples/error-pipeline/src/main.rs:5
Functionmain
()
examples/middleware/src/main.rs:4
Functionmain
()
examples/counter/src/main.rs:21
Functionmain
To Use this example you need to have a 'public' directory with some static files in it in the same directory as this file. This example shows how to u
examples/serve/src/main.rs:6
Functionmain
()
examples/logging/src/main.rs:6
Functionmain
Main function
examples/basic-app/src/main.rs:7
Functionmain
()
examples/context/src/main.rs:10
Functionmain
()
examples/dynamic_route/src/main.rs:6
Functionmain
()
examples/api/src/main.rs:8
Functionmain
()
examples/router/src/main.rs:10
Functionmain
()
examples/jwt/src/main.rs:9
Methodmatch_route
(pattern: &'r str, path: &'r str)
crates/feather/src/internals/service.rs:76
Methodmax_body
(&mut self, size: usize)
crates/feather/src/internals/app.rs:211
Functionmiddleware_fn
(_attr: TokenStream, item: TokenStream)
crates/feather-macros/src/lib.rs:229
Methodnew
Create a new JWT manager with a secret key. # Arguments `secret` - A cryptographically secure secret for signing/verifying tokens # Example ```rus
crates/feather/src/jwt.rs:109
Methodnew
()
crates/feather/src/internals/app.rs:64
Methodnew
()
crates/feather/src/internals/router.rs:30
Methodnew
Creates a new State wrapping the given value.
crates/feather/src/internals/context.rs:63
Methodnew
(origin: String)
crates/feather/src/middlewares/builtins.rs:78
Methodnew
Create a new Server instance with the given Service
crates/feather-runtime/src/runtime/server.rs:51
Methodparam
(&self, key: &str)
crates/feather-runtime/src/http/request.rs:96
Methodparse
Parses a Request from raw bytes if parsing fails returns a error
crates/feather-runtime/src/http/request.rs:36
Functionprotected2
(claims: MyClaim)
examples/jwt/src/main.rs:78
Methodread_timeout
(&mut self, seconds: u64)
crates/feather/src/internals/app.rs:223
Methodredirect
Redirect the Request to the given location using a `location` header.
crates/feather-runtime/src/http/response.rs:197
Methodremote_addr
Returns the Remote address of the Request.
crates/feather-runtime/src/http/request.rs:105
Methodremove_state
Remove a state value of the given type. Returns `true` if the state was present and removed, `false` otherwise. # Example ```rust,ignore if ctx.rem
crates/feather/src/internals/context.rs:325
Methodroute
(&mut self, method: Method, path: impl Into<Cow<'static, str>>, middleware: M)
crates/feather/src/internals/app.rs:276
Methodroute
(&mut self, method: Method, path: impl Into<Cow<'static, str>>, mw: M)
crates/feather/src/internals/router.rs:41
Methodrun_middleware
(mut request: &mut Request, routes: &[Route], global_middleware: &[Arc<dyn Middleware>], context: &AppContext,
crates/feather/src/internals/service.rs:23
Functionsecond
()
examples/middleware/src/main.rs:38
Methodsend_error
Helper to send basic HTTP errors with proper headers
crates/feather-runtime/src/runtime/server.rs:127
Methodsend_file
Take a [File] Struct and sends it as a file. File size is limited to 4MB. For larger files, chunked transfer\[WIP] is recommended.
crates/feather-runtime/src/http/response.rs:165
Methodshutdown
Initiates a graceful shutdown of the server
crates/feather-runtime/src/runtime/server.rs:71
Functionsplit_request
(buf: &[u8])
crates/feather-runtime/tests/request_tests.rs:6
Methodstack_size
(&mut self, size: usize)
crates/feather/src/internals/app.rs:248
Methodstrip_unc
Internal Strip the Windows UNC Prefix.
crates/feather/src/middlewares/builtins.rs:135
Functiontest_arc_sharing
()
crates/feather/src/internals/context.rs:451
Functiontest_clone_shares_state
()
crates/feather/src/internals/context.rs:467
Functiontest_complex_type
()
crates/feather/src/internals/context.rs:503
Functiontest_concurrent_reads
()
crates/feather/src/internals/context.rs:558
next →1–100 of 143, ranked by callers