Comments (12)
I disagree. It would be better to prevent passing invalid URLs by using a URL type as the input.
from ashpd.
The latest zvariant release implement the necessary types for us to make use of url::Url type.
from ashpd.
I don't think it is useful to depend on an external crate for this. But yes, having some very basic in-tree URI type that can be used instead of plain String
would be nice. Do you want to submit a patch for that? There are not that many usages that I can think of.
Only Account, Screenshot & FileChooser returns a URI.
from ashpd.
This would be a breaking API change. Would you want to make a new major release just for this? Or maybe wait and do this together with other breaking changes?
from ashpd.
This would be a breaking API change. Would you want to make a new major release just for this? Or maybe wait and do this together with other breaking changes?
I am planning to make a new major release yes so it is fine to do breaking changes
from ashpd.
I am not sure this is the best idea. The user can always do
let uri = url::Url::parse("something")?;
some_ashd_portal(uri.into()).await?;
when verification is needed. But maybe forcing the parse on our side is a good idea?
from ashpd.
For my use case I am more concerned with properly handling URIs read from ashpd. I was making mistaken assumptions about the returned data which the compiler let me do because it was a String. If its type conveyed it was a URI, that couldn't be ignored.
from ashpd.
There is no URI inputs, only outputs btw. So we could have just a pub struct URI(String)
& return that.
from ashpd.
Doesn't the uri portal require a url input
from ashpd.
Doesn't the uri portal require a url input
Hmm yeah indeed.
from ashpd.
there is also the wallpaper portal that takes a uri
from ashpd.
I think the best thing to do is to accept arbitrary strings, but return early (error) if, say, url::Url::parse(input) fails.
from ashpd.
Related Issues (20)
- Suspiciously long compile time when using traits HOT 5
- Links to the DBus interfaces no longer point to the right place HOT 3
- demo: Default view has a preselected panel HOT 1
- Change dependency ordering in Cargo.toml across gtk4/gtk4x11/gtk4wayland
- unable to build `ashpd-demo` on Ubuntu 23.10 HOT 1
- Support WindowIdentifier::from_native with X11 disabled HOT 2
- Simultaneous creation of proxies results in a "Can't reset a OnceCell" panic
- input_capture portal Signals are not working HOT 15
- Settings portal binding no contrast key? HOT 2
- Add persistence and session restore for the RemoteDesktop portal. HOT 4
- Add an input catpure demo HOT 1
- Instructions on how to run the demo HOT 1
- Response deserialization broken on master branch HOT 2
- Calling unimplemented portals should return a specific Error variant
- Global shortcuts: missing field session_handle HOT 1
- Unable to get WindowIdentifier on wayland due to protocol error when using gtk-layer-shell HOT 3
- Figure out a way to tie a Session to a specific portal
- Allow changing the HandleToken format HOT 2
- Windows and GTK4? HOT 1
- Notification tests with dummy data HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ashpd.