Commit Graph

34 Commits

Author SHA1 Message Date
Sebastian Thiel
9f719dd928 feat(json): added field aliases, were needed
This makes sure our fields can properly be decoded.
2015-03-20 14:16:06 +01:00
Sebastian Thiel
b9a81a900e fix(cmn): serde cleanup;JsonError pub fields 2015-03-20 12:05:29 +01:00
Sebastian Thiel
d3bb130be0 feat(lib): use serge instead of serialize
However, for some reason, the `Serialize/Deserialize` macros don't work
for me, even though they work just fine in the respective tests of
the serge crate. What am I possibly doing wrong ?
2015-03-20 11:28:09 +01:00
Sebastian Thiel
265b448297 feat(doit): simplify delegate calls
Now we use the DefaultDelegate as standin in case there is user-delgate.
That way, we save plenty of complexity as no additional
`if let Some(ref mut dlg) = delegate` is necesary.

Fixes #30
2015-03-19 19:26:19 +01:00
Sebastian Thiel
508d14eafb feat(delegate): begin()/finished() calls
During `begin()`, the delegate receives additional information about the
current call, which can be useful for performance tracking, among
other things.

Fixes #25
2015-03-19 15:30:39 +01:00
Sebastian Thiel
9d401f5486 feat(doit): optimizations and simplification; seek
* MultiPartReader is using match to handle state, reducing unnecessary
  calls to 0 in that regard.
* Fixed seek() calls on readers, assuring they are reset to start each
  time the loop is done.
* both media-parameters now use `ReadSeek` streams.
* Use `seek()` to figure out size, simplifying the interface.

Closes #17
2015-03-19 07:30:43 +01:00
Sebastian Thiel
6b2301351f fix(common): MultiPartReader test case
Simple fixes, required as its API changed
2015-03-18 22:18:17 +01:00
Sebastian Thiel
224af64068 feat(doit):optimized memory allocation and options
* reserve_exact(X) where possible (params, multi-part-reader)
* `if let` used whereever possible to prevent duplicate checks

This increases the possible performance, and makes for more readable,
concise code.
2015-03-18 22:03:52 +01:00
Sebastian Thiel
e53e23a893 fix(common): MultiPartReader now works correctly
The state-handling was incorrect, causing it to not handle small reads
correctly.
However, this is working nicely now.
2015-03-18 21:09:48 +01:00
Sebastian Thiel
b127df17b0 feat(common): multibytereader single byte test
It shows that we actually don't handle our state correctly.
The first test which reads to string obviously uses a big-enough buffer.
2015-03-18 19:05:07 +01:00
Sebastian Thiel
8db346b8b0 feat(common): MultiPartReader is working.
Something that is missing is a single-byte read test
2015-03-18 18:48:03 +01:00
Sebastian Thiel
71c827b306 feat(doit): initial part writing
We are a state-machine, and handle parts of it correctly.
However, we don't yet write the boundary at all, and could improve
our use of match.
2015-03-18 17:53:39 +01:00
Sebastian Thiel
fc589cb965 feat(doit): multi-part mime-type and add_parts()
Next we will implement the actual Read method
2015-03-18 16:15:51 +01:00
Sebastian Thiel
b0a1f518e9 feat(doit): more multipart infrastructure
* outer frame of `MultiPartReader` to allow using it in `doit()`
* restructured `doit()` to get content-types right

There is more work to do, as it currently doesn't compile, nor
do we deal with our streams correctly.

But we are on a good way.
2015-03-18 12:40:18 +01:00
Sebastian Thiel
60adacf8d4 feat(doit): pre-request delegate call.
This one is likely to change the further we advance in the upload-media
implementation.
2015-03-17 09:21:18 +01:00
Sebastian Thiel
eef1471357 feat(doit): json decode and delegation
Now json errors are handled and delegated with the option to retry,
and all other values are just decoded according to plan.

For now, I brutally unwrap json values assuming this will work, because
it really should work.
2015-03-16 17:14:04 +01:00
Sebastian Thiel
2c79f6e3cf feat(doit): authentication with and without scopes
It's quite rough around the edges, but has a slight chance to work.
Will still to handle return values accordingly.
2015-03-16 15:23:38 +01:00
Sebastian Thiel
9a58b0badd feat(doit): attempt to send json-encoded request
This doesn't work yet, as I am unable to unwrap the client properly.
It's a refcell that contains a BorrowMut to a hyper::Client, and
lets just, it's complicated.
2015-03-16 10:35:26 +01:00
Sebastian Thiel
7758f99ff2 fix(dev): typo 2015-03-11 22:59:18 +01:00
Sebastian Thiel
da300e035e feat(result): generic result type
... and we actually add additional fields to our fields list.
2015-03-09 16:16:13 +01:00
Sebastian Thiel
7c6f7d5e97 feat(params): additional fields and Result type
Now query params are handled completely, including clash check.
Additionally, there is a new result type which encapsulates everything.

It must be typed to the actual result type though, which can be a
request result
2015-03-09 15:49:53 +01:00
Sebastian Thiel
6c41660943 feat(fields): put all fields onto a list
Also handle the case when the 'part' field is generated from the
request. Additional params still need work
2015-03-09 15:26:04 +01:00
Sebastian Thiel
1423e46210 fix(delegate): it now works in every which way
Custom property annotations have been very useful, to steer very special
cases.

It's also good that now there is enough infrastructure to deal with
any amount of additional type parameters.
2015-03-09 11:55:33 +01:00
Sebastian Thiel
432faa275f feat(dev): spike to see how delegate can be work
To avoid an additional type parameter, we will use dynamic dispatch
for the delegate.

Having function overrides at some point seems like an excercise better
left for version 1.1 ;)
2015-03-09 11:18:44 +01:00
Sebastian Thiel
678b6929ca feat(delegate): first attempt to get it to work
With a big but ! The most simple thing to do it was to just add
additional type parameters to the respective method.

Now the type cannot be inferred, which means type-hints must be added.
This should be easy enough, but ... has to be done somehow.
2015-03-09 10:44:13 +01:00
Sebastian Thiel
ac35432b3f docs(lib): cross linking of resources/activities
This makes it so much easier to get to the example call you are
interested in.
It's getting there, slowly ;)
2015-03-08 18:58:15 +01:00
Sebastian Thiel
5b2d8a77a3 feat(mbuild): media-upload doit() methods
It's just a first step, and even though the generation works well,
I am still missing the right Rust code. Will have to simplify ...
2015-03-08 15:49:28 +01:00
Sebastian Thiel
48d40d45c5 feat(builders): request type handling part 1
Now we will generate proper resoure methods builder calls to instaniate
the more or less valid method builders.

However, it doesn't compile yet, and the 'to_parts()' method on
resources is still missing.
2015-03-05 08:27:07 +01:00
Sebastian Thiel
942cbe18f1 feat(mbuild): infrastructure for method builders
Now comes the actual work of setting them up.
Additionally, the docs were decluttered to show comments only
were necessary. Now the code path to getting the hub is as concise as
possible.
2015-03-04 17:16:50 +01:00
Sebastian Thiel
01db89057d feat(builder): Partial MethodBuilder impl
Including documentation at least on the method builder part. The
great thing is that fully working examples are now included on
every type !

Now more involved part starts ... namely setting up the individual call
method signatures.
2015-03-04 15:24:23 +01:00
Sebastian Thiel
615a124654 feat(hub): generate hub implementation and docs
This includes docs for the library usage.
It's totally great to be able to paste example code right were it
belongs, and also put the same elsewhere to compose more complex docs.
2015-03-04 11:07:14 +01:00
Sebastian Thiel
e164cf7366 feat(docs): Traits now show up as part of lib
Previously, they were in an extra, oddly named crate.
Now we just make it a part of our generated codebase.

That way, traits, and common code, shows up as part of the library.
Fair enough.

This also means that the types ar not reusable.
Maybe a mixed-mode can be used if that is desired.
2015-03-03 10:02:40 +01:00
Sebastian Thiel
c1eeee0591 feat(traits): add marker traits to schema types
Based on their involvement in activities.
It nearly works perfectly.
2015-03-03 09:25:42 +01:00
Sebastian Thiel
475163ec29 feat(mako): now sets up entire project structure
That way, we have a common library to pull in from the main repository,
and a space for testing new code (in a partial implementation).

Next there will be generated object structures.
2015-03-02 16:50:22 +01:00